waitForAbsentElement method Null safety

Future<Finder> waitForAbsentElement(
  1. Finder finder
)

Runs finder repeatedly until it finds zero Elements.

Implementation

Future<Finder> waitForAbsentElement(Finder finder) async {
  if (_frameSync)
    await _waitUntilFrame(() => SchedulerBinding.instance!.transientCallbackCount == 0);

  await _waitUntilFrame(() => finder.evaluate().isEmpty);

  if (_frameSync)
    await _waitUntilFrame(() => SchedulerBinding.instance!.transientCallbackCount == 0);

  return finder;
}