isFeatureEnabled static method

bool isFeatureEnabled(
  1. BuildContext context,
  2. String id
)

Indicates whether the feature with the given id is currently enabled.

The feature can be enabled :

Implementation

static bool isFeatureEnabled(BuildContext context, String id) {
  final state = InheritedModel.inheritFrom<InheritedFeatures>(
    context,
    aspect: id,
  );
  return state!.flags.contains(id);
}