第6章Cupertino风格组件-CupertinoAlertDialog对话框组件

防采集标记:亢少军老师的课程和资料

import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'CupertinoAlertDialog组件示例',
      home: Scaffold(
        appBar: AppBar(
          title: Text('CupertinoAlertDialog组件示例'),
        ),
        body: Center(
          child: CupertinoAlertDialog(
            title: Text('提示'), //对话框标题
            content: SingleChildScrollView(
              //对话框内容部分
              child: ListBody(
                children: [
                  Text('是否要删除?'),
                  Text('一旦删除数据不可恢复!'),
                ],
              ),
            ),
            actions: [
              CupertinoDialogAction(
                child: Text('确定'),
                onPressed: () {},
              ),
              CupertinoDialogAction(
                child: Text('取消'),
                onPressed: () {},
              ),
            ],
          ),
        ),
      ),
    );
  }
}

  • Flutter技术入门与实战: http://product.dangdang.com/26485813.html
  • Flutter交流学习群:894109159
  • Flutter开源项目请关注: https://github.com/kangshaojun
  • Flutter视频教程:https://edu.csdn.net/lecturer/2436

@作者: 亢少军

你可能感兴趣的:(第6章Cupertino风格组件-CupertinoAlertDialog对话框组件)