native_updater
When a latest app version is available via user defined logic, a simple alert prompt widget is displayed. With today's modern app stores, there is little need to persuade users to update because most of them are already using the auto update feature. However, there may be times when an app needs to be updated more quickly than usual, and nagging a user to update will entice the update sooner.
The UI comes in two flavors: Material Design for Android and Cupertino for iOS. The UpdateMaterialAlert widget is used to display the native Android alert prompt, and the UpdateCupertinoAlert widget is used to display the native iOS alert prompt.
Installation via GitHub (for test only)
Setup
Android
Already good to go.
iOS
To be able to show your App Name in the Cupertino Alert Dialog, add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist
:
Usage
Just add this code whenever you want to display the update alert, and it will handle the rest.
Or with the optional parameters to customize the alert.
Parameters Explanation
Required Parameters
context is the location in the tree where this widget builds.
forceUpdate is to tell whether the alert is forcing an update or not. Set to true
if you are forcing an update. Set to false
if you are giving an option to update later.
Optional Parameters
appStoreUrl is to launch your App Store URL if you're developing for iOS. Follow this link on how to find your App Store URL.
playStoreUrl is to launch your Play Store URL if you're developing for Android. Follow this link on how to find your Play Store URL.
iOSDescription is to use your custom alert description on UpdateCupertinoAlert
. The default is <App Name> requires that you update to the latest version. You cannot use this app until it is updated.
or <App Name> recommends that you update to the latest version. You can keep using this app while downloading the update.
iOSUpdateButtonLabel is to use your custom Update Button Label on UpdateCupertinoAlert
. The default is Update
.
iOSCloseButtonLabel is to use your custom Close Button Label onUpdateCupertinoAlert
. The default is Close App
.
iOSIgnoreButtonLabel is to use your custom Ignore Button Label onUpdateCupertinoAlert
. The default is Later
.
Full Example
Screenshots of Material Alert
An example of a flexible update flow
An example of an immediate update flow
Screenshots of Cupertino Alert
Force Update | Can Update Later |
---|---|
![]() |
![]() |