dialog 0.7.2+1

  • Readme
  • Changelog
  • Installing
  • 87

Dialog.dart #

Modern modal dialog implementation containing remakes of alert & confirm dialogs supplemented by prompt & custom modal dialogs

Description #

This package replaces default alert & confirm dialogs from Dart's Window class and adds missing prompt & custom modal dialogs. Default system dialogs called by that prompts are superseded by modern modal design.

Usage #

Usage is almost the same as set in the Dart's Window class and completely the same as described in the WHATWG HTML Standard. For each dialog there is just one file to import only the dialog you really need. There is also one file to import all four dialogs at once if you want to use them all.

import "package:dialog/~file~";

Libraries to import in ~file~: #


Replaces default alert dialog.

querySelector("#alertButton").onClick.listen((_) {

Image of alert


Replaces default confirm dialog.

querySelector("#confirmButton").onClick.listen((_) async {
  var myConfirm = await confirm("Confirmed?!");

Image of confirm


Adds missing prompt dialog.

querySelector("#promptButton").onClick.listen((_) async {
  var myPrompt = await prompt("Prompted?!", "Yes!");

Image of prompt


Adds fully customizable modal dialog.

querySelector("#modalButton").onClick.listen((_) async {
  var myModal = await modal(
      "Surprise", [Text("Boo!")], "Eek!", "Huh?", "Haha!", "Come on!", true);

Image of modal


Do you need to use them all at once? Try to import dialog.dart file only!

Contributing #

Please fill in an issue or a pull request on project's GitHub page.

You might want to buy me a beer 🍺 or a coffee ☕.

License #

The BSD 2-Clause License

0.7.2 #

  • Minor Bootstrap fix

0.7.1 #

  • Fixed Bootstrap issues

0.7.0 #

  • New modal dialog

0.6.2 #

  • Bootstrap 4 support

0.6.1 #

  • Apply Bootstrap css only to dialogs

0.6.0 #

  • Dart 2 support

0.5.0 #

  • Resolved issues with Bootstrap
  • Fixed removing dialogs when closed

0.4.1 #

  • Fixed enter key bug in prompt

0.4.0 #

  • Resolved bugged order using dart:async
  • Added onKeyDown listeners for Enter or ESC

0.3.0 #

  • Formatted by dartfmt
  • Added screenshots to the description
  • Added a few additional Bootstrap styles

0.2.0 #

  • Reworked to work (but still buggy)

0.1.0 #

  • New alert dialog
  • New confirm dialog
  • New prompt dialog

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  dialog: ^0.7.2+1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:dialog/dialog.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on May 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.1
  • pana: 0.13.8-dev

Health suggestions

Fix lib/dialogs/confirm.dart. (-0.50 points)

Analysis of lib/dialogs/confirm.dart reported 1 hint:

line 14 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Fix lib/dialogs/modal.dart. (-0.50 points)

Analysis of lib/dialogs/modal.dart reported 1 hint:

line 34 col 3: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Fix lib/dialogs/prompt.dart. (-0.50 points)

Analysis of lib/dialogs/prompt.dart reported 1 hint:

line 24 col 3: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and dialog.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
build_runner ^1.6.2
build_web_compilers ^2.0.0