简体   繁体   中英

Flutter Firebase snapshot code not working

I am using firebase real time database in my project. Normally, this structure works, but when I try, the function does not continue. I would be glad if you can help me what is the reason for this.

while(flag){
  print("i = ${i}");
  final snapshot2 = await ref.child('aaaaaaaaaaaaaaaaaaa/place/${i.toString()}').get();
 print(snapshot2.value);
  if(snapshot2.exists){
    print("Exits");
    i++;
  }else{
    print("Does not Exits");
    flag = false;
  }
}

better to recheck collection name in firestore. If the collection name not given properly that returns nothing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM