mdialog 0.0.4

  • Installing
  • Versions
  • 41

Modal Dialog System

A minimalist modal dialog system.

alert confirm


This package contains a basic CSS skin (mdialog.css) and two themes (blue.css and dark.css). Load them from your web page:

  <link rel="stylesheet" href="packages/mdialog/css/mdialog.css">
  <link rel="stylesheet" href="packages/mdialog/css/themes/dark.css">


import 'package:mdialog/mdialog.dart';

main() async {
  await alert('We will proceed to format the Hard Disk');
  print('Ok, you\'ve been alerted');

  if (await confirm('Are you sure?')) {
    print('Formating Hard Disk ...');

Create custom dialogs

The library provides two classes to create custom modal dialogs: ModalWindow and ModalBlock. The following code creates a modal loading interface.

import 'dart:html';
import 'package:mdialog/mdialog.dart';

class ModalLoading {
  final _modalWindow = new ModalWindow();

  ModalLoading() {
    _modalWindow.add(new ModalBlock('header')..text = 'Loading request');
    _modalWindow.add(new ModalBlock('body')..text = 'Please wait ...');;

  void close() => _modalWindow.close();

main() async {
  final loading = new ModalLoading();

  try {
    await HttpRequest.getString('');
  } catch (e) {
    await alert('Error processing the request');
  } finally {

Features and bugs

Please file feature requests and bugs at the Issue Tracker.

Use this package as a library

1. Depend on it

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

  mdialog: "^0.0.4"

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:mdialog/mdialog.dart';
Version Uploaded Documentation Archive
0.0.4 Feb 28, 2017 Go to the documentation of mdialog 0.0.4 Download mdialog 0.0.4 archive
0.0.3 Feb 26, 2017 Go to the documentation of mdialog 0.0.3 Download mdialog 0.0.3 archive
0.0.2 Feb 12, 2017 Go to the documentation of mdialog 0.0.2 Download mdialog 0.0.2 archive
0.0.1 Feb 12, 2017 Go to the documentation of mdialog 0.0.1 Download mdialog 0.0.1 archive


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

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


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


Detected platforms: web

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


  • Maintain

    Changelog entries help clients to follow the progress in your code.

  • Package is getting outdated.

    The package was released 68 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.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • 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 mdialog.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
dart_sass_transformer >=0.5.0 <0.6.0 0.5.0+1
domelement >=1.0.0 <2.0.0 1.0.0
Transitive dependencies
args 1.4.3
async 2.0.7
barback 0.15.2+16
browser 0.10.0+3
charcode 1.1.1
collection 1.14.10
csslib 0.14.4
dart_to_js_script_rewriter 1.0.3
html 0.13.3+1
logging 0.11.3+1
path 1.6.1
pool 1.3.5
source_span 1.4.0
stack_trace 1.9.2
utf 0.9.0+4
Dev dependencies
test >=0.12.0 <0.13.0