dialog 0.7.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 78

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~:

dialogs/alert.dart

Replaces default alert dialog.

querySelector("#alertButton").onClick.listen((_) {
  alert("Alerted?!");
});

Image of alert

dialogs/confirm.dart

Replaces default confirm dialog.

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

Image of confirm

dialogs/prompt.dart

Adds missing prompt dialog.

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

Image of prompt

dialogs/modal.dart

Adds fully customizable modal dialog.

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

Image of modal

dialog.dart

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.

License

The BSD 2-Clause License

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:


dependencies:
  dialog: ^0.7.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support 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';
  
Version Uploaded Documentation Archive
0.7.0 Oct 5, 2018 Go to the documentation of dialog 0.7.0 Download dialog 0.7.0 archive
0.6.2 Oct 5, 2018 Go to the documentation of dialog 0.6.2 Download dialog 0.6.2 archive
0.6.1 Oct 5, 2018 Go to the documentation of dialog 0.6.1 Download dialog 0.6.1 archive
0.6.0 Oct 3, 2018 Go to the documentation of dialog 0.6.0 Download dialog 0.6.0 archive
0.5.0 Jul 24, 2015 Go to the documentation of dialog 0.5.0 Download dialog 0.5.0 archive
0.4.1+1 Jul 24, 2015 Go to the documentation of dialog 0.4.1+1 Download dialog 0.4.1+1 archive
0.4.1 Jul 24, 2015 Go to the documentation of dialog 0.4.1 Download dialog 0.4.1 archive
0.4.0+2 Jul 23, 2015 Go to the documentation of dialog 0.4.0+2 Download dialog 0.4.0+2 archive
0.4.0+1 May 10, 2015 Go to the documentation of dialog 0.4.0+1 Download dialog 0.4.0+1 archive
0.4.0 May 10, 2015 Go to the documentation of dialog 0.4.0 Download dialog 0.4.0 archive

All 18 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
56
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
78
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: web

Primary library: package:dialog/dialog.dart with components: html.

Maintenance suggestions

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use dialog.dart.

Dependencies

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