joshuadeguzman/flutter_dialogs
💬 Android および iOS デバイス用のダイアログやアラートを表示するための軽量でプラットフォーム対応のプラグインです。
- Stars
- 14
- Forks
- 5
- 最終プッシュ(UTC)
- 2022/07/24
- プロジェクト状態
- 公開中
言語C++CMakeDartHTMLCSwiftShellRubyKotlinObjective-C
技術トピック
使用している依存関係
依存関係一覧 2 件
- flutter
{"sdk":"flutter"} - flutter_test開発用
{"sdk":"flutter"}
元の README
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
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: <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: (context) => 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: (context) => BasicDialogAlert(
title: Text("Select account"),
content: Container(
height: 200,
child: ListView(
children: <Widget>[
_buildListSampleItem("joshua@joshuamdeguzman.com"),
_buildListSampleItem("hello@gmail.com"),
_buildListSampleItem("joshua@flutter.ph"),
_buildListSampleItem("jdeguzman@freelancer.com"),
],
),
),
actions: <Widget>[
BasicDialogAction(
title: Text("Cancel"),
onPressed: () {
Navigator.pop(context);
},
),
],
),
);
Output
| iOS | Android |
|---|---|
| ios-basic-dialog-list | android-basic-dialog-list |
License
MIT @joshuadeguzman