Gonna go work on ui now see this code in a while... don't miss me to much

thomas
Thomas Atkins 5 years ago
parent f50380306b
commit 050e9709d3

@ -24,7 +24,7 @@ class _MyHomePageState extends State<MyHomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: Text('Baby Name Votes')), appBar: AppBar(title: Text('Lot 1')),
body: _buildBody(context), body: _buildBody(context),
); );
} }
@ -55,19 +55,20 @@ class _MyHomePageState extends State<MyHomePage> {
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey), border: Border.all(color: Colors.blue),
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
), ),
child: ListTile( child: ListTile(
title: Text(record.stall.toString()), title: Text("Stall #" + record.stall.toString()),
trailing: Text(record.handicap.toString()), trailing: Text("Open: " + record.open.toString()),
// onTap: () => Firestore.instance.runTransaction((transaction) async {
//// final freshSnapshot = await transaction.get(record.reference); // onTap: () => Firestore.instance.runTransaction((transaction) async {
//// final fresh = Record.fromSnapshot(freshSnapshot); // final freshSnapshot = await transaction.get(record.reference);
//// // final fresh = Record.fromSnapshot(freshSnapshot);
//// await transaction //
//// .update(record.reference, {'votes': fresh.votes + 1}); // await transaction
//// }), // .update(record.reference, {'votes': fresh.votes + 1});
// }),
), ),
), ),
); );
@ -76,13 +77,19 @@ class _MyHomePageState extends State<MyHomePage> {
class Record { class Record {
final int stall; final int stall;
final int passID;
final bool open;
final bool handicap; final bool handicap;
final DocumentReference reference; final DocumentReference reference;
Record.fromMap(Map<String, dynamic> map, {this.reference}) Record.fromMap(Map<String, dynamic> map, {this.reference})
: assert(map['handicap'] != null), : assert(map['handicap'] != null),
assert(map['Stall'] != null), assert(map['stall'] != null),
stall = map['Stall'], assert(map['passID'] != null),
assert(map['open'] != null),
stall = map['stall'],
passID = map['passID'],
open = map['open'],
handicap = map['handicap']; handicap = map['handicap'];

Loading…
Cancel
Save