lazyPutAsync<S> static method

LScope lazyPutAsync<S>(
  1. Future<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 scope and registering an async lazy dependency.

Implementation

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