Upgrader class
An upgrade controller that maintains a state that is used to trigger an alert or other UI to evaluate upgrading criteria.
Instantiate an Upgrader object and pass it to UpgradeAlert or UpgradeCard to enable upgrade prompting. A shared instance is available via Upgrader.sharedInstance.
See also:
- UpgraderMessages, the default localized messages used for display.
- UpgraderState, the Upgrader state.
- Mixed-in types
- Available extensions
Constructors
-
Upgrader({Client? client, Map<
String, String> ? clientHeaders, String? countryCode, bool debugDisplayAlways = false, bool debugDisplayOnce = false, bool debugLogging = false, Duration durationUntilAlertAgain = const Duration(days: 3), String? languageCode, UpgraderMessages? messages, String? minAppVersion, bool showOnlyMandatoryUpdates = false, UpgraderStoreController? storeController, UpgraderOS? upgraderOS, WillDisplayUpgradeCallback? willDisplayUpgrade}) - Creates an upgrade controller that maintains a state that is used to trigger an alert or other UI to evaluate upgrading criteria.
Properties
- currentAppStoreListingURL → String?
-
Available on Upgrader, provided by the UpgraderExt extension
no setter - currentAppStoreVersion → String?
-
Available on Upgrader, provided by the UpgraderExt extension
no setter - currentInstalledVersion → String?
-
Available on Upgrader, provided by the UpgraderExt extension
no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- minAppVersion ↔ String?
-
Available on Upgrader, provided by the UpgraderExt extension
The minAppVersion in the Upgrader state.getter/setter pair - releaseNotes → String?
-
Available on Upgrader, provided by the UpgraderExt extension
no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → UpgraderState
-
no setter
-
stateStream
→ Stream<
UpgraderState> -
A stream that provides a new state each time an evaluation should be performed.
The values will always be the state.
no setter
- storeController ↔ UpgraderStoreController
-
The controller that provides the store details for each platform.
getter/setter pair
- versionInfo → UpgraderVersionInfo?
-
Available on Upgrader, provided by the UpgraderExt extension
The latest version info for this app.no setter - willDisplayUpgrade ↔ WillDisplayUpgradeCallback?
-
Called when Upgrader determines that an upgrade may or may not be
displayed. The callback receives three named parameters:
getter/setter pair
Methods
-
alreadyIgnoredThisVersion(
) → bool -
appName(
) → String -
belowMinAppVersion(
) → bool - Is installed version below minimum app version?
-
blocked(
) → bool -
body(
UpgraderMessages messages) → String -
determineMessages(
BuildContext context) → UpgraderMessages - Determine which UpgraderMessages object to use. It will be either the one passed to Upgrader, or one based on the app locale.
-
didChangeAccessibilityFeatures(
) → void -
Called when the system changes the set of currently active accessibility
features.
inherited
-
didChangeAppLifecycleState(
AppLifecycleState lifecycleState) → Future< void> -
Handle application events.
override
-
didChangeLocales(
List< Locale> ? locales) → void -
Called when the system tells the app that the user's locale has
changed. For example, if the user changes the system language
settings.
inherited
-
didChangeMetrics(
) → void -
Called when the application's dimensions change. For example,
when a phone is rotated.
inherited
-
didChangePlatformBrightness(
) → void -
Called when the platform brightness changes.
inherited
-
didChangeTextScaleFactor(
) → void -
Called when the platform's text scale factor changes.
inherited
-
didChangeViewFocus(
ViewFocusEvent event) → void -
Called whenever the PlatformDispatcher receives a notification that the
focus state on a view has changed.
inherited
-
didHaveMemoryPressure(
) → void -
Called when the system is running low on memory.
inherited
-
didPopRoute(
) → Future< bool> -
Called when the system tells the app to pop the current route, such as
after a system back button press or back gesture.
inherited
-
didPushRoute(
String route) → Future< bool> -
Called when the host tells the application to push a new route onto the
navigator.
inherited
-
didPushRouteInformation(
RouteInformation routeInformation) → Future< bool> -
Called when the host tells the application to push a new
RouteInformation and a restoration state onto the router.
inherited
-
didRequestAppExit(
) → Future< AppExitResponse> -
Called when a request is received from the system to exit the application.
inherited
-
dispose(
) → void - Remove any resources allocated.
-
findCountryCode(
{required Locale locale}) → String? -
Determine the current country code, either from the context, or
from the system-reported default locale of the device. The default
is
US. -
findLanguageCode(
{required Locale locale}) → String? -
Determine the current language code, either from the context, or
from the system-reported default locale of the device. The default
is
en. -
findLocale(
{BuildContext? context}) → Locale -
getSavedPrefs(
) → Future< bool> -
handleCancelBackGesture(
) → void -
Called when a predictive back gesture is canceled, indicating that no
navigation should occur.
inherited
-
handleCommitBackGesture(
) → void -
Called when a predictive back gesture is finished successfully, indicating
that the current route should be popped.
inherited
-
handleStartBackGesture(
PredictiveBackEvent backEvent) → bool -
Called at the start of a predictive back gesture.
inherited
-
handleStatusBarTap(
) → void -
Called when the user taps the status bar on iOS, to scroll a scroll
view to the top.
inherited
-
handleUpdateBackGestureProgress(
PredictiveBackEvent backEvent) → void -
Called when a predictive back gesture moves.
inherited
-
initialize(
) → Future< bool> - Initialize Upgrader by getting saved preferences, getting platform package info, and getting released version info.
-
installPackageInfo(
{PackageInfo? packageInfo}) → void -
Available on Upgrader, provided by the UpgraderExt extension
-
isTooSoon(
) → bool -
isUpdateAvailable(
) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
saveIgnored(
) → Future< bool> -
saveLastAlerted(
) → Future< bool> -
sendUserToAppStore(
) → Future< void> - Launch the app store from the app store listing URL.
-
shouldDisplayUpgrade(
) → bool -
toString(
) → String -
A string representation of this object.
inherited
-
updateState(
UpgraderState newState, {bool updateTheVersionInfo = false}) → void - Updates the Upgrader state, which updates the stream, which triggers a call to shouldDisplayUpgrade.
-
updateStream(
) → void - Updates the stream with the current state, which triggers the stream to indicate an evaluation should be performed.
-
updateVersionInfo(
) → Future< UpgraderVersionInfo?> - Update the version info for this app by using an UpgraderStore to get the UpgraderVersionInfo.
-
verifyInit(
) → bool
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
A shared instance of Upgrader.
no setter
Static Methods
-
clearSavedSettings(
) → Future< void> -
parseVersion(
String? version, String name, bool debugLogging) → Version?
Constants
- notInitializedExceptionMessage → const String