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
Apparently all that was needed was parentheses on the maps
import 'package:cloud_firestore/cloud_firestore.dart';
class Record {
final String name;
final int votes;
final DocumentReference reference;
Record.fromMap(Map map(), {this.reference})
: assert(map()['name'] != null),
assert(map()['votes'] != null),
name = map()['name'],
votes = map()['votes'];
Record.fromSnapshot(DocumentSnapshot snapshot)
: this.fromMap(snapshot.data, reference: snapshot.reference);
@override
String toString() => "Record<$name:$votes>";
}