plugin_kit library

Classes

BoolConfigField
Single switch.
Capability
Base class for capability tags attached to service registrations.
ConfigField
Base schema for a configurable input rendered by the dialog.
ConfigFieldHandle
Opaque handle exposed to field renderers for reading and writing the current working value of a single field.
ConfigNode
Type-safe, read-only accessor for service configuration values.
Typed dropdown.
A single selectable option for DropdownConfigField.
EnablementResolver
Pure helpers for plugin enablement decisions: default-enabled detection, base enablement from RuntimeSettings, dependency cascading, and cycle detection. Owned by PluginRuntime; cleanly isolated so each helper is callable without runtime mutable state.
EventBinding
Portable descriptor of "subscribe to events of type E on a session."
EventBus
Typed, priority-ordered event bus for decoupled inter-plugin communication.
EventEnvelope<T>
Wrapper around an event payload passed to each handler during dispatch.
EventSubscription
Cancel-only handle returned by EventBus.on, EventBus.onSync, EventBus.onRequest, and EventBus.onRequestSync.
ExtensionConfigField
Field rendered by a dialog renderer selected via rendererKey.
FactoryWrapper<T extends Object>
Registration wrapper that creates a new instance on every provide call.
GlobalPlugin<G extends GlobalPluginContext>
A Plugin scoped to the global application lifetime.
GlobalPluginContext
A global-scoped context that additionally carries all active sessions.
GroupConfigField
Visually groups a sub-set of fields under a sub-heading.
LazySingletonWrapper<T extends Object>
Registration wrapper that creates the instance on first provide call and caches it for all subsequent calls.
LocalPluginOverride
Per-service override that modifies registration behavior.
MultilineConfigField
Multi-line text editor with optional moustache-tag chip hints.
NumberConfigField
Numeric input.
PasswordConfigField
Obscured input with a show/hide toggle.
Plugin
Abstract base class for all plugins in the plugin_kit system.
PluginConfig
Plugin-level configuration including enable/disable state.
PluginContext
Context object passed to plugin lifecycle hooks.
PluginNamespaced
Intermediate handle returned by PluginId.namespace: a plugin paired with a namespace, ready to produce a Pin for any leaf service id inside that namespace.
PluginRuntime<G extends GlobalPluginContext, S extends SessionPluginContext>
The central runtime that manages the full plugin lifecycle.
PluginService
Base class for plugin services that receive injected settings.
PluginSession<K extends SessionPluginContext>
A scoped session with its own registry, event bus, and plugin attachments.
Priority
Preset priority stops and relative helpers for plugin_kit's priority-based systems.
RegistrationWrapper<T extends Object>
Sealed base class for service registration wrappers.
RuntimeSettings
Top-level serializable configuration for the plugin system.
ScopedServiceRegistry
A plugin-scoped view over ServiceRegistry that fills in the owning plugin's pluginId on every registration call.
ServiceRegistry
Dependency injection container for plugin services.
ServiceSettings
Configuration for a single service slot within a plugin.
SessionPlugin<S extends SessionPluginContext>
A Plugin scoped to an individual session lifetime.
SessionPluginContext
A session-scoped context that also carries a reference to the global EventBus.
SingletonWrapper<T extends Object>
Registration wrapper that holds a pre-created instance.
StatefulPluginService<PKC extends PluginContext>
A PluginService with plugin lifecycle hooks and automatic subscription cleanup.
TextConfigField
Single-line text input.
UiConfigurableCapability
Capability advertising that a service can be edited in the dialog.

Enums

NumberFieldStyle
Visual style for NumberConfigField.
UnknownReferencePolicy
Policy for handling RuntimeSettings entries that reference an id the runtime does not know about. Covers every reference shape that can drift across app versions:

Mixins

PluginSessionListener
Declarative session-event listener mixin for pure-Dart hosts (cubits, controllers, services). The host supplies the session it listens to and the list of subscriptions (a List<EventBinding>) it wants attached. The mixin materializes them through attachSubscriptions and cancels them through detachSubscriptions, both idempotent.

Extension Types

FeatureFlag
Well-known feature flags for plugins.
Namespace
Typed namespace identifier. Wraps the namespace name as a String. Like PluginId and ServiceId, a zero-cost extension type -- at runtime, it IS the underlying String, so == against a String literal works and Map<Namespace, ...> keys hash and compare by the wrapped String.
Pin
A typed key identifying "the serviceId registered by pluginId". The map key type used by RuntimeSettings.services and any other place that needs to address a single plugin's service slot.
PluginId
Typed plugin identifier. Wraps the plugin id as a String. Like Namespace and ServiceId, a zero-cost extension type -- at runtime, it IS the underlying String. Because PluginId declares implements String, it flows directly into any String-typed parameter, JSON serialization key, or comparison without needing to reach for value. Equality and toString() delegate to the underlying String, so == against a String literal works.
ServiceId
Typed service-slot identifier.

Extensions

CapabilityLookup on Set<Capability>
Extension methods for capability lookup and type checking.
PluginHelper on Plugin
Convenience helpers for Plugin subscriptions and bus emit.
PluginServiceHelper on PluginService
Convenience helpers for resolving services from a PluginService.
SessionBroadcast on List<PluginSession<SessionPluginContext>>
Convenience extension for broadcasting events across all active sessions.
SessionHelper on PluginSession<SessionPluginContext>
Convenience helpers for service resolution and bus APIs on PluginSession.
StatefulPluginServiceHelper on StatefulPluginService<PluginContext>
Convenience helpers for StatefulPluginService resolution and bus APIs.

Typedefs

CapabilitySet = Set<Capability>
A set of Capability tags attached to a service registration.
EventBindingCallback = void Function(EventEnvelope event)
Callback for observing all non-internal events emitted on the bus.
EventHandler<T> = FutureOr<void> Function(EventEnvelope<T> e)
Handler function for events of type T.
Factory<T> = T Function()
Factory function that constructs a service instance.
GlobalContextFactory<G extends GlobalPluginContext, S extends SessionPluginContext> = G Function(ServiceRegistry registry, EventBus bus, List<PluginSession<S>> sessions)
Builds the global plugin context from runtime services.
GlobalStatefulPluginService<G extends GlobalPluginContext> = StatefulPluginService<G>
Optional alias for StatefulPluginService specialised to GlobalPluginContext.
RequestHandler<Request, Response> = FutureOr<Response?> Function(EventEnvelope<Request> e)
Handler function for request/response communication on an EventBus.
SessionContextFactory<G extends GlobalPluginContext, S extends SessionPluginContext> = S Function(ServiceRegistry registry, EventBus sessionBus, EventBus globalBus)
Builds a session plugin context from session and global services.
SessionStatefulPluginService<S extends SessionPluginContext> = StatefulPluginService<S>
Optional alias for StatefulPluginService specialised to SessionPluginContext.
SyncEventHandler<T> = void Function(EventEnvelope<T> e)
Synchronous handler function for events of type T.
SyncRequestHandler<Request, Response> = Response? Function(EventEnvelope<Request> e)
Synchronous handler function for request/response communication.

Exceptions / Errors

AllConcededException
Thrown by EventBus.request / EventBus.requestSync when every registered handler ran and returned null (conceded), and the Response type is non-nullable.
NoRequestAnswerException
Base class for "the request produced no answer" outcomes.
PluginLifecycleException
Exception thrown when one or more plugins fail during a lifecycle phase.
PluginStepAggregateException
Aggregates multiple step failures within a single plugin's attach or detach pass. Thrown only when more than one step (e.g. a service's attach() AND the plugin's user attach()) raised during the same _runAttach / _runDetach invocation.
RequestNotWiredException
Thrown by EventBus.request / EventBus.requestSync when no handler is registered for the (Request, Response) type pair, or no handler matched the requested identifier.