Upgrader class
A class to configure the upgrade dialog.
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, TargetPlatform? platform})
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
- 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
- platform → TargetPlatform
-
The TargetPlatform that identifies the platform on which the package is
currently executing. Defaults to defaultTargetPlatform. Note that
TargetPlatform does not include web, but includes mobile and desktop.
This parameter is normally used to change the target platform during testing.
final
- 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
- 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 -
checkVersion(
{required BuildContext context}) → void - Only called by UpgradeAlert.
-
currentAppStoreListingURL(
) → String? -
currentAppStoreVersion(
) → String? -
currentInstalledVersion(
) → String? -
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
. -
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 -
message(
) → String -
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>