deleteFile static method

bool deleteFile(
  1. String path
)

Implementation

static bool deleteFile(String path) {
  try {
    final f = File(path);
    if (f.existsSync()) {
      f.deleteSync();
      return true;
    }
    return false;
  } catch (e) {
    stderr.writeln('deleteFile error: $e');
    return false;
  }
}