control library

A comprehensive Flutter framework for state management, dependency injection, and navigation, designed to be scalable and easy to use.

Classes

ActionControl<T>
Provides specialized implementations of ObservableValue with distinct subscription behaviors.
AppState
Representation of App State handled by ControlRoot. AppState.init is considered as initial State - used during App loading. AppState.main is considered as default App State. Other predefined States (as AppState.onboarding) can be used to separate main App States and their flow. It's possible to create custom States by extending AppState.
AppStateBuilder
Setup of AppState. Holds case key, builder and transition
BaseControl
A robust business logic model that ensures onInit is called only once.
BaseControlState
The state for a BaseControlWidget.
BaseControlWidget
A lightweight CoreWidget for building UI without requiring a dedicated ControlModel.
BaseModel
A lightweight business logic model that prefers soft disposal by default.
BroadcastProvider
Provides static access to the default ControlBroadcast instance.
BroadcastSubscription<T>
Represents a subscription to a ControlBroadcast stream.
BroadcastSubscriptionArgs<T>
Arguments for creating a BroadcastSubscription.
CaseWidget<T>
Showing only one widget by active case. Based on AnimatedSwitcher.
ConfigModule
A ControlModule that integrates control_config with the ControlFactory.
ContinuousCurve
A Curve that combines multiple curves into a single continuous curve. Each curve is given an equal portion of the timeline.
Control
A static service locator for managing dependencies and initializing objects within an application.
ControlArgs
A flexible container for managing arguments passed between different parts of the application.
ControlBroadcast
Global stream to broadcast data and events. Stream is driven by keys and object types.
ControlBuilder<T>
A widget that subscribes to an observable object and rebuilds when the object notifies of a change.
ControlBuilderGroup
A widget that subscribes to a list of observable objects and rebuilds when any of them notify of a change.
ControlFactory
The core implementation of the service locator and dependency injection container.
ControllableWidget<T>
A widget that is controlled by an external object.
ControlModel
The foundational class for business logic models in the control framework.
ControlModule<T>
Defines a modular unit for organizing and registering dependencies within the control system.
ControlNavigator
A concrete implementation of RouteNavigator that uses the standard Flutter Navigator to perform navigation actions.
ControlObservable<T>
The primary concrete implementation of an observable value.
ControlPrefs
A robust wrapper around SharedPreferences for simplified and type-safe data persistence.
ControlProvider
A basic, abstract implementation of ControlModule that provides itself as the module.
ControlRoot
The root widget for the control framework. It initializes the theme, application states, and other global dependencies. It's the main entry point for a Control-based application structure.
ControlRoute
Defines a route, its builder, and navigation settings.
ControlRouteTransition
A custom PageRoute that builds its transitions using a RouteTransitionFactory.
ControlRouteTransitionSetup
Provides setup information for a ControlRouteTransition. This is passed to the RouteTransitionFactory to build the transition.
ControlScope
Provides access to the control framework's dependency injection system within a specific BuildContext. It allows retrieving dependencies from the nearest CoreState ancestor in the widget tree.
ControlState<U extends _ControlWidgetBase>
The State object for a _ControlWidgetBase.
ControlSubscription<T>
Represents a subscription to an ObservableValue.
ControlWidget
A flexible CoreWidget that can manage multiple ControlModels.
CoreElement
The core Element for the Control framework.
CoreState<T extends CoreWidget>
The base State object for a CoreWidget.
CoreWidget
The base StatefulWidget for the Control framework.
CrossTransition
Defines a transition between two widgets, typically used with AnimatedSwitcher or CaseWidget. It consists of two separate transitions: one for the widget coming in, and one for the widget going out.
CupertinoThemeConfig
A concrete implementation of ThemeConfig for CupertinoThemeData.
DelayBlock
A helper to ensure a block of asynchronous code takes a minimum amount of time to complete.
DisposableClient
The client-side part of a disposable resource management pattern.
DisposableToken
The token part of a disposable resource management pattern, used by the resource consumer.
ElementValue<T>
A simple ValueNotifier for use within a CoreElement.
FieldBuilder<T>
A convenience widget that builds itself based on the state of a FieldControl.
FieldControl<T>
A Stream-based implementation of ObservableModel.
FieldSink<T>
A standard Sink for a FieldControl.
FieldSinkConverter<T>
An extended FieldSink that uses a converter. It converts the added data before passing it to the FieldControl.
FieldStreamBuilder<T>
A specialized StreamBuilder for use with a FieldControl.
FieldSubscription<T>
A ControlSubscription that also implements StreamSubscription.
FutureBlock
A utility class for creating a re-triggerable, cancellable delayed future.
Initializable
An interface for objects that can be initialized with arguments after construction.
InitLoader<T extends InitLoaderControl>
A widget that hosts an InitLoaderControl to manage an asynchronous initialization process while displaying a UI.
InitLoaderControl
A control that manages an asynchronous loading process, typically during app initialization. It transitions through loading states and, upon completion, can change the global AppState.
InputControl
Extends TextEditingController to integrate with the Control framework's state management and lifecycle. It provides validation, focus management, and chaining capabilities for input fields.
IntervalCurve
A curve that maps another curve to a specific interval of the 0.0-1.0 timeline.
LazyInitializer<T>
Lazily builds and caches a value. The value is created only once on the first access.
ListBuilder<T>
A convenience widget that builds itself based on the state of a FieldControl containing a List.
ListControl<T>
An extended version of FieldControl specialized for managing a List<T>.
LoadingBuilder
A widget that builds itself based on the LoadingStatus of a LoadingControl.
LoadingControl
An extended FieldControl specialized for managing a LoadingStatus.
MaterialThemeConfig
A concrete implementation of ThemeConfig for ThemeData.
ObjectTag
A robust ValueKey implementation used to uniquely identify objects.
ObservableBase<T>
The fundamental interface for an observable object.
ObservableChannel
An observable that acts as a simple notification channel, without carrying a value.
ObservableGroup
A class that groups multiple observables into a single ObservableValue.
ObservableModel<T>
An abstract base class for creating a custom ObservableValue.
ObservableNotifier
An interface for objects that can be notified to propagate changes.
ObservableValue<T>
An observable that holds and notifies about changes to a single value.
Parse
A utility class with static methods for robust data parsing and type conversion.
ParseDecorator
A collection of decorators for string formatting with Parse.format.
ParseN
A utility class with static methods for parsing data types that can explicitly return null.
PrefModel<T>
A concrete implementation of PrefModelBase for common data types.
PrefModelAsync<T>
A base class for reactive preference models that handle asynchronous value retrieval.
PrefModelBase<T, U>
A base class for creating reactive models that wrap preference values.
ReverseCurve
A curve that reverses the output of another curve.
RootContext
The CoreContext for the ControlRoot widget. Provides access to global app state and theme configuration.
RouteArgs
A specialized version of ControlArgs for route handling. It contains the ControlRoute, RouteMask, and any passed arguments.
RouteHandler
Legacy - waiting for refactor. Connects a ControlRoute with a RouteNavigator to execute navigation.
RouteMask
Represents a path mask used for matching and formatting routes with dynamic segments. For example: /project/{pid}/user/{uid}.
RouteNavigator
Providing basic type of navigation.
RouteStore
Stores ControlRoute definitions, mapping them by a unique identifier.
RoutingModule
A ControlModule for initializing and providing a RouteStore.
RoutingProvider
Provides route generation logic, typically used with onGenerateRoute.
RoutingStoreProvider
An abstract provider for a list of ControlRoutes.
SingleControlWidget<T extends ControlModel>
A CoreWidget that is tightly coupled with a single primary ControlModel of type T.
StackControl<T>
An observable stack that manages a list of values and notifies listeners about changes to the top of the stack.
ThemeConfig<T>
Manages theme data and preferences for the application. It can be used to switch between different themes and persist the user's choice.
UnitId
A utility class for generating unique and random string identifiers.

