deleteApkFile static method

Future<void> deleteApkFile({
  1. String fileName = '',
})

文件没有校验完整性 所以每次安装完或重启app需要手动删除下

Implementation

static Future<void> deleteApkFile(
    {String fileName = ''}) async {
  try {
    if(fileName.isEmpty){
      fileName = apkName;
    }
    File? file = await getApkFile(fileName: fileName);
    if (file == null) {
      return;
    }
    bool isExist = await file.exists();
    if (isExist) {
      await file.delete();
    }
  } catch (e) {
    zeroLog(e);
  }
}