flutter_dialogs 1.0.1

Flutter Android iOS

Platform aware dialog and alert widgets.

flutter_dialogs #

Platform aware dialog and alert widgets.

Features #

  • Platform aware
  • Extendable widgets
  • Lightweight < 28 KB

Usage #

Sample Alert

showPlatformDialog(
  context: context,
  builder: (_) => BasicDialogAlert(
    title: Text("Current Location Not Available"),
    content:
        Text("Your current location cannot be determined at this time."),
    actions: <Widget>[
      BasicDialogAction(
        title: Text("OK"),
        onPressed: () {
          Navigator.pop(context);
        },
      ),
    ],
  ),
);

Output

AndroidiOS
android-basic-dialog-alertios-basic-dialog-alert

Sample Confirmation

showPlatformDialog(
  context: context,
  builder: (_) => BasicDialogAlert(
    title: Text("Discard draft?"),
    content: Text("Action cannot be undone."),
    actions: <Widget>[
      BasicDialogAction(
        title: Text("Cancel"),
        onPressed: () {
          Navigator.pop(context);
        },
      ),
      BasicDialogAction(
        title: Text("Discard"),
        onPressed: () {
          Navigator.pop(context);
        },
      ),
    ],
  ),
);

Output

AndroidiOS
android-basic-dialog-confirmationios-basic-dialog-confirmation

Sample List

showPlatformDialog(
  context: context,
  builder: (_) => BasicDialogAlert(
    title: Text("Select account"),
    content: Container(
      height: 200,
      child: ListView(
        children: <Widget>[
          _buildListSampleItem("contact@jdg.ph"),
          _buildListSampleItem("hello@gmail.com"),
          _buildListSampleItem("hi@joshuadeguzman.net"),
          _buildListSampleItem("jdeguzman@freelancer.com"),
        ],
      ),
    ),
    actions: <Widget>[
      BasicDialogAction(
        title: Text("Cancel"),
        onPressed: () {
          Navigator.pop(context);
        },
      ),
    ],
  ),
);

Output

AndroidiOS
android-basic-dialog-listios-basic-dialog-list

License #

MIT @joshuadeguzman

9
likes
70
pub points
87%
popularity

Publisher

joshuadeguzman.net

Platform aware dialog and alert widgets.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_dialogs