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,
                                  ),
                                ),
                              )
                          ),
                        )
                      ],
                    ),
                  );
                });
  • 相关阅读:
    小记面向对象
    公司分层思想的演化历程
    我对uml类图关系的理解
    cms真实问题的来源以及模拟解决方案
    HTTP 协议基础
    Requests库
    接口测试概念
    Python中的strip()函数的用法
    Robot Framework环境搭建
    Python unittest excel数据驱动
  • 原文地址:https://www.cnblogs.com/ssjf/p/12564656.html
Copyright © 2011-2022 走看看