This could initially was working but after firebase update, it is now giving me this error. I have added asterisks to the part giving the error. The error message has been added beneath the code.
import 'package:cloud_firestore/cloud_firestore.dart';
class Record {
final String name;
final int totalVotes;
final DocumentReference reference;
Record.fromMap(Map<String, dynamic> map, {this.reference})
: assert(map['name'] != null),
assert(map['totalVotes'] != null),
name = map['name'],
totalVotes = map['totalVotes'];
Record.fromSnapshot(DocumentSnapshot snapshot)
: this.fromMap(**snapshot.data**, reference: snapshot.reference);
@override
String toString() => "Record<$name:$totalVotes>";
}
class Voters {
String uid;
String voteId;
String markedVoteOption;
}
The argument type 'Map<String, dynamic> Function()' can't be assigned to the parameter type 'Map<String, dynamic>'.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…