How to display iOS/cupertino alert dialog in Android using Flutter?

后端 未结 4 2229
野性不改
野性不改 2021-01-04 13:18

I was trying to display a iOS themed dialog box in my Flutter app, but I was unable to find anything in the docs

4条回答
  •  粉色の甜心
    2021-01-04 13:43

    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

    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: [
        CupertinoDialogAction(
          isDefaultAction: true,
          child: Text("Yes"),
        ),
        CupertinoDialogAction(
          child: Text("No"),
        )
      ],
    )
    

提交回复
热议问题