getVersionStatus method

Future<VersionStatus?> getVersionStatus()

This checks the version status and returns the information. This is useful if you want to display a custom alert, or use the information in a different way.

Implementation

Future<VersionStatus?> getVersionStatus() async {
  PackageInfo packageInfo = await PackageInfo.fromPlatform();
  if (Platform.isIOS) {
    return _getiOSStoreVersion(packageInfo);
  } else if (Platform.isAndroid) {
    return _getAndroidStoreVersion(packageInfo);
  } else {
    debugPrint('The target platform "${Platform.operatingSystem}" is not yet supported by this package.');
  }
  return null;
}