Skip to content
pubscout

prompt_dialog

1.0.18, released a year ago by an unverified publisher

A JavaScript-like prompt dialog widget for Flutter applications.

WASM-ready
$ flutter pub add prompt_dialog
Source repository

What it does

Provides a simple function call to show a modal prompt dialog with a text input field, confirmation buttons, and validation. It supports customization of text, hints, validation logic, and styling options like obscureText.

AI-written summary of version 1.0.18, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a quick input prompt dialog similar to the JavaScript prompt() function.
  • You want to collect small text inputs from users via a modal popup with built-in validation.

Skip it when

  • You require complex multi-field form dialogs.
  • You are building a custom-designed design system that does not use Material dialogs.

Strengths

  • Simple and easy to use with a single function call.
  • Highly customizable including validators, obscureText, controllers, and formatters.

Weaknesses

  • Limited to single-field text prompts.
  • Relies on standard Material dialog styling.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:flutter/material.dart';
import 'package:prompt_dialog/prompt_dialog.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: ElevatedButton(
            child: const Text('Prompt Dialog'),
            onPressed: () async {
              return print(await prompt(context));
            },
          ),
        ),
      ),
    );
  }
}

Alternatives

Packages that do the same job and could replace prompt_dialog.