UpdateNotifier class

Drives background update checks and explicit compatibility updates.

Call checkForUpdate on each app resume. When state transitions to UpdateInstallStatus.downloadComplete, show the user a prompt and call completeUpdate on confirmation.

Annotations
  • @Riverpod.new(keepAlive: true)

Constructors

UpdateNotifier()

Properties

hashCode → int
The hash code for this object.
no setterinherited
ref → Ref
The Ref associated with this notifier.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state ↔ UpdateInstallStatus
The value currently exposed by this notifier.
getter/setter pairinherited
stateOrNull → UpdateInstallStatus?
The value currently exposed by this Notifier.
no setterinherited

Methods

build() → UpdateInstallStatus
checkForUpdate() → Future<void>
Checks for an available Android update without interrupting active play.
completeUpdate() → Future<void>
Installs a downloaded flexible update, restarting the app.
listenSelf(void listener(UpdateInstallStatus? previous, UpdateInstallStatus next), {void onError(Object error, StackTrace stackTrace)?}) → RemoveListener
Listens to changes on the value exposed by this provider.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestRequiredUpdate() → Future<RequiredUpdateResult>
Starts the strongest available update flow from update-required UI.
runBuild() → WhenComplete?
Executes Notifier.build.
inherited
toString() → String
A string representation of this object.
inherited
updateShouldNotify(UpdateInstallStatus previous, UpdateInstallStatus next) → bool
A method invoked when the state exposed by this Notifier changes. It compares the previous and new value, and return whether listeners should be notified.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited