LView<T>.put constructor
LView<T>.put (
- T create(), {
- Key? key,
- String? tag,
- bool permanent = false,
- required Widget builder(
- BuildContext context,
- T controller
- Widget orElse(
- BuildContext context
- bool autoWatch = true,
- List<
Object?> ? args,
Registers and consumes a dependency of type T.
Implementation
factory LView.put(
T Function() create, {
Key? key,
String? tag,
bool permanent = false,
required Widget Function(BuildContext context, T controller) builder,
Widget Function(BuildContext context)? orElse,
bool autoWatch = true,
List<Object?>? args,
}) {
return LView<T>(
key: key,
resolver: (context) =>
context.levit.put<T>(create, tag: tag, permanent: permanent),
builder: builder,
orElse: orElse,
autoWatch: autoWatch,
args: args,
);
}