lazyPut<S> static method

LRouteScope lazyPut<S>(
  1. S builder(), {
  2. Key? key,
  3. required Widget child,
  4. String? name,
  5. String? tag,
  6. bool permanent = false,
  7. bool isFactory = false,
  8. List<Object?>? args,
})

A shorthand for creating a route-bound scope and registering a lazy dependency.

Implementation

static LRouteScope lazyPut<S>(
  S Function() builder, {
  Key? key,
  required Widget child,
  String? name,
  String? tag,
  bool permanent = false,
  bool isFactory = false,
  List<Object?>? args,
}) {
  return LRouteScope(
    key: key,
    name: name,
    args: args,
    dependencyFactory: (s) {
      s.lazyPut<S>(
        builder,
        tag: tag,
        permanent: permanent,
        isFactory: isFactory,
      );
    },
    child: child,
  );
}