displayUpdateAlert static method
dynamic
displayUpdateAlert(
- BuildContext context, {
- required bool forceUpdate,
- String? appStoreUrl,
- String? iOSDescription,
- String? iOSUpdateButtonLabel,
- String? iOSCloseButtonLabel,
- String? iOSIgnoreButtonLabel,
- String? iOSAlertTitle,
- String? requireUpdateText,
- String? recommendUpdateText,
- String? errorText,
- String? errorCloseButtonLabel,
- String? errorSubtitle,
Displaying update alert
Implementation
static displayUpdateAlert(
BuildContext context, {
required bool forceUpdate,
String? appStoreUrl,
String? iOSDescription,
String? iOSUpdateButtonLabel,
String? iOSCloseButtonLabel,
String? iOSIgnoreButtonLabel,
String? iOSAlertTitle,
String? requireUpdateText,
String? recommendUpdateText,
String? errorText,
String? errorCloseButtonLabel,
String? errorSubtitle,
}) async {
/// Get current installed version of app
final PackageInfo info = await PackageInfo.fromPlatform();
/// Set singleton properties
_nativeUpdaterInstance._context = context;
_nativeUpdaterInstance._forceUpdate = forceUpdate;
_nativeUpdaterInstance._appName = info.appName;
_nativeUpdaterInstance._appStoreUrl = appStoreUrl;
_nativeUpdaterInstance._iOSDescription = iOSDescription;
_nativeUpdaterInstance._iOSUpdateButtonLabel = iOSUpdateButtonLabel;
_nativeUpdaterInstance._iOSCloseButtonLabel = iOSCloseButtonLabel;
_nativeUpdaterInstance._iOSIgnoreButtonLabel = iOSIgnoreButtonLabel;
_nativeUpdaterInstance._iOSAlertTitle = iOSAlertTitle;
_nativeUpdaterInstance._requireUpdateText = requireUpdateText ?? 'requires that you update to the latest version. You cannot use this app until it is updated.';
_nativeUpdaterInstance._recommendUpdateText = recommendUpdateText ?? 'recommends that you update to the latest version. You can keep using this app while downloading the update.';
_nativeUpdaterInstance._errorText = errorText;
_nativeUpdaterInstance._errorCloseButtonLabel = errorCloseButtonLabel;
_nativeUpdaterInstance._errorSubtitle = errorSubtitle;
/// Show the alert based on current platform
if (Platform.isIOS) {
_nativeUpdaterInstance._showCupertinoAlertDialog();
} else {
_nativeUpdaterInstance._showMaterialAlertDialog();
}
}