show static method
Future<String?>
show(
- BuildContext context, {
- required String title,
- Widget? description,
- String? placeholder,
- String? initialValue,
Show a text prompt dialog.
Returns the submitted text, or null if cancelled.
Implementation
static Future<String?> show(
BuildContext context, {
required String title,
Widget? description,
String? placeholder,
String? initialValue,
}) {
return Navigator.of(context).showDialog<String>(
builder: (ctx) => DialogPrompt(
title: title,
description: description,
placeholder: placeholder,
initialValue: initialValue,
onSubmit: (value) {
Navigator.of(ctx).pop(value);
},
onCancel: () {
Navigator.of(ctx).pop();
return null;
},
),
);
}