isFeatureEnabled static method
Indicates whether the feature with the given id
is currently enabled.
The feature can be enabled :
- from the Features 's constructor by passing
id
as flags parameter. - by calling setFeature with
id
- by showing the debug view with showDebugView with a declared Feature.
Implementation
static bool isFeatureEnabled(BuildContext context, String id) {
final state = InheritedModel.inheritFrom<InheritedFeatures>(
context,
aspect: id,
);
return state!.flags.contains(id);
}