DocumentReferenceFake.stateful constructor
DocumentReferenceFake.stateful()
Implementation
factory DocumentReferenceFake.stateful(
String id,
Map<String, dynamic> documentSnapshotData,
void Function() onChanged,
) =>
DocumentReferenceFake(
id,
get: () async => DocumentSnapshotFake(id, documentSnapshotData),
update: (data) async {
for (final entry in data.entries) {
documentSnapshotData[entry.key as String] = entry.value;
}
onChanged();
},
set: (data) async {
for (final entry in data.entries) {
documentSnapshotData[entry.key] = entry.value;
}
onChanged();
},
);