CapabilityModule class

Capabilities Module

Manages SDK capabilities based on authentication tokens. Determines which features each module can use based on capability tiers.

Inheritance
Implemented types

Constructors

CapabilityModule()

Properties

capabilitiesStream → Stream<SDKCapabilities?>
Stream of capability updates
no setter
hashCode → int
The hash code for this object.
no setterinherited
isEnabled → bool
Whether this module is currently enabled
no setterinherited
moduleId → String
Module identifier
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → ModuleStatus
Current module status
no setterinherited
token → CapabilityToken?
The last successfully verified token (if any)
no setter

Methods

canAccessFeature(String moduleId, String featureId) → bool
Check if a module can access a specific feature
override
capability(Module module) → CapabilityLevel
Get the capability level for a specific module
override
dispose() → Future<void>
Dispose of all resources (final cleanup)
inherited
getAllCapabilities() → Map<Module, CapabilityLevel>
Get all capabilities as a map
override
initialize() → Future<void>
Initialize the module with required dependencies
inherited
isFeatureEnabled(FeatureFlag feature) → bool
Check if a specific feature is enabled
override
loadDefaults() → Future<void>
Load default capabilities (for development/testing)
loadFromToken(CapabilityToken token, String secret) → Future<void>
Load capabilities from token
loadFromTokenUnsigned(CapabilityToken token) → Future<void>
Load capabilities from a server-provided token without local HMAC verification. Use only when the token was fetched over an authenticated channel (e.g., device-signed request).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDispose() → Future<void>
Called during disposal
override
onInitialize() → Future<void>
Called during initialization
override
onStart() → Future<void>
Called when starting the module
override
onStop() → Future<void>
Called when stopping the module
override
setStatus(ModuleStatus newStatus) → void
Set the module status and notify listeners
inherited
start() → Future<void>
Start the module's operation
inherited
stop() → Future<void>
Stop the module's operation (can be restarted)
inherited
toString() → String
A string representation of this object.
inherited

Operators

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