Setup
Release control is on by default onceLerix.init runs, with the built-in
screens. There is nothing to add for the default behaviour. To change it, pass
LerixAppControlOptions:
main.dart
Version
The SDK sends the version and build number from yourpubspec.yaml
(version: 3.4.0+412 sends 3.4.0 and build 412). On the web it sends the
platform web, and the version only when the build has a version.json
(flutter build web writes one). Rules compare build numbers when both sides
have one.
Instant changes with silent push
When you start or end a maintenance window or force an update, Lerix sends a silent push so apps in the background refresh too. It reaches apps that callLerix.notifications.init(), as in
Push Notifications, and the SDK
handles it for you: it is never shown, and never passed to
setOnNotificationReceived. On iOS and macOS it needs the
lerix_didReceiveRemoteNotification hook in your AppDelegate from that
guide, and the Remote notifications background mode. Without push, and on
the web, apps pick up the change at their next check.
Built-in screens
There is no widget to add. The SDK inserts its screens into your app’s top-levelOverlay, above every route your navigator pushes.
- Maintenance: covers the whole app, with a Try again button. Back on Android sends the app to the background.
- Required update: the same full-screen host, with release notes under “What’s new” and an Update button that opens the store (web: Reload).
- Update prompt: a dialog (web: a bar at the bottom) with Update, Later and, when allowed, Skip this version. It appears at most once per app run. Back closes it without saving Later.
LerixFeedback, its theme and locale
apply here too. Widgets that you place above the navigator in
MaterialApp.builder are not covered. See
Custom UI for when
each screen appears.
Your own screens
Setui: false, then listen to Lerix.appControl, a
ValueListenable<LerixAppControlState>. The state has update
(LerixUpdateInfo), maintenance (LerixMaintenanceInfo) and sdk
(LerixSdkControl), each null when nothing applies (fields in
The state).
release_gate.dart
update.isRequired is a shortcut for the same check. For a soft prompt,
call the helpers from your own dialog:
Lerix.appControl.stream emits every new state, if you prefer a stream.
Check now
refresh() (or its alias checkNow()) ignores the saved answer’s lifetime,
fetches, and returns the new state. It never throws: offline, it returns the
saved state. The SDK already checks on launch, when the app returns to the
foreground, and every minute during an emergency (see
Delivery and offline behaviour).