modal_dialog 2.0.0

  • Installing
  • Versions
  • 42

Modal Dialog System

A Modal Dialog System based on the Bootstrap framework.


Edit your pubspec.yaml and add the library dependency:

  modal_dialog: <version number>

Gets the dependencies:

> pub get

Adds the Bootstrap's CSS link to your web page (see Getting started - Bootstrap):

<!DOCTYPE html>
    <link rel="stylesheet" href="" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    Alternatively you can use the minified CSS file provided by the Bootjack library:
    <link rel="stylesheet" href="packages/bootjack/css/bootstrap.min.css">

And finally import the library from the source code:

import 'package:modal_dialog/core.dart';

void main() {
  ModalDialog dialog = new ModalConfirm('Delete record', 'Are you sure?',
      accept: (ModalDialog dialog) {
    print('deleting record...');


  1. Creates a Modal Message with two buttons:
new ModalMessage('Delete record', 'Are you sure?')
  ..addButton('Accept', type: 'primary', action: (ModalDialog dialog) {
    print('Deleting record..');
  1. The previous example can be written easily by using the ModalConfirm class:
new ModalConfirm('Delete record', 'Are you sure?',
    accept: (ModalDialog dialog) {
  print('Deleting record..');


  1. Creates a Modal Alert message:
new ModalAlert('Error', 'An error has occurred');




  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

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

  modal_dialog: "^2.0.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

      import 'package:modal_dialog/modal_dialog.dart';
Version Uploaded Documentation Archive
2.0.0 Aug 6, 2016 Go to the documentation of modal_dialog 2.0.0 Download modal_dialog 2.0.0 archive
1.0.0 Aug 4, 2016 Go to the documentation of modal_dialog 1.0.0 Download modal_dialog 1.0.0 archive
0.0.1 Aug 3, 2016 Go to the documentation of modal_dialog 0.0.1 Download modal_dialog 0.0.1 archive


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

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3


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


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:modal_dialog/modal_dialog.dart.


  • Package is getting outdated.

    The package was released 96 weeks ago.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 18 hints.

    Run dartfmt to format lib/src/intl/locale/messages_ar_001.dart.

    Run dartfmt to format lib/src/intl/locale/messages_de_DE.dart.

    Similar analysis of the following files failed:

    • lib/src/intl/locale/messages_es_ES.dart (hint)
    • lib/src/intl/locale/messages_fr_FR.dart (hint)
    • lib/src/intl/locale/messages_it_IT.dart (hint)
    • lib/src/intl/locale/messages_ja_JP.dart (hint)
    • lib/src/intl/locale/messages_pt_PT.dart (hint)
    • lib/src/intl/locale/messages_ru_RU.dart (hint)
    • lib/src/intl/locale/messages_zh_Hans.dart (hint)
  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use modal_dialog.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
bootjack >=0.6.5+5 <1.0.0 0.6.8
browser >=0.10.0 <0.11.0 0.10.0+3
dart_to_js_script_rewriter >=1.0.1 <2.0.0 1.0.3
domelement >=0.1.0 <1.0.0 0.2.3 1.0.0
intl >=0.12.4 <1.0.0 0.15.6
Transitive dependencies
args 1.4.3
async 2.0.7
barback 0.15.2+16
charcode 1.1.1
collection 1.14.10
csslib 0.14.4
dquery 0.8.6
html 0.13.3+1
logging 0.11.3+1
matcher 0.12.2+1
meta 1.1.5
path 1.6.0
pool 1.3.5
quiver 0.29.0+1
source_span 1.4.0
stack_trace 1.9.2
utf 0.9.0+4