write method
Implementation
Future<void> write(
String path,
String content, {
FileMode mode = FileMode.write,
}) async {
final file = File(path);
final isExists = await file.exists();
if (!isExists) {
throw IOFailure(
cause: "can't write in '$path' because this path is not exists",
);
}
try {
await file.writeAsString(content, mode: mode);
} catch (e) {
throw IOFailure(cause: e.toString());
}
}