set method
Writes a byte array data to a specific path.
If the path or its parent directories do not exist, they should be created.
Implementation
@override
Future<void> set(String path, Uint8List buffer) async {
path = path.replaceFirst(
'{document}',
await getApplicationDocumentsDirectory().then((value) => value.path),
);
final dir = dirname(path);
final directory = Directory(dir);
// Ensure the directory exists before writing the file.
await directory.create(recursive: true);
await File(path).writeAsBytes(buffer);
}