isWaiting method

bool isWaiting(
  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 isWaiting(Object? flag, {Object? ref}) {
  Set? refs = _flags[flag];

  return (ref == null) //
      ? (refs != null) && refs.isNotEmpty //
      : (refs != null) && refs.contains(ref);
}