nativeTaken static method

bool nativeTaken(
  1. String runId,
  2. String id, {
  3. String? error,
})

Tells the run runId that Metro has captured the shot id, or with error, why it couldn't.

Returns false when the step has stopped waiting.

Implementation

static bool nativeTaken(String runId, String id, {String? error}) {
  final Completer<void>? waiting = _native.remove('$runId/$id');
  if (waiting == null || waiting.isCompleted) return false;
  if (error == null) {
    waiting.complete();
  } else {
    waiting.completeError(StateError(error));
  }
  return true;
}