prompt method

String prompt(
  1. String message, {
  2. String? defaultValue,
})

Prompts the user for input with an optional defaultValue. Retries if the input contains invalid characters (e.g., Arabic).

Implementation

String prompt(String message, {String? defaultValue}) {
  while (true) {
    final input = _logger.prompt(message, defaultValue: defaultValue);
    if (ValidationUtils.hasArabic(input)) {
      error('❌ Error: Arabic input is not allowed in this tool.');
      info('   Please enter the value using Latin characters.');
      continue;
    }
    return input;
  }
}