prompt function

Future<String> prompt(
  1. String? text,
  2. {Stream<List<int>>? stdin}
)

Get text

Implementation

Future<String> prompt(String? text, {Stream<List<int>>? stdin}) async {
  stdout.write('${(text?.isNotEmpty ?? false) ? '$text' : 'Enter text'}: ');
  await stdout.safeFlush();
  return await _promptGetText(stdin: stdin);
}