validated static method
TextPromptSync
validated({
- required String title,
- required String? validator(),
- String? placeholder,
- PromptTheme theme = PromptTheme.dark,
Creates a text input with custom validation message.
final email = SyncPrompts.validated(
title: 'Enter email',
validator: (t) => t.contains('@') ? null : 'Invalid email',
).run();
Implementation
static TextPromptSync validated({
required String title,
required String? Function(String) validator,
String? placeholder,
PromptTheme theme = PromptTheme.dark,
}) {
return TextPromptSync(
title: title,
theme: theme,
placeholder: placeholder,
validator: validator,
);
}