如何使用Flutter在Android中显示iOS / cupertino警报对话框? [英] How to display iOS/cupertino alert dialog in Android using Flutter?
问题描述
我试图在Flutter应用中显示一个iOS主题对话框,但我无法在文档中找到任何内容
I was trying to display a iOS themed dialog box in my Flutter app, but I was unable to find anything in the docs
推荐答案
Android主题/样式的关键字为材料(默认设计),iOS主题/样式的关键字为 Cupertino 。每个iOS主题小部件都有前缀 Cupertino 。因此,根据您的要求,我们可以猜测关键字为 CupertinoDialog / CupertinoAlertDialog
The keyword for Android theme/style is Material (default design), the keyword for iOS theme/style is Cupertino. Every iOS theme widget has the prefix Cupertino. So that, for you requirement, we can guess the keyword is CupertinoDialog/CupertinoAlertDialog
您可以在此处引用全部 https://flutter.io/docs/reference/widgets/cupertino
You can refer here for all of them https://flutter.io/docs/reference/widgets/cupertino
new CupertinoAlertDialog(
title: new Text("Dialog Title"),
content: new Text("This is my content"),
actions: <Widget>[
CupertinoDialogAction(
isDefaultAction: true,
child: Text("Yes"),
),
CupertinoDialogAction(
child: Text("No"),
)
],
)
这篇关于如何使用Flutter在Android中显示iOS / cupertino警报对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!