From 050e9709d377940f0adb8cc6008ca6785597fa02 Mon Sep 17 00:00:00 2001 From: Thomas Atkins Date: Sat, 9 Feb 2019 03:08:01 -0600 Subject: [PATCH] Gonna go work on ui now see this code in a while... don't miss me to much --- flutter_app/lib/main.dart | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/flutter_app/lib/main.dart b/flutter_app/lib/main.dart index 93c25e3..11a48d8 100644 --- a/flutter_app/lib/main.dart +++ b/flutter_app/lib/main.dart @@ -24,7 +24,7 @@ class _MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text('Baby Name Votes')), + appBar: AppBar(title: Text('Lot 1')), body: _buildBody(context), ); } @@ -55,19 +55,20 @@ class _MyHomePageState extends State { padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), child: Container( decoration: BoxDecoration( - border: Border.all(color: Colors.grey), + border: Border.all(color: Colors.blue), borderRadius: BorderRadius.circular(5.0), ), child: ListTile( - title: Text(record.stall.toString()), - trailing: Text(record.handicap.toString()), -// onTap: () => Firestore.instance.runTransaction((transaction) async { -//// final freshSnapshot = await transaction.get(record.reference); -//// final fresh = Record.fromSnapshot(freshSnapshot); -//// -//// await transaction -//// .update(record.reference, {'votes': fresh.votes + 1}); -//// }), + title: Text("Stall #" + record.stall.toString()), + trailing: Text("Open: " + record.open.toString()), + +// onTap: () => Firestore.instance.runTransaction((transaction) async { +// final freshSnapshot = await transaction.get(record.reference); +// final fresh = Record.fromSnapshot(freshSnapshot); +// +// await transaction +// .update(record.reference, {'votes': fresh.votes + 1}); +// }), ), ), ); @@ -76,13 +77,19 @@ class _MyHomePageState extends State { class Record { final int stall; + final int passID; + final bool open; final bool handicap; final DocumentReference reference; Record.fromMap(Map map, {this.reference}) : assert(map['handicap'] != null), - assert(map['Stall'] != null), - stall = map['Stall'], + assert(map['stall'] != null), + assert(map['passID'] != null), + assert(map['open'] != null), + stall = map['stall'], + passID = map['passID'], + open = map['open'], handicap = map['handicap'];