ServicesContainerProvider<T extends ServicesContainer> class
A widget that provides a ServicesContainer to its descendants.
- autoDispose - if true, the ServicesContainer will be disposed when the widget is disposed.
- autoInit - if true, the ServicesContainer will be initialized when the widget is initialized.
- initWidgetBuilder - a widget to build when the ServicesContainer is initializing.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ServicesContainerProvider
Constructors
- ServicesContainerProvider({Key? key, required Widget child, required T servicesContainerBuilder(), bool autoDispose = true, bool autoInit = true, Widget initWidgetBuilder(BuildContext context)?})
-
const
Properties
- autoDispose → bool
-
If true, the ServicesContainer will be disposed when the widget is disposed.
final
- autoInit → bool
-
If true, the ServicesContainer will be initialized when the widget is initialized.
final
- child → Widget
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initWidgetBuilder → Widget Function(BuildContext context)?
-
A widget to build when the ServicesContainer is initializing.
final
- 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
- servicesContainerBuilder → T Function()
-
A builder for the ServicesContainer.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ServicesContainerProvider< T> > -
Creates the mutable state for this widget at a given location in the tree.
override
-
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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
Static Methods
-
of<
T extends ServicesContainer> (BuildContext context) → T -
Returns the ServicesContainer from the context.
It uses
getInheritedWidgetOfExactTypeto get the ServicesContainer from the context. It is safe to call this method from build method or from any other method.