flutter 弹出框,版本更新框自定义,弹出输入框

本文介绍了如何在 Flutter 应用中创建自定义提示框和版本更新框。通过新建组件 provide_widget.dart 实现弹出框功能,并展示了如何替换图片以适应版本更新的展示需求。
摘要由CSDN通过智能技术生成

1.自定义提示框
在这里插入图片描述

void _purchase(context, status) {
    showDialog(
        // 传入 context
        context: context,
        // 构建 Dialog 的视图
        builder: (_) => Container(
            padding: EdgeInsets.symmetric(
                horizontal: 40, vertical: ScreenUtil.screenHeight / 3),
            child: Stack(
              children: <Widget>[
                Positioned(
                  child: Container(
                    height: 167,
                    decoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.all(Radius.circular(5))),
                    child: Column(
                      children: <Widget>[
                        SizedBox(
                          height: 20,
                        ),
                        Text(
                          '${status == '1' ? '取消发布' : '是否重新发布'}',
                          style: TextStyle(
                              fontSize: 18,
                              fontWeight: FontWeight.bold,
                              color: Color(0XFF333333),
                              decoration: TextDecoration.none),
                        ),
                        SizedBox(
                          height: 20,
                        ),
                        status == '1'
                            ? Container(
                                padding: EdgeInsets.symmetric(horizontal: 21),
                                child: Text(
                                  '取消发布后,您的求购信息将不可见,您可以在取消后重新发布。 ',
                                  style: TextStyle(
                                      fontSize: 14,
                                      fontWeight: FontWeight.w500,
                                      color: Color(0XFF333333),
                                      decoration: TextDecoration.none),
                                ),
                              )
                            : Container(),
                        SizedBox(
                          height: 20,
                        ),
                        MdGaps.line,
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: <Widget>[
                            Expanded(
                              child: Container(
                                alignment: Alignment.center,
                                padding: EdgeInsets.symmetric(horizontal: 21),
                                child: Text(
                                  '关闭 ',
                                  style: TextStyle(
                                      fontSize: 18,
                                      fontWeight: FontWeight.w500,
                                      color: Color(0XFF333333),
                                      decoration: TextDecoration.none),
                                ),
                              ),
                            ),
                            Container(
                              color: Color(0XFFEEEEEE),
                              width: 2,
                              height: 36,
         
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值