Skip to content
Modal Dialog System
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
locale
.analysis_options
.gitignore
CHANGELOG.md
LICENSE
README.md
pubspec.yaml

README.md

Modal Dialog System

A Modal Dialog System based on the Bootstrap framework.

Install

Edit your pubspec.yaml and add the library dependency:

dependencies:
  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>
<html>
<head>
</head>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" 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...');
    dialog.close();
  });
  dialog.open();
}

Examples

  1. Creates a Modal Message with two buttons:
new ModalMessage('Delete record', 'Are you sure?')
  ..addButton('Cancel')
  ..addButton('Accept', type: 'primary', action: (ModalDialog dialog) {
    print('Deleting record..');
    dialog.close();
  })
  ..open();
  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..');
  dialog.close();
})..open();

modal_confirm

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

modal_alert

You can’t perform that action at this time.