UI is better now... still need to make it change colurs like a camilialine though,,,,,,,,,,,,)

This commit is contained in:
Thomas Atkins 2019-02-09 04:06:45 -06:00
parent 050e9709d3
commit 35f6a101fe

View File

@ -41,8 +41,11 @@ class _MyHomePageState extends State<MyHomePage> {
} }
Widget _buildList(BuildContext context, List<DocumentSnapshot> snapshot) { Widget _buildList(BuildContext context, List<DocumentSnapshot> snapshot) {
return ListView( return GridView.count(
padding: const EdgeInsets.only(top: 20.0), primary: false,
padding: const EdgeInsets.all(60),
crossAxisSpacing: 1.0,
crossAxisCount: 2,
children: snapshot.map((data) => _buildListItem(context, data)).toList(), children: snapshot.map((data) => _buildListItem(context, data)).toList(),
); );
} }
@ -50,27 +53,22 @@ class _MyHomePageState extends State<MyHomePage> {
Widget _buildListItem(BuildContext context, DocumentSnapshot data) { Widget _buildListItem(BuildContext context, DocumentSnapshot data) {
final record = Record.fromSnapshot(data); final record = Record.fromSnapshot(data);
return Padding( return Card(
key: ValueKey(record.stall), key: ValueKey(record.stall),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), color: Colors.blue,
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 { child: Center(
// final freshSnapshot = await transaction.get(record.reference); child: Column(
// final fresh = Record.fromSnapshot(freshSnapshot); children: [
// ListTile(
// await transaction title: Text("Stall " + record.stall.toString(),
// .update(record.reference, {'votes': fresh.votes + 1}); style: TextStyle(fontWeight: FontWeight.w500)),
// }), subtitle: Text(record.open.toString()),
), ),
],),
), ),
); );
} }
} }