remote_update_gate library
Reusable, API-driven force/optional update gate.
Classes
- DefaultUpdateCard
- A clean, theme-driven default card.
- UpdateCardData
- Everything a card needs to render one prompt.
- UpdateController
- Orchestrates the gate: owns the manifest + resolved status and the UI-facing actions.
- UpdateGate
-
Wrap your app with this — ideally in
MaterialApp.builder, above the Navigator. - UpdateGateStore
- Per-app persistence for the skipped version and the cached manifest (the offline latch).
- UpdateManifest
- The server-driven update descriptor the gate resolves against.
- UpdateSource
- Where the UpdateManifest comes from — implemented per app; null on failure/offline.
Enums
- UpdateStatus
- The three states the gate can be in.
Functions
-
isValidVersion(
String? raw) → bool -
Whether
rawis a well-formed dotted version. Empty/blank is false. -
parseVersion(
String? raw) → List< int> -
Parse a dotted version into a list of ints, or
[]when empty/invalid. Never throws. -
resolveUpdateStatus(
{required String currentVersion, required UpdateManifest manifest, String? skippedVersion}) → UpdateStatus - The pure heart of the gate — resolves the UpdateStatus (no I/O, fail-open).
-
versionGates(
String? raw) → bool -
True if
rawis a real, non-zero floor that would gate someone. -
versionLt(
String? a, String? b) → bool -
True if version
a< versionb, component-wise and zero-padded. -
versionMax(
String a, String b) → String - The higher of two versions (the one that is not less than the other).
Typedefs
- UpdateCardBuilder = Widget Function(BuildContext context, UpdateCardData data)
- Builds the card widget for a given UpdateCardData.