containsDependencyK method

bool containsDependencyK(
  1. Entity typeEntity, {
  2. Entity groupEntity = const DefaultEntity(),
})

Checks if any dependency registered under the exact typeEntity exists under the specified groupEntity. Unlike containsDependency, this will not include subtypes.

Returns true if it does and false if it doesn't.

Implementation

@pragma('vm:prefer-inline')
bool containsDependencyK(
  Entity typeEntity, {
  Entity groupEntity = const DefaultEntity(),
}) {
  final a = TypeEntity(Sync, [typeEntity]);
  final b = TypeEntity(Async, [typeEntity]);
  return _state[groupEntity]?.values.any(
        (e) => e.typeEntity == a || e.typeEntity == b,
      ) ==
      true;
}