zoukankan      html  css  js  c++  java
  • CupertinoAlertDialog

    由于CupertinoDialog已经被标记为过时的Widget,这里就只介绍CupertinoAlertDialog的用法。

    showDialog( //通过showDialog方法展示alert弹框
      context: context,
      builder: (context) {
        return CupertinoAlertDialog(
          title: Text('提示'), //弹框标题
          content: Text('是否想放弃学习Flutter'), //弹框内容
          actions: <Widget>[ //操作控件
            CupertinoDialogAction(
              onPressed: () { //控件点击监听
                print("我不会放弃的");
                Navigator.pop(context);
              },
              textStyle: TextStyle(fontSize: 18, color: Colors.blueAccent), //按钮上的文本风格
              child: Text('取消'), //控件显示内容
            ),
            CupertinoDialogAction(
              onPressed: () {
                print("我投降");
                Navigator.pop(context);
              },
              textStyle: TextStyle(fontSize: 18, color: Colors.grey),
              child: Text('确定'),
            ),
          ],
        );
      },
    );
  • 相关阅读:
    16-面向对象之语法(1)
    4-编辑器IDE_for_python
    3-python入门学习路线
    2-学习方法心得
    1-语法基础
    NSMutableArray基本概念
    NSArray 与字符串
    NSArray文件读写
    NSArray排序
    NSArray 遍历
  • 原文地址:https://www.cnblogs.com/timba1322/p/12487030.html
Copyright © 2011-2022 走看看