showAlertIfNecessary method

dynamic showAlertIfNecessary({
  1. required BuildContext context,
})

This checks the version status, then displays a platform-specific alert with buttons to dismiss the update alert, or go to the app store.

Implementation

showAlertIfNecessary({required BuildContext context}) async {
  final VersionStatus? versionStatus = await getVersionStatus();
  if (versionStatus != null && versionStatus.canUpdate) {
    showUpdateDialog(context: context, versionStatus: versionStatus);
  }
}