rm method

  1. @override
Future<void> rm(
  1. String fsPath, {
  2. bool recursive = false,
  3. bool force = false,
})
override

Removes files and directories asynchronously (with recursive option).

Implementation

@override
Future<void> rm(
  String fsPath, {
  bool recursive = false,
  bool force = false,
}) async {
  try {
    if (FileSystemEntity.isDirectorySync(fsPath)) {
      await Directory(fsPath).delete(recursive: recursive);
    } else {
      await File(fsPath).delete();
    }
  } catch (e) {
    if (!force) rethrow;
  }
}