LScopedAsyncView<T>.store constructor

LScopedAsyncView<T>.store(
  1. LevitAsyncStore<T> store, {
  2. Key? key,
  3. LScopeDependencyFactory? dependencyFactory,
  4. required Widget builder(
    1. BuildContext context,
    2. T controller
    ),
  5. bool autoWatch = true,
  6. Widget loading(
    1. BuildContext context
    )?,
  7. Widget error(
    1. BuildContext context,
    2. Object error
    )?,
  8. List<Object?>? args,
  9. 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,
  );
}