The argument type 'Object?' can't be assigned to the parameter type 'Map<String, dynamic>'. I didn't understand how to solve this.
@override
Future<List<Users>?> getAllUsers() async {
QuerySnapshot querySnapshot = await firestore.collection("users").get();
List<Users> allUsers = [];
allUsers = querySnapshot.docs.map((e) => Users.fromMap(e.data())).toList();
return allUsers;
}
CodePudding user response:
QuerySnapshot<Map<String, dynamic>> querySnapshot = await firestore.collection("users").get();