prompt function

String? prompt([
  1. String? message,
  2. String? defaultValue
])

Shows the given message and waits for the user's input. Returns the user's input as string.

If the default value is given and the user inputs the empty string, then it returns the given default value.

If the default value is not given and the user inputs the empty string, it returns null.

If the stdin is not interactive, it returns null.

Implementation

_i2.String? prompt([
  _i2.String? message,
  _i2.String? defaultValue,
]) =>
    _i4.callMethod(
      _self,
      'prompt',
      [
        message ?? _i6.undefined,
        defaultValue ?? _i6.undefined,
      ],
    );