text static method

TextPromptSync text({
  1. required String title,
  2. String? placeholder,
  3. String? validator(
    1. String text
    )?,
  4. bool required = false,
  5. PromptTheme theme = PromptTheme.dark,
})

Creates a text input prompt with optional validation.

final name = SyncPrompts.text(
  title: 'Enter name',
  placeholder: 'Your name...',
  required: true,
).run();

Implementation

static TextPromptSync text({
  required String title,
  String? placeholder,
  String? Function(String)? validator,
  bool required = false,
  PromptTheme theme = PromptTheme.dark,
}) {
  return TextPromptSync(
    title: title,
    theme: theme,
    placeholder: placeholder,
    validator: validator,
    required: required,
  );
}