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) {
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<MyHomePage> {
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()),
color: Colors.blue,
// 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});
// }),
child: Center(
child: Column(
children: [
ListTile(
title: Text("Stall " + record.stall.toString(),
style: TextStyle(fontWeight: FontWeight.w500)),
subtitle: Text(record.open.toString()),
),
],),
),
);
}
}