modal_dialog 2.0.0

  • Installing
  • Versions
  • 39

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

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


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


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


Detected platforms: Flutter, web, other

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


  • 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.

  • 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+2
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.2
Transitive dependencies
args 1.3.0
async 2.0.3
barback 0.15.2+14
charcode 1.1.1
collection 1.14.5
csslib 0.14.1
dquery 0.8.6
html 0.13.2+2
logging 0.11.3+1
matcher 0.12.1+4
meta 1.1.2
path 1.5.1
pool 1.3.4
quiver 0.28.0
source_span 1.4.0
stack_trace 1.9.1
utf 0.9.0+4