I am was building a flutter application with some Sqflite and firestore database Now I have ran into a problem that whenever I run the application. I get snapshot.hasdata to true for the first time and than I get snapshot.hasdata to false in a second. I am attaching the screenshots of both console and the code here
StreamBuilder(
stream: FirebaseFirestore.instance
.collection( ADs CommonGroup )
.orderBy("id", descending: true)
.orderBy("id", descending: true)
.where( id , isEqualTo: databaseLogin[0]["number"])
.snapshots(),
builder: (
BuildContext context,
AsyncSnapshot<QuerySnapshot> snapshot,
) {
print( snapshot does not have data ${snapshot.hasData} );
print(databaseLogin[0]["number"]);
如今,这本小册子已经出版。
I/flutter (16812): snapshot does not have data false
I/flutter (16812): +923335885631
I/flutter (16812): snapshot does not have data true
I/flutter (16812): +923335885631
I/flutter (16812): snapshot does not have data false
I/flutter (16812): +923335885631
What can I do code with Console
我想到的是头痛。 如果有数据,数据应当恢复到以前一样的水平。