deleteFile static method

Future<bool> deleteFile(
  1. String? filePath
)

删除文件

Implementation

static Future<bool> deleteFile(String? filePath) async {
  if (filePath == null) {
    return false;
  }
  try {
    final file = File(filePath);
    if (file.existsSync()) {
      file.delete();
    }
    return true;
  } catch (err) {
    return false;
  }
}