mosaic library

Classes

AsyncSignal<T>
A signal that handles asynchronous operations with built-in loading states.
AsyncStatus<T>
Represents the state of an asynchronous operation.
ConsoleDispatcher
ContractRegistry
Central registry that maps a ModuleContract type to its live provider.
DependencyInjector
EventChannel<T>
A type-safe descriptor for an event channel.
EventContext<T>
Contains information passed to a listener when an event is emitted.
EventListener<T>
Supports dynamic patterns using special characters:
Events
Global event manager with support for dynamic channels.
FeatureFlags
A lightweight, reactive feature-flag store.
FileLoggerDispatcher
FileLoggerDispatcher is used to log in files The goal of this logger dispatcher is to write logs in different files splitted per tags. By default it writes all logs in one file and one file per tags Allowing to write a log in multiple files. For now it saves the file with the following format by defalt: tagyearmonth_day.log Such that there's one file (for the same tag) per day. But its format is defined by the fileNameRole that you can pass in the constructor.
Imc
Inter-Module Communication container for decoupled action dispatching.
ImcContext
Execution context passed to each callback in an IMC action chain.
InMemoryStorage
In-memory MosaicStorage used by default and in tests.
InternalAutoQueue
A thread-safe auto-retry queue for asynchronous operations.
InternalQueueNode<T>
Represents a single operation in the queue with its completion mechanism.
InternalRoute<T>
Represents an entry in the module's internal navigation stack.
InternalRouter
LifecyclePolicy
Drives module lifecycle transitions automatically so capabilities like suspend/resume actually get used.
ListSignal<T>
Logger
A production-ready logging system with advanced features.
LoggerDispatcher
LoggerDispatcher is the abstract class for log in different mode. It is used by the Logger class when it dispatch a log. When the log function of logger is called it execute secureCall that it cannot be overrided.
LoggerWrapper
ModularExtension
Extensions class
ModularState<T extends ModularStatefulWidget>
ModularStatefulWidget
Stateful Modular extension should have the
Module
Base class for application modules with comprehensive lifecycle management.
ModuleContract
Marker base class for a module's public, typed API surface.
ModuleHost
Hosts a single module inside a Navigator page: its root widget plus its internal (intra-module) navigation stack, rebuilt as that stack changes.
ModuleManager
Manages all modules in the application and provides centralized control over module lifecycle, error handling, and state management.
MosaicContainer
Root container that wires together every Mosaic subsystem (events, router, IMC, module registry, DI, feature flags, contracts, logger).
MosaicInspector
A live, in-app inspector panel for a Mosaic application.
MosaicInspectorOverlay
Wraps child and adds a floating button (debug builds only by default) that toggles the MosaicInspector panel.
MosaicProvider
Provides a MosaicContainer to a widget subtree.
MosaicRouteInformationParser
Parses platform route information (URLs, deep links) into a MosaicRouteState and back.
MosaicRouterDelegate
A RouterDelegate that renders Mosaic's inter-module history as real Navigator pages, giving you page transitions, the system back button / predictive back, and browser URL / deep-link sync.
MosaicRouteState
Serializable description of the inter-module navigation state.
MosaicScope
MosaicStorage
Pluggable key/value backend used by the persistence layer.
MultipleWatch
Mutex<T>
Mutex is used to protect modification at the same time across multi threads The api is very simple:
RouteHistoryEntry<T>
RouteNode
RouteTransitionContext<T>
Segment
Base class for building event topic paths with chaining support.
Semaphore
A counting semaphore for controlling access to a resource pool.
Signal<T>
A reactive state container that notifies listeners when its value changes.
UIInjector
Watch<T>
Watches a Signal and rebuilds when its value changes.

Enums

LogLevel
Hierarchical log levels for filtering messages by importance.
LogType
The type of log message being recorded.
ModuleLifecycleState
Lifecycle states for module management.

Mixins

Admissible<T extends StatefulWidget>
Handles Event subscription automatically.
Id
Mixin that adds ID-based path building to segments.
Loggable
A mixin that provides convenient logging methods for classes.
MiddlewareContract
Mixin that routes a contract's calls through the IMC middleware chain.
MosaicServices
Param
Mixin that adds multi-parameter path building to segments.
Persistable
Adds automatic state persistence to a Module, built on Signals.
StatefulSignal<T extends StatefulWidget>

Properties

mosaic MosaicContainer
The default root MosaicContainer scope used throughout the application.
final

Typedefs

EventCallback<T> = void Function(EventContext<T>)
Type for a callback function that receives an event context.
FeatureFlagResolver = FutureOr<bool?> Function(String key)
Signature for an asynchronous source of feature flag values.
ImcCallback = FutureOr Function(ImcContext)
Callback function signature for IMC actions.
InternalQueueAction<T> = Future<T> Function()
A function type that represents an asynchronous operation in the queue.
LoggerWrapperCallback = String Function(String, LogType, List<String>)
ModularExtensionBuilder = Widget Function(BuildContext)
Type for the builder function type for extensions
ModuleFactory = FutureOr<Module> Function()
Factory that lazily constructs a Module the first time it is needed.
ModuleGate = FutureOr<bool> Function()
Signature for a gate that decides whether a lazy module may be loaded.
RouteNodeBuilder = Widget Function(BuildContext, RouteTransitionContext)
SignalCallback<T> = void Function(T)
SignalListener = Object
UIInjectorCallback = EventCallback<ModularExtension>
UIInjectorListener = EventListener<ModularExtension>

Exceptions / Errors

ContractException
Exception thrown when a module contract cannot be resolved or is misused.
DependencyException
EventException
ImcException
LoggerException
ModuleException
Exception thrown when module operations fail.
MosaicException
RouterException
SignalException