LScopedAsyncView<T> class

A widget that creates a synchronous scope but resolves its controller asynchronously.

LScopedAsyncView initializes the scope immediately with LScope, then uses LAsyncView to wait for async controller resolution.

In short:

  • Sync scope setup
  • Async controller resolution
Inheritance

Constructors

LScopedAsyncView({Key? key, LScopeDependencyFactory? dependencyFactory, Future<T> resolver(BuildContext context)?, Widget builder(BuildContext context, T controller)?, bool autoWatch = true, Widget loading(BuildContext context)?, Widget error(BuildContext context, Object error)?, List<Object?>? args, String? scopeName})
const
LScopedAsyncView.put(Future<T> create(), {Key? key, String? tag, bool permanent = false, bool isFactory = false, required Widget builder(BuildContext context, T controller), bool autoWatch = true, Widget loading(BuildContext context)?, Widget error(BuildContext context, Object error)?, List<Object?>? args, String? scopeName})
Shorthand for creating a scope, registering an async dependency, and consuming it.
factory
LScopedAsyncView.store(LevitAsyncStore<T> store, {Key? key, LScopeDependencyFactory? dependencyFactory, required Widget builder(BuildContext context, T controller), bool autoWatch = true, Widget loading(BuildContext context)?, Widget error(BuildContext context, Object error)?, List<Object?>? args, String? scopeName})
Syntax sugar for consuming a LevitAsyncStore within a new scope.
factory

Properties

args List<Object?>?
Optional dependency keys for re-resolution.
finalinherited
autoWatch bool
Whether to wrap the view in an LWatch.
finalinherited
builder Widget Function(BuildContext context, T controller)?
Builds the widget tree using the resolved controller.
finalinherited
dependencyFactory LScopeDependencyFactory?
Optional factory to register dependencies in the internal scope.
final
error Widget Function(BuildContext context, Object error)?
Builder for the error state.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loading Widget Function(BuildContext context)?
Builder for the loading state.
finalinherited
resolver Future<T> Function(BuildContext context)?
Resolves the dependency asynchronously from the context.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scopeName String?
A descriptive name for the internal scope.
final

Methods

buildError(BuildContext context, Object err) Widget
inherited
buildLoading(BuildContext context) Widget
inherited
buildView(BuildContext context, T controller) Widget
Builds the view content for the given controller.
inherited
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<LScopedAsyncView<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
onConfigScope(LevitScope scope) → void
Called when the internal scope is being configured.
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