概要
プラットフォームに応じて、アラートダイアログまたはモーダルのアクションシートを表示します。
Web・アプリ開発計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- -1
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルadaptive_dialog
Show alert dialog or modal action sheet adaptively according to platform.
Web Demo: https://mono0926.com/adaptive_dialog/
showOkAlertDialog
Convenient wrapper of showAlertDialog.
| iOS | Android |
|---|---|
![]() |
![]() |
showOkCancelAlertDialog
Convenient wrapper of showAlertDialog.
| iOS | Android |
|---|---|
![]() |
![]() |
![]() |
![]() |
showConfirmationDialog
Show Confirmation Dialog. For Cupertino, fallback to ActionSheet.
| iOS | Android |
|---|---|
![]() |
![]() |
showModalActionSheet
| iOS | Android |
|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
showTextInputDialog
| iOS | Android |
|---|---|
![]() |
![]() |
![]() |
![]() |
showTextAnswerDialog
Show text input dialog until answer is correct or cancelled. This is useful for preventing very destructive action is executed mistakenly.
| iOS | Android |
|---|---|
![]() |
![]() |
FAQ
How can I customize it flexibly?
This packages keeps usage and UI simple like iOS official alert dialog. Therefore, if you need more flexibility than this package provides, I recommend that you build your own directly using standard APIs to meet your requirements without using this package.
- https://github.com/mono0926/adaptive_dialog/issues/19#issuecomment-754476937
- https://github.com/mono0926/adaptive_dialog/issues/76#issuecomment-1120686982
- https://github.com/mono0926/adaptive_dialog/issues/108#issuecomment-1543068734
The getter modalBarrierDismissLabel was called on null
adaptive_dialog uses Cupertino-style widgets internally on iOS, so GlobalCupertinoLocalizations.delegate is required under certain conditions.
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
class App extends StatelessWidget {
const App({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
//...
localizationsDelegates: const [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, // This is required
],
);
}
}
The input text color same with backgound when using CupertinoTextInputDialog
This fixes the problem.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart' hide Router;
class App extends StatelessWidget {
const App({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
darkTheme: ThemeData(
cupertinoOverrideTheme: const CupertinoThemeData(
textTheme: CupertinoTextThemeData(), // This is required
),
),
);
}
}
macOS style and Web / WASM compatibility
AdaptiveStyle.macOS utilizes macos_ui widgets on native macOS.
On Web platforms (both JavaScript and WASM), macos_ui is excluded to ensure Web and WASM compatibility, and dialogs configured with macOS style automatically fall back to Cupertino (iOS-style) dialogs.
関連プロジェクトを探す
読み込み中…



















