isPrepared<S> method

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

Checks if a lazy factory callback Get.lazyPut() that returns an Instance<S> is registered in memory.

  • tag is optional, if you used a tag to register 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;
}