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(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text('Lot 1')),
|
appBar: AppBar(title: Text('Lot 1')),
|
||||||
body: _buildBody(
|
body: _buildBody(
|
||||||
context, db.document('Test-Lot-46').collection('stalls')),
|
context, db.document('Lot1').collection('stalls')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,24 +54,41 @@ 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);
|
||||||
|
if (record.open) {
|
||||||
return Card(
|
return Card(
|
||||||
key: ValueKey(record.stall),
|
key: ValueKey(record.stall),
|
||||||
color: Colors.blue,
|
color: Colors.green[300],
|
||||||
|
child: Center(
|
||||||
child: Center(
|
child: Column(
|
||||||
child: Column(
|
children: [
|
||||||
children: [
|
ListTile(
|
||||||
ListTile(
|
title: Text("Stall " + record.stall.toString(),
|
||||||
title: Text("Stall " + record.stall.toString(),
|
style: TextStyle(fontWeight: FontWeight.w500)),
|
||||||
style: TextStyle(fontWeight: FontWeight.w500)),
|
subtitle: Text(record.open.toString()),
|
||||||
subtitle: Text(record.open.toString()),
|
),
|
||||||
),
|
],),
|
||||||
],),
|
),
|
||||||
),
|
);
|
||||||
|
} //if
|
||||||
|
else {
|
||||||
|
return Card(
|
||||||
|
key: ValueKey(record.stall),
|
||||||
|
color: Colors.red[100],
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
title: Text("Stall " + record.stall.toString(),
|
||||||
|
style: TextStyle(fontWeight: FontWeight.w500)),
|
||||||
|
subtitle: Text(record.open.toString()),
|
||||||
|
),
|
||||||
|
],),
|
||||||
|
),
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user