SingleControlWidget<T extends ControlModel> class abstract

A CoreWidget that is tightly coupled with a single primary ControlModel of type T.

This widget automatically initializes and provides the control of type T to the build method. The control is resolved from the widget's arguments or the global ControlFactory.

Use this when a widget's logic is primarily managed by one ControlModel.

Inheritance
Implementers

Constructors

SingleControlWidget({Key? key, Map initArgs = const {}})
const

Properties

autoMountControls bool
If true, all ControlModels found in the widget's arguments will be automatically initialized and mounted. Defaults to false.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
initArgs Map
A map of initial arguments to be passed to the CoreContext.
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context, T control) Widget
Builds the widget's UI with access to the primary control.
createElement() CoreContext
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() ControlState<_ControlWidgetBase>
Creates the mutable state for this widget at a given location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
init(CoreContext context) → void
A preliminary initialization method called by the CoreContext. This is a good place for mixins to hook into the initialization process.
inherited
initControl(CoreContext context) → T?
Initializes the primary ControlModel of type T.
initControls(CoreContext context) List<ControlModel>
Returns a list of ControlModels to be initialized and managed by this widget. This method is called once during state initialization.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onChangeState(ControlState<_ControlWidgetBase> state, dynamic value) → void
Called when the state is notified of a change from one of its notifiers.
inherited
onDependencyChanged(CoreContext context) → void
Called when a dependency of this widget changes. See State.didChangeDependencies for more information.
inherited
onDispose() → void
Called when the widget is being disposed.
inherited
onInit(Map args, CoreContext context) → void
Called once when the state is fully initialized and the context is available.
inherited
onInitState(ControlState<_ControlWidgetBase> state) → void
Called after the state and all its controls have been initialized.
inherited
onUpdate(CoreContext context, CoreWidget oldWidget) → void
Called when the widget is updated with new configuration. See State.didUpdateWidget for more information.
inherited
rebuild(CoreContext context) Widget
Abstract method for building the widget's UI. Implemented by subclasses like ControlWidget and SingleControlWidget.
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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