setFeature static method
Allows to enable or disable the feature with the given id
.
Its new isEnabled
status is saved into local preferences and so it
is persisted between app sessions.
Implementation
static void setFeature(
BuildContext context,
String id,
bool isEnabled,
) async {
final state = context.findAncestorStateOfType<_FeaturesState>();
await state!.setFeature(id, isEnabled);
}