write static method

FutureResult<(), IoError> write(
  1. Path path,
  2. Uint8List bytes
)

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((_) => ());
}