• 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,
                                  ),
                                ),
                              )
                          ),
                        )
                      ],
                    ),
                  );
                });
  • 相关阅读:
    luogu 1865 数论 线性素数筛法
    洛谷 2921 记忆化搜索 tarjan 基环外向树
    洛谷 1052 dp 状态压缩
    洛谷 1156 dp
    洛谷 1063 dp 区间dp
    洛谷 2409 dp 月赛题目
    洛谷1199 简单博弈 贪心
    洛谷1417 烹调方案 dp 贪心
    洛谷1387 二维dp 不是特别简略的题解 智商题
    2016 10 28考试 dp 乱搞 树状数组
  • 原文地址:https://www.cnblogs.com/ssjf/p/12564656.html
Copyright © 2020-2023  润新知