isPrepared<S> method

bool isPrepared<S>({
  1. String? tag,
})

Checks whether a lazy factory callback for type S (and optionally with tag) is registered and ready to be initialized.

  • tag Optional tag to identify the lazy instance.

Implementation

bool isPrepared<S>({String? tag}) {
  final newKey = _getKey(S, tag);

  final builder = _getDependency<S>(tag: tag, key: newKey);
  if (builder == null) {
    return false;
  }

  if (!builder.isInit) {
    return true;
  }
  return false;
}