smart_dialogs 2.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 80

Smart Dialogs for Web Apps #

What the package can do for you #

  • You want to show an alert message?
  • You want to let something confirm?
  • You want to show a dialog with several action buttons to offer a choice?
  • You want to request input from a user, e.g. via text entry fields, combo boxes, radio or check buttons?
  • You want to have all this with a consistent default style?
  • You want to configure the style yourself?
  • You want to open the operating system's file selection dialog?
  • You want to display a panel containing clickable icons to start actions?
  • You want to show popup menus with clickable menu items?
  • You want to show a fine table displaying table data for your users?
  • You want to show such a table, but also with interactive input elements (buttons, text entry fields)?
  • And you want to program this with a few lines of code, compatible with Chrome(Windows/Linux/Android), Safari (Mac/IOS), and MS Edge, without importing extra packages, just based on standard Dart packages, especially on 'Dart.html'.?
  • You are looking for simple code examples to start with?

Then your are exactly right here. The focus of this package is the ease-of-use of the provided functionalities.

Display the examples #

  • Click here to view the examples: smart_dialog examples

  • Or, download and unpack the package, then execute the file example/example.html in your browser.


For convenience and ease-of-use, employ the following asynchronous functions (see API for details).

  • or Info.showGo(..)- display a message.
  • Info.confirm(..) - confirm a message (optionally with multiple confirm buttons).
  • Info.get(..) - display a dialog an return the user's input from the text entry fields, combo boxes, radio or check buttons.
  • Info.get2D(..) - similar to Info.get(), however the displayed dialog provides two columns of text entry fields, combo boxes, etc..

These methods display a dialog and return a Future of type UserInput, containing everything the user entered into the dialog, including which buttons were pressed.

For additional flexibility, dialogs can be opened by using their respective constructors. Modal (blocking) and non-modal dialogs are supported. Constructors require a callback function invoked when a button is pressed.

A special dialog provides access to the operating system's file selection dialog:

  • FileSelectionDialog(..) (the constructor)

Table, Icon Panel, Popup Menu

This package provides the following GUI elements in addition to dialogs :

  • BasicTable - display table data, and provide access to the data a user entered into the optional interactive elements of the table. A table must be embedded into a parent html element for display, e.g. into a dialog (demonstrated by the examples of this package), a user provided div, etc.
  • IconPanel - a rectangular grid of icons acting as buttons with assigned action functions,
  • PopupMenu - a popup menu with a list of menu items, acting as buttons with assigned action functions.

Style configuration

The classes DiaAttr and TableAttr contain style attribute names and their defaults for various screen sizes (PC, Tablet, Phone) and attribute setter methods for Dialogs and Tables, respectively. See also the example source files where style changes are demonstrated.

smart_arrays_base: Basic functions for 1D and 2D arrays

smart_arrays_numerics: Numerics with 1D and 2D arrays

smart_arrays_compress: Compress 1D and 2D arrays to a smaller size.

smart_arrays_sample_data: Computes 1D and 2D arrays containing sample data.

smart_arrays_dbstore: Store 1D and 2D arrays along with metadata on the local device.

smart_arrays_peaks: Detect peaks in 1D and 2D arrays.

smart_arrays_contour_finder: Contours the three-dimensional surface represented by the values f(x,y) of a matrix.

smart_arrays_plot_polyline: Plots 1D arrays as polyline along with axes and more.

smart_arrays_lmfit: Fits (x, y) data given as arrays to a specified model function using the Levenberg-Marquardt algorithm.

smart_lorentz_gauss: Compute Lorentz-Gauss (pseudo-Voigt) line shapes.

smart_signal_processing: Fourier transform and more of arrays.

smart_dialogs: Easy-to-use dialogs in Web applications

Smart Dialogs for Web Apps #

Version history #

2.1.2 - 2019-10-10 MadeInfo.showGo static.

2.1.1 - 2019-10-10 Added method Info.showGo.

2.1.0 - 2019-10-05 Now sdk 2.5.0 in pubspec.

2.0.0 - 2019-03-04 First version available on pub site.

2.0.1 - 2019-03-05 Fixed some code health issues.

2.0.2 - 2019-03-05 Fixed link to executable example.

2.0.3 - 2019-03-06 Fixed bug when clicking into opened combo box.

2.0.4 - 2019-03-07 Now uses the analysis_options.yaml file of the pedantic Dart package for code checking.

2.0.5 - 2019-03-10 Simplified example.

2.0.6 - 2019-03-24 Updated docs.

2.0.7 - 2019-04-04 Updated docs.

2.0.8 - 2019-04-09 Fixed issue with dialogs containing combo box

2.0.9 - 2019-04-23 [TableAttr.attr] is now initialized with defaults, no longer null initially.

2.0.10 - 2019-04-27 Improved documentation.

2.0.11 - 2019-05-06 Updated docs.

2.0.12 - 2019-07-11 Updated docs.

2.0.13 - 2019-08-01 Fixed health suggestions of

2.0.14 - 2019-08-01 More fixes according to health suggestions of

2.0.15 - 2019-08-04 Using package:pedantic/analysis_options.yaml from now on.


// Copyright (c) 2019, Dr. Bruno Guigas. All rights reserved. Use of this source
// code is governed by a BSD-style license that can be found in the LICENSE file.
// To execute this example, visit the following page:

import 'package:smart_dialogs/smart_dialogs.dart';

import 'dart:html';
import 'src/examples.dart';

main() {

/// Displays a dialog to select and execute examples
class ExampleDispatcher {
  static List<String> itemsChecked;
  static DivElement app_div;

  List<String> items = [
    "Info Dialog",
    "Confirm Dialog",
    "Single-Line Input Dialog",
    "Multi-Line Input Dialog",
    "Advanced Input Dialog with Check Buttons",
    "Advanced Input Dialog with Radio Buttons",
    "Advanced Input Dialog with Radio Buttons, 2D",
    "Non-Modal Dialog",
    "System's File Selection Dialog",
    "Change Dialog Attributes",
    "Icon Panel",
    "Popup Menu",
    "Simple Table",
    "Interactive Table"

  List<Function> itemsFuncs = [

  ExampleDispatcher() {

  /// Shows the example options and displays the selected dialog example
  void showDialogExamples() async {
    app_div = (querySelector("#app_div") as DivElement);
    if (itemsChecked == null) {
      itemsChecked = List<String>.filled(items.length, DiaUtils.FALSE);
      itemsChecked[0] = DiaUtils.TRUE;

    UserInput uin = await Info.get(
        "Examples for the Dart package <i>smart_dialogs</i>." +
            "<br>Please select an example and press OK",
        List.filled(items.length, null),
        List<int>.filled(items.length, 0),

    if (uin.buttonCode == DiaAttr.DIA_ACT_OK) {
      itemsChecked = List<String>.filled(itemsChecked.length, DiaUtils.FALSE);
      for (int i = 0; i < items.length; i++) {
        if (uin.getCheckedState(i) == DiaUtils.TRUE) {
          itemsChecked[i] = DiaUtils.TRUE;
          await itemsFuncs[i](); // execute selected example

Use this package as a library

1. Depend on it

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

  smart_dialogs: ^2.1.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:smart_dialogs/smart_dialogs.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
build_runner ^1.6.2 1.8.1
build_web_compilers ^2.0.0 2.9.0 2.10.0
pedantic ^1.7.0 1.9.0
Transitive dependencies
_fe_analyzer_shared 1.0.3
analyzer 0.39.4
archive 2.0.13
args 1.6.0
async 2.4.1
bazel_worker 0.1.23+1
build 1.2.2
build_config 0.4.2
build_daemon 2.1.4
build_modules 2.8.1 2.9.0
build_resolvers 1.3.3
build_runner_core 5.0.0
built_collection 4.3.2
built_value 7.0.9
charcode 1.1.3
checked_yaml 1.0.2
code_builder 3.2.1
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.3.3
fixnum 0.10.11
glob 1.2.0
graphs 0.2.0
html 0.14.0+3
http 0.12.0+4
http_multi_server 2.2.0
http_parser 3.1.4
io 0.3.3
js 0.6.1+1
json_annotation 3.0.1
logging 0.11.4
matcher 0.12.6
meta 1.1.8
mime 0.9.6+3
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.9.3
package_resolver 1.0.10
path 1.6.4
pool 1.4.0
protobuf 1.0.1
pub_semver 1.4.4
pubspec_parse 0.1.5
quiver 2.1.3
scratch_space 0.0.4+2
shelf 0.7.5
shelf_web_socket 0.2.3
source_maps 0.10.9
source_span 1.7.0
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 1.2.0
string_scanner 1.0.5
term_glyph 1.1.0
timing 0.1.1+2
typed_data 1.1.6
watcher 0.9.7+14
web_socket_channel 1.1.0
yaml 2.2.0