DebugFeatureFlags class

Feature flags manager for debugging.

Usage:

// Define feature flags
DebugFeatureFlags.register('new_checkout', 'New Checkout Flow');
DebugFeatureFlags.register('dark_mode', 'Dark Mode', category: 'UI');

// Check if enabled
if (DebugFeatureFlags.isEnabled('new_checkout')) {
  // Show new checkout
}

// Toggle
DebugFeatureFlags.enable('new_checkout');
DebugFeatureFlags.disable('new_checkout');

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

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

Static Properties

allFlags List<FeatureFlag>
Get all registered feature flags.
no setter
categories List<String>
Get all categories.
no setter
flagsByCategory Map<String?, List<FeatureFlag>>
Get flags grouped by category.
no setter

Static Methods

addListener(void listener(String key, bool value)) → void
Add a listener for flag changes.
clear() → void
Clear all feature flags.
disable(String key) → void
Disable a feature flag.
disableAll() → void
Disable all flags.
enable(String key) → void
Enable a feature flag.
enableAll() → void
Enable all flags.
exists(String key) bool
Check if a feature flag exists.
export() Map<String, bool>
Export flags as a map.
getFlag(String key) FeatureFlag?
Get a specific feature flag.
import(Map<String, bool> values) → void
Import flags from a map.
isEnabled(String key) bool
Check if a feature flag is enabled.
register(String key, String name, {String? description, String? category, bool defaultValue = false}) → void
Register a new feature flag.
registerAll(List<FeatureFlag> flags) → void
Register multiple feature flags at once.
removeListener(void listener(String key, bool value)) → void
Remove a listener.
resetAll() → void
Reset all flags to their default states.
set(String key, bool value) → void
Set a feature flag to a specific value.
toggle(String key) → void
Toggle a feature flag.
unregister(String key) → void
Remove a feature flag.