show static method

void show(
  1. BuildContext context, {
  2. required String title,
  3. Widget? description,
  4. String? placeholder,
  5. String? initialValue,
  6. void onSubmit(
    1. String value
    )?,
})

Show a text prompt dialog via DialogStack.

Implementation

static void show(
  BuildContext context, {
  required String title,
  Widget? description,
  String? placeholder,
  String? initialValue,
  void Function(String value)? onSubmit,
}) {
  final stack = DialogStack.of(context);
  stack.push(
    DialogPrompt(
      title: title,
      description: description,
      placeholder: placeholder,
      initialValue: initialValue,
      onSubmit: (value) {
        stack.pop();
        onSubmit?.call(value);
      },
      onCancel: () {
        stack.pop();
        return null;
      },
    ),
  );
}