You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
E/flutter (24894): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] UnhandledException:NoSuchMethodError:The method '[]' was called onnull.
E/flutter (24894):Receiver:nullE/flutter (24894):Tried calling: []("currentGroup")
This happened because of this
final currentuser =Provider.of<FirebaseUser>(context);
Firestore.instance.collection('userdetails').document(currentuser.uid).get().then((value) {
if (value.data['currentGroup'] !=null) {
}
...
The main reason was that data for my uid (got from auth was not found in database).
A better approach would be to load/fill user object from the database using a constructor inmodels/user.dart and also fill my user data with random stuff. Like username: "empty" from the database
At least it will not show error in that case
This would be a better approach for error handling in the long term
The text was updated successfully, but these errors were encountered:
tmibvishal
changed the title
Improvement in filling of user object from database from uid
Improvement in filling of user object from database from uid @kshitijalwadhi
May 31, 2020
assigned to @kshitijalwadhi
This happened because of this
The main reason was that data for my uid (got from auth was not found in database).
A better approach would be to load/fill user object from the database using a constructor in
models/user.dart
and also fill my user data with random stuff. Like username: "empty" from the databaseAt least it will not show error in that case
This would be a better approach for error handling in the long term
The text was updated successfully, but these errors were encountered: