modal_dialog 2.0.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 34

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

Changelog

0.0.1

  • Initial version, created by Stagehand

1. Depend on it

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


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

Analysis

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

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

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

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

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

Dependencies

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.2
async 2.0.6
barback 0.15.2+15
charcode 1.1.1
collection 1.14.9
csslib 0.14.1
dquery 0.8.6
html 0.13.3
logging 0.11.3+1
matcher 0.12.2
meta 1.1.2
path 1.5.1
pool 1.3.4
quiver 0.29.0+1
source_span 1.4.0
stack_trace 1.9.2
utf 0.9.0+4