From 0969b41bc3c2bc7a50e16da8a5542d4c9f72beeb Mon Sep 17 00:00:00 2001 From: Lynnesbian Date: Wed, 30 Sep 2020 11:58:10 +1000 Subject: [PATCH] added dividers to list --- lib/main.dart | 5 ----- lib/pages/main_page.dart | 15 +++------------ lib/pages/splash.dart | 2 +- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 3454589..486944b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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( diff --git a/lib/pages/main_page.dart b/lib/pages/main_page.dart index 102713f..390b896 100644 --- a/lib/pages/main_page.dart +++ b/lib/pages/main_page.dart @@ -54,18 +54,9 @@ class _MainPageState extends State { Widget _buildAuctionListings() { var listings = context.watch(); - 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), diff --git a/lib/pages/splash.dart b/lib/pages/splash.dart index c0b87fd..bce4e67 100644 --- a/lib/pages/splash.dart +++ b/lib/pages/splash.dart @@ -14,7 +14,7 @@ class _RouteSplashState extends State { _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(); var _rng = new Random();