HeadlessFeatureKey<T> class final

Type-safe key for accessing typed features in feature bags.

Used with both HeadlessItemFeatures (item-level) and HeadlessRequestFeatures (request-level).

Example:

const myFeatureKey = HeadlessFeatureKey<String>(#myFeature);
final features = HeadlessItemFeatures.build((b) {
  b.set(myFeatureKey, 'value');
});
final value = features.get(myFeatureKey); // 'value'
Annotations

Constructors

HeadlessFeatureKey(Symbol id, {String? debugName})
const

Properties

debugName String?
Optional human-readable name for debugging.
final
hashCode int
The hash code for this object.
no setteroverride
id Symbol
Unique identifier for this feature key.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override