skip to Main Content

Flutter – I can't get Future to complete with a value

A value of type Object? can't be returned from the method getUser because it has a return type of Future<UserModel>. Future<UserModel> getUser(String userId) async { QuerySnapshot userDoc = await _usersCollectionRef.where('userId', isEqualTo: userId).get(); print('user doc: ${userDoc.docs[0].data()}'); //user doc: Instance of 'UserModel'…

VIEW QUESTION

Firebase – Firestore .where + Filter.and queries not working

I'm trying to perform a compound and Firestore query in Kotlin by following this guide: https://firebase.google.com/docs/firestore/query-data/queries#compound_and_queries My code is as follows: val query = Firebase.firestore .collection("profiles") .where( Filter.and( Filter.inArray("profileGender", preferenceGenderArray), Filter.equalTo("profilePaused", false) ) ) .get() Android Studio is giving me…

VIEW QUESTION

getting error zsh: command not found: flutterfire

I'm developing app in flutter and did firebase configuration to my flutter app.Using IDE - VSCode, Firebase configuration for flutter project. I'm getting error all time: zsh: command not found: flutterfire, giving error Undefined name 'DefaultFirebaseOptions'. Try correcting the name…

VIEW QUESTION
Back To Top
Search