AppVersionCheckTask class
Startup task — checks the installed app version against the minimum required version stored in Firebase Remote Config.
Runs in the StartupPhase.environmentAndConnectivity phase, after
RemoteConfigSyncTask so the min_version key is guaranteed to reflect the
latest console value before the comparison runs.
Reads the min_version string key from Remote Config (for example "2.1.0").
An empty or absent key means no minimum is enforced — the task always passes.
Version comparison is semver-aware: major, minor, and patch components are
compared numerically in order so "2.10.0" is correctly greater than "2.9.0".
If the installed version is below the minimum, ForceUpdateException is thrown. StartupCubit catches it and emits StartupStatus.forceUpdateRequired, which causes SplashView to show a non-dismissible ForceUpdateDialog.
- Inheritance
-
- Object
- StartupTask
- AppVersionCheckTask
Constructors
- AppVersionCheckTask({required FirebaseRemoteConfigService remoteConfigService, required AppLogger logger})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → StartupTaskId
-
A unique identifier for this task, used for logging and ordering.
no setteroverride
- label → String
-
A short human-readable description shown on the splash screen while this task runs.
no setteroverride
- phase → StartupPhase
-
The startup phase this task belongs to.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
execute(
{void onSubProgress(double subFraction)?}) → Future< void> -
Performs the startup work for this task.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
isVersionBelow(
String installed, String minimum) → bool -
Returns
truewheninstalledis strictly less thanminimum. -
resolveForceUpdate(
FirebaseRemoteConfigService remoteConfig) → Future< ForceUpdateException?> -
Checks the installed app version against the minimum required version in
remoteConfigand returns a ForceUpdateException if an update is required, ornullif the app is up-to-date or no minimum is configured.