|
|
@ -21,17 +21,19 @@ class MyHomePage extends StatefulWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
|
|
|
|
|
|
final db = Firestore.instance.collection('lots');
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(title: Text('Lot 1')),
|
|
|
|
appBar: AppBar(title: Text('Lot 1')),
|
|
|
|
body: _buildBody(context),
|
|
|
|
body: _buildBody(context, db),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildBody(BuildContext context) {
|
|
|
|
Widget _buildBody(BuildContext context, CollectionReference stallDB) {
|
|
|
|
return StreamBuilder<QuerySnapshot>(
|
|
|
|
return StreamBuilder<QuerySnapshot>(
|
|
|
|
stream: Firestore.instance.collection('Lot1').snapshots(),
|
|
|
|
stream: stallDB.snapshots(),
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
if (!snapshot.hasData) return LinearProgressIndicator();
|
|
|
|
if (!snapshot.hasData) return LinearProgressIndicator();
|
|
|
|
|
|
|
|
|
|
|
|