added dividers to list

This commit is contained in:
Lynne Megido 2020-09-30 11:58:10 +10:00
parent caf0d03e3b
commit 0969b41bc3
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90
3 changed files with 4 additions and 18 deletions

View file

@ -18,13 +18,8 @@
import 'package:buyeeb_mobile/pages/main_page.dart';
import 'package:buyeeb_mobile/pages/splash.dart';
import 'package:flutter/material.dart';
import 'package:sprintf/sprintf.dart';
import 'package:provider/provider.dart';
import 'models/yahoo_auctions_item.dart';
import 'models/user_listings.dart';
import 'package:sqflite/sqflite.dart';
import 'dart:math';
import 'dart:collection';
void main() {
runApp(

View file

@ -54,18 +54,9 @@ class _MainPageState extends State<MainPage> {
Widget _buildAuctionListings() {
var listings = context.watch<UserListings>();
return ListView.builder(
padding: EdgeInsets.all(16.0),
// itemBuilder: (context, i) {
// if (i.isOdd) return Divider();
//
// final newItem = YahooAuctionsItem(id: "Henlo", name: "Hi Pempa!", price: _rng.nextInt(5000) + 500);
//
// _items.add(newItem);
//
// return ListTile(title: Text(newItem.name),
// subtitle: Text(sprintf("¥%d (≈\$%2.2f)", [newItem.price, newItem.getLocalPrice()])));
// },
return ListView.separated(
padding: EdgeInsets.all(8.0),
separatorBuilder: (context, i) => Divider(),
itemCount: listings.items.length,
itemBuilder: (context, i) => ListTile(
title: Text(listings.items[i].name),

View file

@ -14,7 +14,7 @@ class _RouteSplashState extends State<RouteSplash> {
_loadUserSettings() async {
// sleep for a bit to "simulate" loading
await Future.delayed(Duration(seconds: 3));
await Future.delayed(Duration(seconds: 1));
// add some random stuff to the listings
var listings = context.read<UserListings>();
var _rng = new Random();