Комментарии:
hey i need your help please its urgent i used your video so display the data from real time database so its displaying all the data
but i want to display single users data only
when the user logins the login data such as name, email, password should be displayed on homescreen (that too the current user only )
how to use conditions(get users where age ==24)
and if i have field that is array of objects [{}.{}.{}] how to get it from main list which we loop on
can you share the code please i need to study it thankyou
ОтветитьHi thanks for the video can you please help me I get a line error Text(snapshot.value["name"]),
The method '[]' can't be unconditionally invoked because the receiver can be 'null'.
Try making the call conditional (using '?.') or adding a null check to the target ('!').
Maybe you know the reason?
hello! your code works only to get all the data from database but i want to display the user email data only from the child('users') only can you help me? !
i have used this:
DatabaseReference userRef = FirebaseDatabase.instance.reference().child('users');
userRef.once().then((snapshot) {
//here i get all the data
print(snapshot.snapshot.value);
});
and when i use this : snapshot.snapshot.value['email']; i get an error
i have this error .. The operator '[]' isn't defined for the type 'Object'.
Try defining the operator '[]'
any solutions?
To anyone having this error
" The operator '[]' isn't defined for the type 'Object'.
Try defining the operator '[]'"
just change to this ===> Text(snapshot.child('YOURFEILDKEY').value.toString())
and u will be able to retrive the feild u want XD
Hello pls can you show your firebase dependency ? i use a newer version and it's show me an error when i write :
"subtitle: snapshot.value['name'],"