LAsyncView<T>.store constructor

LAsyncView<T>.store(
  1. LevitAsyncStore<T> store, {
  2. Key? key,
  3. required Widget builder(
    1. BuildContext context,
    2. T controller
    ),
  4. bool autoWatch = true,
  5. Widget loading(
    1. BuildContext context
    )?,
  6. Widget error(
    1. BuildContext context,
    2. Object error
    )?,
  7. List<Object?>? args,
})

Syntax sugar for consuming a LevitAsyncStore.

Implementation

factory LAsyncView.store(
  LevitAsyncStore<T> store, {
  Key? key,
  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,
}) =>
    LAsyncView<T>(
      key: key,
      resolver: (context) => context.levit.findAsync<T>(key: store),
      builder: builder,
      autoWatch: autoWatch,
      loading: loading,
      error: error,
      args: args,
    );