FamilyViewModelBuilder<P extends BaseProvider<N, T> , N extends BaseNotifier<T> , T, F, R, B> class
Similar to ViewModelBuilder, but designed for family providers.
When this widget is disposed, only the parameter will be disposed instead of the whole family (which is what ViewModelBuilder does).
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FamilyViewModelBuilder
Constructors
-
FamilyViewModelBuilder.new({Key? key, required FamilySelectedWatchable<
P, N, T, F, R, B> provider, void onFirstLoadingFrame(BuildContext context)?, void onFirstFrame(BuildContext context, R vm)?, FutureOr<void> init(BuildContext context)?, void dispose(Ref ref)?, bool? disposeProvider, Widget loadingBuilder(BuildContext context)?, Widget errorBuilder(BuildContext context, Object error, StackTrace stackTrace)?, String? debugLabel, Widget? debugParent, required Widget builder(BuildContext context, R vm)})
Properties
- builder → Widget Function(BuildContext context, R vm)
-
The builder to build the widget tree.
final
- debugLabel → String
-
A debug label for better logging.
final
- dispose → void Function(Ref ref)?
-
This function is called when the widget is removed from the tree.
final
- disposeProvider → bool
-
Whether to dispose the provider when the widget is removed from the tree.
final
- errorBuilder → Widget Function(BuildContext context, Object error, StackTrace stackTrace)?
-
The widget to show if the initialization fails.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
init
→ FutureOr<
void> Function(BuildContext context)? -
This function is called AFTER the widget is built for the first time.
It can return a Future.
In this case, the widget will show the loadingBuilder if provided.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingBuilder → Widget Function(BuildContext context)?
-
The widget to show while the provider is initializing.
final
- onFirstFrame → void Function(BuildContext context, R vm)?
-
This function is called BEFORE the widget is built for the first time.
The view model is available at this point.
final
- onFirstLoadingFrame → void Function(BuildContext context)?
-
This function is called BEFORE the widget is built for the first time.
It should not return a Future.
final
-
provider
→ FamilySelectedWatchable<
P, N, T, F, R, B> -
The provider to use.
The builder will be called whenever this provider changes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< FamilyViewModelBuilder< P, N, T, F, R, B> > -
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