pauseSync function

void pauseSync({
  1. StringSink? output,
})

Notice

This function does block the calling Isolate, until a full line is available. If you do not want to block, use the asynchronous version instead.

See pause.

Description

Wait until the user presses any key.

output defaults to stdout.

Implementation

void pauseSync({
  StringSink? output,
}) {
  final oSink = output ?? stdout;

  oSink.writeln("Press any key to continue...");
  stdin.readLineSync();
}