UpdatePolicy class
Decides whether the running app should update.
Extend or compose this to plug in custom rules (staged rollouts, kill switches, per-country gating, etc.).
Constructors
-
UpdatePolicy({PrismVersion? minimumVersion, Set<
UpdateChannel> channels = const {UpdateChannel.stable}, int rolloutPercent = 100, String? rolloutDeviceId}) -
Creates a policy.
const
-
UpdatePolicy.fromJson(Map<
String, dynamic> json) -
Builds a policy from a remote configuration map, e.g.:
factory
Properties
-
channels
→ Set<
UpdateChannel> -
Channels considered when resolving the latest version.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- minimumVersion → PrismVersion?
-
Below this version an update is forced.
nulldisables forced updates.final - rolloutDeviceId → String?
-
Device/installation identifier used for rollout bucketing. When null,
rollout gating treats the device as included (useful for tests).
final
- rolloutPercent → int
-
Percentage of devices (0–100) that see a soft update during a staged
rollout. Forced updates ignore the rollout and always apply.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
evaluate(
PrismVersion current, Map< UpdateChannel, PrismVersion> latestByChannel) → UpdatePolicyResult -
Evaluates
currentagainst the policy using the latest known version per channel inlatestByChannel. -
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