UWebUpdate class abstract

Web only: keeps every open tab on the latest deployed build (clears stale caches/service workers); initU() already starts it. Build with --dart-define=U_BUILD_ID=<version> for exact checks. UWebUpdate.checkAndRefresh()

Constructors

UWebUpdate()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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 Properties

timeout ↔ Duration
How long a build check may take.
getter/setter pair

Static Methods

cachedBuild() → Future<UWebBuild?>
The build this tab is running.
checkAndRefresh({bool silent = false, bool once = true, bool bustUrl = false, String? title, String? message, String? confirmText, String? cancelText}) → Future<bool>
Reloads into a newer build when there is one; asks first unless silent. await UWebUpdate.checkAndRefresh()
hasUpdate() → Future<bool>
True when a newer build is deployed. if (await UWebUpdate.hasUpdate()) …
refresh({List<String> assets = defaultAssets, bool bustUrl = false}) → Future<void>
Clears service workers and caches and reloads into the newest build; always works. UButton(title: "Update", onTap: UWebUpdate.refresh)
runningServiceWorkerVersion() → String?
Version of the service worker serving this page.
serverBuild() → Future<UWebBuild?>
The build the server serves now; null off the web or offline.
startWatching({Duration interval = const Duration(minutes: 15), bool silent = false, bool checkNow = true, bool silentOnStart = true, bool onVisible = true, bool bustUrl = false}) → void
Checks at startup, every interval and when the tab comes back (initU() calls it silently).
stopWatching() → void
Stops checking for new builds.

Constants

buildId → const String
Build id from --dart-define=U_BUILD_ID (empty when not given).
defaultAssets → const List<String>
Files re-downloaded by refresh().