DB is looking a lot better now that she has all her data in order... time to try to dynamicly create view for diffrent lots
This commit is contained in:
parent
09caea9c3c
commit
e08e43625e
@ -27,7 +27,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text('Lot 1')),
|
||||
body: _buildBody(
|
||||
context, db.document('Test-Lot-46').collection('stalls')),
|
||||
context, db.document('Lot1').collection('stalls')),
|
||||
);
|
||||
}
|
||||
|
||||
@ -54,11 +54,26 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
|
||||
Widget _buildListItem(BuildContext context, DocumentSnapshot data) {
|
||||
final record = Record.fromSnapshot(data);
|
||||
|
||||
if (record.open) {
|
||||
return Card(
|
||||
key: ValueKey(record.stall),
|
||||
color: Colors.blue,
|
||||
|
||||
color: Colors.green[300],
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
title: Text("Stall " + record.stall.toString(),
|
||||
style: TextStyle(fontWeight: FontWeight.w500)),
|
||||
subtitle: Text(record.open.toString()),
|
||||
),
|
||||
],),
|
||||
),
|
||||
);
|
||||
} //if
|
||||
else {
|
||||
return Card(
|
||||
key: ValueKey(record.stall),
|
||||
color: Colors.red[100],
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
@ -73,6 +88,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class Record {
|
||||
|
Loading…
Reference in New Issue
Block a user