readLineSync method

String? readLineSync({
  1. dynamic encoding,
})

Use this to read a whole line, whether in mock mode or with real stdin.

Implementation

String? readLineSync({encoding}) {
  if (mock) {
    var ret = _mockBuffer[0];
    _mockBuffer.removeAt(0);
    if (informStdout != null && (_isTest || _getEchomode())) {
      informStdout!.write(ret);
    }
    return ret;
  }
  return stdin.readLineSync(encoding: encoding);
}