overwrite method

  1. @override
Future<String?> overwrite(
  1. String path,
  2. Map<String, dynamic> data
)
override

Overwrites data at the specified path.

The path parameter identifies the location where data should be overwritten. The data parameter contains the new data that will replace any existing data.

Returns a Future that completes when the overwrite operation is finished. If the overwrite operation fails, the future will complete with an error.

Implementation

@override
Future<String?> overwrite(String path, Map<String, dynamic> data) async {
  try {
    await datasource.ref(path).set(data);
    return null;
  } catch (e) {
    return e.toString();
  }
}