Enums

LoadingStatus
Represents the status of an asynchronous operation.

Mixins

ContextComponent
A mixin for a ControlModel to gain access to the CoreContext of its host widget.
Disposable
A mixin that marks an object as having resources that need to be cleaned up.
DisposeHandler
A mixin that provides sophisticated control over an object's disposal logic.
DisposeObserver
A mixin for a ControlModel that allows it to manage the lifecycle of other Disposable objects.
EventComponent<T>
InitProvider
A mixin for a CoreWidget that initializes its arguments from the current ModalRoute.
LateInit
A mixin that delays a piece of initialization logic until the main ControlFactory is fully initialized.
LazyControl
A mixin that automatically handles the removal of an object from the ControlFactory when it is disposed.
LazyHook<T>
A mixin to implement a lazy-initialized object (a "hook") that is tied to the lifecycle of a CoreContext. The object is created only when first accessed.
LazyProvider
A mixin for a CoreWidget that requires custom dependency mounting.
NotifierComponent
A mixin that adds ObservableChannel capabilities to a ControlModel.
ObservableComponent<T>
A mixin that adds ObservableValue capabilities to a ControlModel.
OnLayout
A mixin for a CoreWidget that provides a callback after the first frame is rendered.
PrefsProvider
A mixin that provides easy access to the ControlPrefs instance.
ReferenceCounter
A mixin that adds reference counting to a DisposeHandler.
TickerComponent
A mixin for a ControlModel that requires a TickerProvider.

