getApkFile static method

Future<File?> getApkFile({
  1. String fileName = '',
})

/data/user/0/XXX.XXX.XXX/files/z_update/XXX.apk

Implementation

static Future<File?> getApkFile(
    {String fileName = ''}) async {
  try {
    if(fileName.isEmpty){
      fileName = apkName;
    }
    var path = await InstallPlugin.getApkDirectory();
    String dataDir = "$path";
    //File full path
    final String destination = "$dataDir/$fileName";
    zeroLog('apk file path = $destination');
    return File(destination);
  } catch (e) {
    zeroLog(e);
    return null;
  }
}