showUpdateAlert method
dynamic
showUpdateAlert({
- required BuildContext context,
- String? dialogTitle,
- String? dialogText,
- String? updateButtonText,
- bool? allowDismissal,
- String? dismissButtonText,
- VoidCallback? dismissAction,
Shows the user a platform-specific alert about the app update. The user can dismiss the alert or proceed to the app store.
To change the appearance and behavior of the update dialog, you can
optionally provide dialogTitle
, dialogText
, updateButtonText
, allowDismissal
,
dismissButtonText
, and dismissAction
parameters.
Implementation
showUpdateAlert({required BuildContext context,
String? dialogTitle,
String? dialogText,
String? updateButtonText,
bool? allowDismissal,
String? dismissButtonText,
VoidCallback? dismissAction}) async {
final AppVersionStatus? versionStatus = await _getVersionStatus();
if (versionStatus != null && versionStatus.isUpdateAvailable) {
_showUpdateDialog(
context: context,
versionStatus: versionStatus,
dialogTitle: dialogTitle,
dialogText: dialogText,
updateButtonText: updateButtonText,
allowDismissal: allowDismissal,
dismissButtonText: dismissButtonText,
dismissAction: dismissAction);
}
}