I want to check if the specific number exists in database so it will fetch the password corresponding to the number or else it will return number does not exist in database in Flutter.
var dbRef = FirebaseDatabase.instance.reference().child("NewUsers");
dbRef.equalTo(numberController.text).once().then((DataSnapshot snapshot){
if(snapshot.value.isNotEmpty){
var dbRef = FirebaseDatabase.instance.reference();
dbRef.child(numberController.text).once().then((DataSnapshot snapshot){
snapshot.value.forEach((key,values) {
print(values["Password"]);
});
});
}
else{
print("pleasesignup first");
}
});
After this I'm getting the error Unhandled Exception: NoSuchMethodError: The getter 'isNotEmpty' was called on null