Skip to content
💬 A lightweight and platform-aware plugin for showing dialogs and alerts for both Android and iOS devices.
Dart Ruby Shell Swift Kotlin Objective-C
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.
.github
example
lib
.gitignore
.metadata
CHANGELOG.md
LICENSE
README.md
pubspec.lock
pubspec.yaml

README.md

flutter_dialogs

A lightweight and platform-aware plugin for showing dialogs and alerts for both Android and iOS devices.

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

iOS Android
android-basic-dialog-alert ios-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

iOS Android
android-basic-dialog-confirmation ios-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

iOS Android
android-basic-dialog-list ios-basic-dialog-list

License

MIT @joshuadeguzman

You can’t perform that action at this time.