BloomFeatureFlags class
Dynamic, reactive feature flags management engine for Bloom applications.
Supports runtime flag registration, default values, dynamic overrides, and reactive observation via ReadonlySignal.
Example:
final features = BloomFeatureFlags();
features.register('new_checkout', defaultValue: false);
if (features.isEnabled('new_checkout')) {
// Show new checkout flow
}
Constructors
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
-
clearOverrides(
) → void - Restores all feature flags to their default registered state.
-
getAll(
) → Map< String, bool> - Returns a snapshot map of all registered feature flag names and their current values.
-
isEnabled(
String flagName, {bool defaultValue = false}) → bool - Checks if a feature flag is currently enabled.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
String flagName, {bool defaultValue = false}) → void -
Registers a feature flag with an initial
defaultValue. -
registerAll(
Map< String, dynamic> flags) → void - Registers multiple feature flags simultaneously from a map.
-
reset(
) → void - Clears all registered flags and state (useful during testing).
-
setOverride(
String flagName, bool value) → void - Sets or overrides the runtime state of a feature flag.
-
toString(
) → String -
A string representation of this object.
inherited
-
watch(
String flagName, {bool defaultValue = false}) → ReadonlySignal< bool> - Returns a reactive ReadonlySignal for a feature flag.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited