The w_module library implements a module encapsulation and lifecycle pattern for Dart that interfaces well with the application architecture defined in the w_flux library.
w_module defines how data should flow in and out of a module, how renderable UI is exposed to consumers, and establishes a common module lifecycle that facilitates dynamic loading / unloading of modules.
- Key that enables dispatching of events. Every Event is associated with a specific key, and that key must be used in order to dispatch an item to that event stream. [...]
- An event stream that can be listened to. A dispatch key is required to instantiate the event stream. The same dispatch key must subsequently be used to dispatch all events on the stream, effectively preventing uncontrolled external dispatch.
- A base class for a collection of Event instances that are all tied to the same DispatchKey. [...]
- Intended to be extended by most base module classes in order to provide a unified lifecycle API.
- A Module encapsulates a well-scoped logical unit of functionality and exposes a discrete public interface for consumers. It extends LifecycleModule to ensure that it adheres to a well-defined lifecycle. [...]
- Standard ModuleComponents class. If a module implements a custom class for its components, it should extend ModuleComponents.
- A set of messages returned from the hierarchical application of shouldUnload
- A SimpleModule encapsulates a well-scoped logical unit of functionality and exposes a discrete public interface for consumers. [...]
The type of 'startup timing metric' to be used by
Exceptions / Errors
- Exception thrown when unload fails.