FlagneticDevTools class final
The Dev Tools helper for local overrides: gates every mutation
behind the build mode — a no-op, override_refused, in a release build,
however FlagneticClient.overrides was constructed, because the pure
Dart client has no notion of a Flutter build mode — persists overrides in
FlagneticStore under their own key so QA's flips survive a restart, and
exposes hasOverrides for a badge.
final devTools = FlagneticDevTools(client: client, store: store);
// …
devTools.dispose();
Construct one alongside a client built with
ClientOptions(allowOverrides: true, …); without that option every
mutation is refused just the same, for the ordinary reason
(override_refused, cause not_allowed).
Constructors
- FlagneticDevTools({required FlagneticClient client, required FlagneticStore store, Logger? logger, @visibleForTesting bool releaseMode = kReleaseMode})
-
A Dev Tools helper for
client, persisting overrides instoreunder their own key and restoring them at once.
Properties
- client → FlagneticClient
-
The client this helper edits the overrides of.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hasOverrides
→ ValueListenable<
bool> -
Whether any local override is set, for a badge. Starts false until the
store has been read back.
no setter
- isReleaseBuild → bool
-
True in a release build: set, remove and clear are refused.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Drops every override. A no-op in a release build.
-
dispose(
) → void - Stops following client and releases hasOverrides.
-
list(
) → Map< String, Object?> - The local overrides by flag key.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String key) → void -
Drops the override of
key. A no-op in a release build. -
set(
String key, Object? value) → bool -
Substitutes
valuefor the flagkey. Refused in a release build, loggingoverride_refusedwith causerelease_build: see FlagneticClient.overrides for every other refusal. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited