I don't know how to do it. It's not working at the moment. The 'Future' function is very confusing me.
Future<void> createUser(String userId, String name, String surname, String email, String role, String imageUrl) async {
try {
var token = await messagingService.getToken();
return await db.collection(CommonFirebaseRemoteDataSource.usersCollectionName).doc(userId).set({
"name": name,
"surname": surname,
"email": email,
"image": imageUrl,
"lastSeen": DateTime.now().toUtc(),
"role": role,
"tokens": [token],
"quizes": []
});
} catch (e) {
print(e);
}
}