Upgrader class
An upgrade controllerthat maintains a state that is used to trigger an alert or other UI to evaluate upgrading criteria.
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, UpgraderStoreController? storeController, UpgraderDevice? upgraderDevice, UpgraderOS? upgraderOS, WillDisplayUpgradeCallback? willDisplayUpgrade}) - Creates an uprade controller that maintains a state that is used to trigger an alert or other UI to evaluate upgrading criteria.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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
- willDisplayUpgrade ↔ WillDisplayUpgradeCallback?
-
Called when Upgrader determines that an upgrade may or may not be
displayed. The
value
parameter will be true when it should be displayed, and false when it should not be displayed. One good use for this callback is logging metrics for your app.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
-
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
-
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.
-
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(
) → 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