LScopedAsyncView<T>.store constructor
LScopedAsyncView<T>.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.
Implementation
factory LScopedAsyncView.store(
LevitAsyncStore<T> store, {
Key? key,
LScopeDependencyFactory? dependencyFactory,
required Widget Function(BuildContext context, T controller) builder,
bool autoWatch = true,
Widget Function(BuildContext context)? loading,
Widget Function(BuildContext context, Object error)? error,
List<Object?>? args,
String? scopeName,
}) {
return LScopedAsyncView<T>(
key: key,
dependencyFactory: dependencyFactory,
resolver: (context) => context.levit.findAsync<T>(key: store),
builder: builder,
autoWatch: autoWatch,
loading: loading,
error: error,
args: args,
scopeName: scopeName,
);
}