writeString static method
Writes the entire contents of a file as a string.
Implementation
static FutureResult<(), IoError> writeString(
Path path, String contents) async {
return await Fs.ioGuard(() async {
final file = File(path.asString());
await file.writeAsString(contents);
}).map((_) => ());
}