write static method
Writes the entire contents of a file.
Implementation
static FutureResult<(), IoError> write(Path path, Uint8List bytes) async {
return await Fs.ioGuard(() async {
final file = File(path.asString());
await file.writeAsBytes(bytes);
}).map((_) => ());
}