Skip to content

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

License

Notifications You must be signed in to change notification settings

erdemyerebasmaz/flutter_dialogs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Sample List

showPlatformDialog(
  context: context,
  builder: (_) => BasicDialogAlert(
    title: Text("Select account"),
    content: Container(
      height: 200,
      child: ListView(
        children: <Widget>[
          _buildListSampleItem("[email protected]"),
          _buildListSampleItem("[email protected]"),
          _buildListSampleItem("[email protected]"),
          _buildListSampleItem("[email protected]"),
        ],
      ),
    ),
    actions: <Widget>[
      BasicDialogAction(
        title: Text("Cancel"),
        onPressed: () {
          Navigator.pop(context);
        },
      ),
    ],
  ),
);

Output

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

License

MIT @joshuadeguzman

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 82.9%
  • Shell 6.4%
  • Ruby 6.1%
  • Swift 3.2%
  • Kotlin 1.1%
  • Objective-C 0.3%