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
Stream<QueryDocumentSnapshot<List>> get userData {
return userDataCollection.snapshots()
.map(_userDataListFromSnapshot);
}
}
lib/screens/home/home.dart:16:32: Error: The argument type 'Stream<QueryDocumentSnapshot<List>>' can't be assigned to the parameter type 'Stream<QuerySnapshot>'.
'Stream' is from 'dart:async'.
'QueryDocumentSnapshot' is from 'package:cloud_firestore/cloud_firestore.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-2.4.0/lib/cloud_firestore.dart').
'List' is from 'dart:core'.
'UserDataList' is from 'package:googletestconnection/models/userData.dart' ('lib/models/userData.dart').
'QuerySnapshot' is from 'package:cloud_firestore/cloud_firestore.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-2.4.0/lib/cloud_firestore.dart').
'Object' is from 'dart:core'.
value: DatabaseService().userData,
^
lib/services/database.dart:35:10: Error: The argument type 'List Function(QueryDocumentSnapshot)' can't be assigned to the parameter type 'QueryDocumentSnapshot<List> Function(QuerySnapshot)'.
'List' is from 'dart:core'.
'UserDataList' is from 'package:googletestconnection/models/userData.dart' ('lib/models/userData.dart').
'QueryDocumentSnapshot' is from 'package:cloud_firestore/cloud_firestore.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-2.4.0/lib/cloud_firestore.dart').
'Object' is from 'dart:core'.
'QuerySnapshot' is from 'package:cloud_firestore/cloud_firestore.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-2.4.0/lib/cloud_firestore.dart').
.map(_userDataListFromSnapshot);
^
The text was updated successfully, but these errors were encountered:
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:googletestconnection/models/userData.dart';
class DatabaseService{
final String uid;
DatabaseService ({this.uid});
//collection Refferences
final CollectionReference userDataCollection = FirebaseFirestore.instance.collection('userData');
Future updateUserData(String sugars, String name, int strength) async {
return await userDataCollection.doc(uid).set({
'sugars': sugars,
'name': name,
'strength': strength,
});
}
//User data collection
List _userDataListFromSnapshot(QueryDocumentSnapshot snapshot) {
return snapshot.get('doc').map((doc) {
return UserDataList(
name: doc.data['name'] ?? '',
strength: doc.data['strength'] ?? 0,
sugars: doc.data['sugars'] ?? '0'
);
}
//get user profile data
Stream<QueryDocumentSnapshot<List>> get userData {
return userDataCollection.snapshots()
.map(_userDataListFromSnapshot);
}
}
lib/screens/home/home.dart:16:32: Error: The argument type 'Stream<QueryDocumentSnapshot<List>>' can't be assigned to the parameter type 'Stream<QuerySnapshot>'.
value: DatabaseService().userData,
^
lib/services/database.dart:35:10: Error: The argument type 'List Function(QueryDocumentSnapshot)' can't be assigned to the parameter type 'QueryDocumentSnapshot<List> Function(QuerySnapshot)'.
.map(_userDataListFromSnapshot);
^
The text was updated successfully, but these errors were encountered: