isWaitingFor method

bool isWaitingFor(
  1. Object? flag, {
  2. Object? ref,
})

Return true if is waiting for a specific flag. If ref is null, it returns true if it's waiting for any reference of the flag. If ref is not null, it returns true if it's waiting for that specific reference of the flag.

Implementation

bool isWaitingFor(Object? flag, {Object? ref}) {
  Set? refs = _flags[flag];

  if (ref == null)
    return refs != null && refs.isNotEmpty;
  else
    return refs != null && refs.contains(ref);
}