Extensions

AnimationControllerHook on BuildContext
Extension hook on CoreContext to provide easy access to AnimationControllers.
ContinuousCurveExt on Curve
Extension on Curve to provide convenience methods for combining and reversing curves.
ControlContextExt on BuildContext
Extension on BuildContext for common Control framework operations.
CoreContextExt on BuildContext
Extension methods on BuildContext to simplify access to CoreContext features.
CurveEx on Curve
Extension on Curve to provide convenience methods for creating IntervalCurves.
DisplayExt on Display
Extension on Display to provide view size information.
DisposableExt on Disposable
FlutterViewExt on FlutterView
Extension on FlutterView to provide view size information.
IterableExtension on Iterable
ListExt on List<E>
MapExtension on Map
MediaViewExt on BuildContext
Extension on BuildContext to provide convenient access to view and media query information.
ObservableBaseExt on ObservableBase
ObservableBoolExt on ObservableModel<bool>
An extension on ObservableModel<bool> providing convenience methods for working with boolean observables.
ObservableValuExt on ObservableValue
OverlayControl on BuildContext
An extension on CoreContext to manage OverlayEntrys.
RootContextRouterExt on RootContext
Extension on RootContext for routing.
RouteNavigatorExtension on BuildContext
An extension on BuildContext that provides a set of convenience methods for navigation, making it easy to perform routing actions from anywhere in the widget tree.
ScrollControllerHook on BuildContext
Extension hook on CoreContext to provide easy access to ScrollControllers.
ThemeDataHook on BuildContext
Extension hook on CoreContext to provide easy access to the current ThemeData.
TickerHook on BuildContext
Extension hook on CoreContext to provide a TickerProvider.

Functions

printAction(ValueGetter action) → void
printDebug(dynamic object) → void

Typedefs

ControlWidgetBuilder<T> = Widget Function(BuildContext context, T value)
A builder function for widgets that depend on a value of type T.
CoreContext = CoreElement
The core BuildContext for the Control framework.
CupertinoThemeFactory = ThemeFactory<CupertinoThemeData>
A ThemeFactory for CupertinoThemeData.
DisposeMarker = dynamic Function()
Dump marker used to mark object for dispose.
EntryConverter<T> = T Function(dynamic key, dynamic value)
InitFactory<T> = T Function(dynamic args)
MaterialThemeFactory = ThemeFactory<ThemeData>
A ThemeFactory for ThemeData.
ParseDecoratorFormat = String Function(String input)
Predicate<T> = bool Function(T value)
RouteArgFactory = dynamic Function(RouteArgs args)
RouteBuilderFactory<T> = Route<T> Function(WidgetBuilder builder, RouteSettings settings)
RouteTransitionFactory = Widget Function(BuildContext context, ControlRouteTransitionSetup setup, Widget child)
ThemeFactory<T> = Map<dynamic, ThemeInitializer<T>>
A map of theme keys to their corresponding ThemeInitializer.
ThemeInitializer<T> = T Function()
A function that returns a theme of type T.
ValueCallback<T> = void Function(T value)
ValueConverter<T> = T Function(dynamic value)
ValueDelegateGetter<T> = T Function()
ValueDelegateSetter<U> = void Function(U value)

Exceptions / Errors

BroadcastSubscriptionException
Exception thrown when a BroadcastSubscription cannot be created.