FeatureFlag extension type

Well-known feature flags for plugins.

Plugins declare flags via Plugin.featureFlags. The runtime inspects them to set default enablement: experimental plugins are disabled by default and require opt-in; non-experimental plugins are enabled by default. Custom flags can be defined by wrapping any string, e.g. const FeatureFlag('requires_network').

This is a zero-cost extension type wrapping String, so flag values can be compared, serialized, and stored as strings while the static type still unlocks Dart's dot-shorthand syntax (.experimental, .locked).

class MyPlugin extends GlobalPlugin {
  @override
  List<FeatureFlag> get featureFlags => const [.experimental];
}
on

Constructors

FeatureFlag(String value)
const

Properties

value String
final

Constants

experimental → const FeatureFlag
Plugin is experimental and requires opt-in.
locked → const FeatureFlag
Plugin is locked and cannot be enabled or disabled by the user.