kill method

void kill()

Immediately terminates the program without a final render.

Unlike quit, which sends a QuitMsg through the normal message processing pipeline, kill immediately stops the program and skips the final render.

Use this when you need to terminate immediately, such as:

  • Handling a fatal error
  • Responding to an external shutdown signal
  • Timeout scenarios

Implementation

void kill() {
  if (!_running) return;
  _killed = true;
  final completer = _runCompleter;
  if (completer == null || completer.isCompleted) return;
  completer.complete();
}