FeatureFlagConfig class
Parsed + validated features:/flavors: configuration (spec 030
FR-001, FR-003). All validation failures throw FeatureConfigException
with a message naming the offending item.
Constructors
-
FeatureFlagConfig({required Map<
String, FeatureFlag> flags, Map<String, Map< flavors = const {}})String, bool> > -
const
-
FeatureFlagConfig.fromJson(Map<
String, dynamic> json) -
Parse from the raw
.zfa.jsonmap. Accepts twofeatures:shapes: a list of{ name, enabled, gates? }objects (canonical) or a map{ name: { enabled, gates? } }(name implied by key).factory
Properties
-
featureNames
→ List<
String> -
no setter
-
flags
→ Map<
String, FeatureFlag> -
final
-
flavorNames
→ List<
String> -
no setter
-
flavors
→ Map<
String, Map< String, bool> > -
Flavor name -> { featureName: enabled } overrides.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
flag(
String name) → FeatureFlag? -
flavorOverrides(
String flavor) → Map< String, bool> ? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
{String? flavor}) → ResolvedFeatureSet -
Resolve the effective feature-set for
flavor(null = base states). Unknown flavors throw naming the flavor. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
load(
{String? projectRoot}) → FeatureFlagConfig -
Load from
.zfa.jsonatprojectRoot(defaults to cwd). Returns an empty config when no file or no features section exists. -
loadRawJson(
{String? projectRoot}) → Map< String, dynamic> ? -
Raw
.zfa.jsonmap, or null when the file is absent. Throws FeatureConfigException on malformed JSON.