LScopedView<T>.store constructor
LScopedView<T>.store (
- LevitStore<
T> state, { - Key? key,
- LScopeDependencyFactory? dependencyFactory,
- required Widget builder(
- BuildContext context,
- T controller
- Widget orElse(
- BuildContext context
- bool autoWatch = true,
- String? scopeName,
- List<
Object?> ? args,
Syntax sugar for consuming a LevitStore within a new scope.
Implementation
factory LScopedView.store(
LevitStore<T> state, {
Key? key,
LScopeDependencyFactory? dependencyFactory,
required Widget Function(BuildContext context, T controller) builder,
Widget Function(BuildContext context)? orElse,
bool autoWatch = true,
String? scopeName,
List<Object?>? args,
}) {
return LScopedView<T>(
key: key,
dependencyFactory: dependencyFactory,
resolver: (context) => context.levit.findOrNull<T>(key: state),
builder: builder,
orElse: orElse,
autoWatch: autoWatch,
scopeName: scopeName,
args: args,
);
}