https://github.com/joshuadeguzman/flutter_dialogs
💬 A lightweight and platform-aware plugin for showing dialogs and alerts for both Android and iOS devices.
https://github.com/joshuadeguzman/flutter_dialogs
alerts android dart dialogs flutter hacktoberfest ios sdk
Last synced: 9 months ago
JSON representation
💬 A lightweight and platform-aware plugin for showing dialogs and alerts for both Android and iOS devices.
- Host: GitHub
- URL: https://github.com/joshuadeguzman/flutter_dialogs
- Owner: joshuadeguzman
- License: bsd-3-clause
- Created: 2019-10-04T09:44:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-24T22:36:47.000Z (over 3 years ago)
- Last Synced: 2025-04-04T08:07:50.478Z (9 months ago)
- Topics: alerts, android, dart, dialogs, flutter, hacktoberfest, ios, sdk
- Language: C++
- Homepage: https://pub.dev/packages/flutter_dialogs
- Size: 342 KB
- Stars: 14
- Watchers: 3
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_dialogs
A lightweight and platform-aware plugin for showing dialogs and alerts for both Android and iOS devices. Supports null-safety and Flutter 2.0.
## Features
- Platform aware
- Extendable widgets
- Lightweight < 28 KB
## Usage
Sample Alert
```
showPlatformDialog(
context: context,
builder: (context) => BasicDialogAlert(
title: Text("Current Location Not Available"),
content:
Text("Your current location cannot be determined at this time."),
actions: [
BasicDialogAction(
title: Text("OK"),
onPressed: () {
Navigator.pop(context);
},
),
],
),
);
```
Output
|iOS|Android|
|---|---|
|||
Sample Confirmation
```
showPlatformDialog(
context: context,
builder: (context) => BasicDialogAlert(
title: Text("Discard draft?"),
content: Text("Action cannot be undone."),
actions: [
BasicDialogAction(
title: Text("Cancel"),
onPressed: () {
Navigator.pop(context);
},
),
BasicDialogAction(
title: Text("Discard"),
onPressed: () {
Navigator.pop(context);
},
),
],
),
);
```
Output
|iOS|Android|
|---|---|
|||
Sample List
```
showPlatformDialog(
context: context,
builder: (context) => BasicDialogAlert(
title: Text("Select account"),
content: Container(
height: 200,
child: ListView(
children: [
_buildListSampleItem("joshua@joshuamdeguzman.com"),
_buildListSampleItem("hello@gmail.com"),
_buildListSampleItem("joshua@flutter.ph"),
_buildListSampleItem("jdeguzman@freelancer.com"),
],
),
),
actions: [
BasicDialogAction(
title: Text("Cancel"),
onPressed: () {
Navigator.pop(context);
},
),
],
),
);
```
Output
|iOS|Android|
|---|---|
|||
## License
MIT [@joshuadeguzman](https://github.com/joshuadeguzman/flutter-dialogs/blob/master/LICENSE)