OpenFeatureAPI class

Constructors

OpenFeatureAPI()
factory

Properties

domainUpdates → Stream<Map<String, String>>
no setter
evaluationContext → EvaluationContext?
no setter
events → Stream<OpenFeatureEvent>
no setter
globalContext → OpenFeatureEvaluationContext?
no setter
hashCode → int
The hash code for this object.
no setterinherited
hooks → List<OpenFeatureHook>
no setter
provider → FeatureProvider
no setter
providerStatus → ProviderState
no setter
providerUpdates → Stream<FeatureProvider>
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transactionContextManager → TransactionContextManager
The transaction manager associated with this API. The ordinary singleton retains the legacy singleton manager.
no setter

Methods

addEvaluationHooks(Iterable<Hook> hooks) → void
Adds typed hooks at API scope, including for already-created clients.
addEventHandler(OpenFeatureEventType type, EventHandler handler) → void
Registers a typed handler, immediately replaying an applicable state.
addHandler(void handler(OpenFeatureEvent event)) → StreamSubscription<OpenFeatureEvent>
addHooks(List<OpenFeatureHook> hooks) → void
bindClientToProvider(String clientId, String providerId) → void
bindClientToProviderAndWait(String clientId, String providerId) → Future<void>
createClient({String? domain}) → FeatureClient
Creates a client with an optional domain (1.1.6).
dispose() → Future<void>
Permanent cleanup. Use shutdown when the same API and clients must be reused.
evaluateBooleanFlag(String flagKey, String clientId, {Map<String, dynamic>? context}) → Future<bool>
@deprecated Use getClient().getBooleanFlag() instead This method exists for backwards compatibility only
getClient(String name, {String? domain}) → FeatureClient
Get or create a client using the legacy positional name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerProvider(Provider definition, {String? providerId}) → String
Register a provider under an SDK identifier.
registerProviderAndWait(Provider definition, {String? providerId}) → Future<String>
removeEventHandler(OpenFeatureEventType type, EventHandler handler) → void
removeHandler(StreamSubscription<OpenFeatureEvent> handler) → Future<void>
setEvaluationContext(EvaluationContext context) → void
Set global evaluation fields using the canonical context representation. Existing clients resolve the latest snapshot on their next evaluation.
setGlobalContext(OpenFeatureEvaluationContext context) → void
setProvider(Provider definition) → Future<void>
setProviderAndWait(Provider definition) → Future<void>
Set provider and wait for it to be ready
setProviderForDomainAndWait(String domain, Provider definition, {String? providerId}) → Future<void>
setTransactionContext<T>(EvaluationContext context, FutureOr<T> operation()) → Future<T>
Experimental: run an operation in the registered carrier's request scope. Without a carrier the operation still runs, but this context is ignored.
setTransactionContextPropagator(TransactionContextPropagator? propagator) → void
Experimental: replace the request-context carrier, or remove it with null.
shutdown() → Future<void>
Shuts down every provider and resets this API for reuse (1.6). Concurrent calls share one operation; cleanup continues after failures.
shutdownProvider() → Future<void>
Shutdown the current provider after its final binding is removed.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

resetInstance() → Future<void>
Disposes the current singleton before allowing a replacement instance.