end method

void end(
  1. void end()
)

Ends the turn with end now, or, while the call runs, once it has returned. The first end wins.

Implementation

void end(void Function() end) {
  if (_inFlight) {
    _pendingEnd ??= end;
  } else {
    end();
  }
}