updateFlag method
- T feat,
- bool active
Implementation
Features<T> updateFlag(T feat, bool active) {
final List<FeatureFlag<T>> newFlags = List.from(flags);
newFlags.removeWhere((flag) => flag.feature == feat);
if (active || (defaultOn.contains(feat) && !active)) {
newFlags.add(FeatureFlag(feature: feat, active: active));
}
_log.info('new active $newFlags, $defaultOn');
return Features(flags: newFlags, defaultOn: defaultOn);
}