Stream builder from firestore to flutter

前端 未结 3 614
花落未央
花落未央 2020-12-05 20:41

I am wondering how to get data from firestore to flutter app using the streambuilder. I created the necessary Boilerplate code I have the widget built and working and in the

3条回答
  •  北海茫月
    2020-12-05 21:30

    StreamBuilder>(
                  stream: AdminData().getDrivers,
                  builder: (context, snapshot) {
                    return ListView(
                      children: snapshot.data.map((document) {
                        return hadCard(
                          widget: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceAround,
                            children: [
                              hadText(title: document.name),
                              hadText(title: document.phone),
                              hadText(title: document.Driver),
                            ],
                          ),
                        );
                      }).toList(),
                    );
                  }),
    

提交回复
热议问题