zoukankan      html  css  js  c++  java
  • Flutter-仿ios底部彈出框

    小筆記~模仿得有點醜的ios底部彈出框

    showModalBottomSheet(
                backgroundColor: Colors.transparent,
                context: context,
                builder: (BuildContext context) {
                  return Container(
                    padding: EdgeInsets.all(10),
                    height: 200,
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: <Widget>[
                        Container(
                             width-20,
                            height: 50,
                            decoration: BoxDecoration(
                              color: Color(0Xffececec),
                              borderRadius:BorderRadius.circular(15.0),//邊框
                            ),
                            child: Center(
                              child: Text(
                                '是否要訂閱《${servicePrice.title}》?',
                                overflow: TextOverflow.ellipsis,
                                style: TextStyle(
                                  color: Colors.black,
                                  fontWeight: FontWeight.bold,
                                  fontSize: 20,
                                ),
                              ),
                            )
                        ),
                        GestureDetector(
                          onTap: (){
                            setState(() {
                             
                            });
                          },
                          child: Container(
                              margin: EdgeInsets.only(top:10),
                               width-20,
                              height: 50,
                              decoration: BoxDecoration(
                                color: Color(0Xffececec),
                                borderRadius:BorderRadius.circular(15.0),//邊框
                              ),
                              child: Center(
                                child: Text(
                                  '確 認',
                                  style: TextStyle(
                                    color: Color(0Xff4d80c5),
                                    fontWeight: FontWeight.bold,
                                    fontSize: 20,
                                  ),
                                ),
                              )
                          ),
                        ),
                        GestureDetector(
                          onTap: ()=>Navigator.of(context).pop(),
                          child: Container(
                              margin: EdgeInsets.only(top:10),
                               width-20,
                              height: 50,
                              decoration: BoxDecoration(
                                color: Color(0Xffececec),
                                borderRadius:BorderRadius.circular(15.0),//邊框
                              ),
                              child: Center(
                                child: Text(
                                  '取 消',
                                  style: TextStyle(
                                    color: Colors.red,
                                    fontWeight: FontWeight.bold,
                                    fontSize: 20,
                                  ),
                                ),
                              )
                          ),
                        )
                      ],
                    ),
                  );
                });
  • 相关阅读:
    APUE学习笔记:第四章 文件和目录
    APUE学习笔记:第三章 文件I/O
    APUE学习笔记:第二章 UNIX标准化及实现
    APUE学习笔记:第一章 UNUX基础知识
    《数据库系统概念》学习笔记2
    go语言下载地址
    Centos7 编译 android4.4
    剑侠情缘新进展
    ubuntu server 14.04手动安装svn
    ubuntu server 14.04 lts显示乱码的问题
  • 原文地址:https://www.cnblogs.com/ssjf/p/12564656.html
Copyright © 2011-2022 走看看