HcUpgradeNewVersion class
A class to configure the upgrade dialog.
- Mixed-in types
Constructors
- HcUpgradeNewVersion({HcAppCastConfiguration? appCastConfig, HcAppCast? appcast, HcUpgradeMessages? messages, bool debugDisplayAlways = false, bool debugDisplayOnce = false, bool debugLogging = false, Duration durationUntilAlertAgain = const Duration(days: 3), WillDisplayUpgradeCallback? willDisplayUpgrade, Client? client, String? countryCode, String? languageCode, String? minAppVersion, HcUpgradeOS? upgradeOS})
Properties
- appcast → HcAppCast?
-
Provide an Appcast that can be replaced for mock testing.
final
- appCastConfig → HcAppCastConfiguration?
-
The appcast configuration (HcAppCastConfiguration) used by HcAppCast.
When an appcast is configured for iOS, the iTunes lookup is not used.
final
- 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
- currentAppStoreListingURL → String?
-
no setter
- currentAppStoreVersion → String?
-
no setter
- currentInstalledVersion → String?
-
no setter
- 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
- durationUntilAlertAgain → Duration
-
Duration until alerting user again
final
- evaluationReady → bool
-
An evaluation should be performed.
no setter
-
evaluationStream
→ Stream<
HcUpgradeEvaluateNeed> -
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 ↔ HcUpgradeMessages?
-
The localized messages used for display in upgrade.
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
- releaseNotes → String?
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- upgradeOS → HcUpgradeOS
-
Provides information on which OS this code is running on.
final
- willDisplayUpgrade ↔ WillDisplayUpgradeCallback?
-
Called when HcUpgradeNewVersion 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(
HcUpgradeMessages messages) → String -
determineMessages(
BuildContext context) → HcUpgradeMessages - Determine which HcUpgradeMessages object to use. It will be either the one passed to HcUpgradeNewVersion, 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
-
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(
{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
. -
getAndroidStoreVersion(
{String? country, String? language}) → Future< bool?> - Android info is fetched by parsing the html of the app store page.
-
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 HcUpgradeNewVersion 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 -
isAppcastThisPlatform(
) → bool -
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 -
shouldDisplayUpgrade(
) → bool -
toString(
) → String -
A string representation of this object.
inherited
-
updateVersionInfo(
) → Future< bool> -
verifyInit(
) → bool
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
A shared instance of HcUpgradeNewVersion.
no setter
Static Methods
-
clearSavedSettings(
) → Future< void>
Constants
- notInitializedExceptionMessage → const String