Upgrader class
A class to configure the upgrade dialog.
- Mixed in types
Constructors
- Upgrader({AppcastConfiguration? appcastConfig, Appcast? appcast, UpgraderMessages? messages, bool debugDisplayAlways = false, bool debugDisplayOnce = false, bool debugLogging = false, Duration durationUntilAlertAgain = const Duration(days: 3), BoolCallback? onIgnore, BoolCallback? onLater, BoolCallback? onUpdate, BoolCallback? shouldPopScope, WillDisplayUpgradeCallback? willDisplayUpgrade, Client? client, bool showIgnore = true, bool showLater = true, bool showReleaseNotes = true, bool canDismissDialog = false, String? countryCode, String? languageCode, String? minAppVersion, UpgradeDialogStyle dialogStyle = UpgradeDialogStyle.material, TextStyle? cupertinoButtonTextStyle, UpgraderOS? upgraderOS})
Properties
- appcast → Appcast?
-
Provide an Appcast that can be replaced for mock testing.
final
- appcastConfig → AppcastConfiguration?
-
The appcast configuration (AppcastConfiguration) used by Appcast.
When an appcast is configured for iOS, the iTunes lookup is not used.
final
- canDismissDialog ↔ bool
-
Can alert dialog be dismissed on tap outside of the alert dialog. Not used by UpgradeCard. (default: false)
getter/setter pair
- client → Client
-
Provide an HTTP Client that can be replaced for mock testing.
final
- countryCode → String?
-
The country code that will override the system locale. Optional.
final
- cupertinoButtonTextStyle ↔ TextStyle?
-
The text style for the cupertino dialog buttons. Used only for
UpgradeDialogStyle.cupertino. Optional.
getter/setter pair
- debugDisplayAlways ↔ bool
-
For debugging, always force the upgrade to be available.
getter/setter pair
- debugDisplayOnce ↔ bool
-
For debugging, display the upgrade at least once once.
getter/setter pair
- debugLogging ↔ bool
-
Enable print statements for debugging.
getter/setter pair
- dialogStyle ↔ UpgradeDialogStyle
-
The upgrade dialog style. Used only on UpgradeAlert. (default: material)
getter/setter pair
- durationUntilAlertAgain → Duration
-
Duration until alerting user again
final
- evaluationReady → bool
-
An evaluation should be performed.
no setter
-
evaluationStream
→ Stream<
UpgraderEvaluateNeed> -
A stream that provides a new value each time an evaluation should be performed.
The values will always be null or true.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- languageCode → String?
-
The country code that will override the system locale. Optional. Used only for Android.
final
- messages ↔ UpgraderMessages?
-
The localized messages used for display in upgrader.
getter/setter pair
- minAppVersion ↔ String?
-
The minimum app version supported by this app. Earlier versions of this app
will be forced to update to the current version. Optional.
getter/setter pair
- notInitializedExceptionMessage → String
-
final
- onIgnore ↔ BoolCallback?
-
Called when the ignore button is tapped or otherwise activated.
Return false when the default behavior should not execute.
getter/setter pair
- onLater ↔ BoolCallback?
-
Called when the later button is tapped or otherwise activated.
Return false when the default behavior should not execute.
getter/setter pair
- onUpdate ↔ BoolCallback?
-
Called when the update button is tapped or otherwise activated.
Return false when the default behavior should not execute.
getter/setter pair
- releaseNotes → String?
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldPopScope ↔ BoolCallback?
-
Called when the user taps outside of the dialog and canDismissDialog
is false. Also called when the back button is pressed. Return true for
the screen to be popped. Not used by UpgradeCard.
getter/setter pair
- showIgnore ↔ bool
-
Hide or show Ignore button on dialog (default: true)
getter/setter pair
- showLater ↔ bool
-
Hide or show Later button on dialog (default: true)
getter/setter pair
- showReleaseNotes ↔ bool
-
Hide or show release notes (default: true)
getter/setter pair
- upgraderOS → UpgraderOS
-
Provides information on which OS this code is running on.
final
- 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 -
checkVersion(
{required BuildContext context}) → void - Will show the alert dialog when it should be dispalyed. Only called by UpgradeAlert and not used by UpgradeCard.
-
currentAppStoreListingURL(
) → String? -
currentAppStoreVersion(
) → String? -
currentInstalledVersion(
) → 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 state) → 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(
{BuildContext? context}) → 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(
{BuildContext? context}) → String? -
Determine the current language code, either from the context, or
from the system-reported default locale of the device. The default
is
en
. -
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.
-
installAppStoreListingURL(
String url) → void -
installAppStoreVersion(
String version) → void -
installPackageInfo(
{PackageInfo? packageInfo}) → void -
isTooSoon(
) → bool -
isUpdateAvailable(
) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onUserIgnored(
BuildContext context, bool shouldPop) → void -
onUserLater(
BuildContext context, bool shouldPop) → void -
onUserUpdated(
BuildContext context, bool shouldPop) → void -
saveLastAlerted(
) → Future< bool> -
shouldDisplayReleaseNotes(
) → bool -
shouldDisplayUpgrade(
) → bool -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
A shared instance of Upgrader.
no setter
Static Methods
-
clearSavedSettings(
) → Future< void>