我刚接触 Flutter,想测试一个 github 项目
List<Rasp> _raspListFromSnapshots(QuerySnapshot snapshot) {
return snapshot.docs.map((doc) {
return Rasp(
modelNumber: doc.data()['modelNumber'] ?? '',
address: doc.data()['address'] ?? '',
software: doc.data()['software'] ?? '',
finder: doc.data()['finder'] ?? null,
user: doc.data()['user'] ?? null,
owner: doc.data()['owner'] ?? null,
other: doc.data()['other'] ?? '',
geoPoint: doc.data()['geoPoint'] ?? null,
);
}).toList();
}
List<UserData> _userListFromSnapshots(QuerySnapshot snapshot) {
return snapshot.docs.map((doc) {
return UserData(
uid: doc.data()['uid'],
phoneNumber: doc.data()['phoneNumber'],
username: doc.data()['username'],
email: doc.data()['email'],
);
}).toList();
}
[' '] 中的所有内容都有一个错误,提示未为类型 'Object' 定义运算符 '[]'。尝试定义运算符“[]”。
我该怎么办?请帮忙