put<S> static method

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

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

Implementation

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