isWaiting method
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);
}