diff --git a/flutter_app/lib/main.dart b/flutter_app/lib/main.dart index 11a48d8..7cd49cd 100644 --- a/flutter_app/lib/main.dart +++ b/flutter_app/lib/main.dart @@ -41,8 +41,11 @@ class _MyHomePageState extends State { } Widget _buildList(BuildContext context, List snapshot) { - return ListView( - padding: const EdgeInsets.only(top: 20.0), + return GridView.count( + primary: false, + padding: const EdgeInsets.all(60), + crossAxisSpacing: 1.0, + crossAxisCount: 2, children: snapshot.map((data) => _buildListItem(context, data)).toList(), ); } @@ -50,27 +53,22 @@ class _MyHomePageState extends State { Widget _buildListItem(BuildContext context, DocumentSnapshot data) { final record = Record.fromSnapshot(data); - return Padding( + return Card( key: ValueKey(record.stall), - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), - child: Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.blue), - borderRadius: BorderRadius.circular(5.0), - ), - child: ListTile( - 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}); -// }), - ), + color: Colors.blue, + + child: Center( + child: Column( + children: [ + ListTile( + title: Text("Stall " + record.stall.toString(), + style: TextStyle(fontWeight: FontWeight.w500)), + subtitle: Text(record.open.toString()), + ), + ],), ), + + ); } }