write method
Writes data to a Firestore document at the specified path.
This method performs a merge operation, preserving any existing fields in the document that aren't explicitly overwritten.
path
: The path to the document.data
: The data to write to the document.
Implementation
@override
Future<String?> write(String path, Map<String, dynamic> data) async {
try {
await datasource.doc(path).set(data, SetOptions(merge: true));
return null;
} catch (e) {
return e.toString();
}
}