FeatureFlag.fromMap constructor
FeatureFlag.fromMap(
- Map<String, dynamic> map
)
Implementation
factory FeatureFlag.fromMap(Map<String, dynamic> map) {
final flagOptions = Deserializer(map);
final returnType = map['returnType']?.toString();
return FeatureFlag(
state: FlagState.values.byName(map['state'].toString()),
name: map['name']?.toString(),
description: map['description']?.toString(),
returnType:
returnType == null ? null : FlagValueType.values.byName(returnType),
variants: flagOptions.getMap('variants'),
defaultVariant: map['defaultVariant']?.toString(),
rules: flagOptions.getList('rules', converter: FlagRule.fromMap),
);
}