Show alert dialog or modal action sheet adaptively according to platform.
Convenient wrapper of showAlertDialog.
iOS | Android |
---|---|
Convenient wrapper of showAlertDialog.
iOS | Android |
---|---|
Show Confirmation Dialog. For Cupertino, fallback to ActionSheet.
iOS | Android |
---|---|
iOS | Android |
---|---|
iOS | Android |
---|---|
Show text input dialog until answer is correct or cancelled. This is useful for preventing very destructive action is executed mistakenly.
iOS | Android |
---|---|
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
],
);
}
}
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
),
),
);
}
}