flutter 做底部的三个按键,有叠加,有填充

//底部三个按键
  Widget addBottomSection() {
    return Container(
      margin: const EdgeInsets.only(bottom: 24, left: 16, right: 16),
      child: Row(
        children: [
          Expanded(
              child: Container(
            alignment: Alignment.center,//这个很重要
            child: Stack(
              clipBehavior: Clip.none,
              alignment: Alignment.topRight,
              children: [
                GestureDetector(
                  onTap: () {
                    Future.delayed(const Duration(seconds: 1), () {
                      if (_isCanDrag) {
                        getBottleSetting();
                      }
                    });
                    setState(() {
                      _isDragAnimation = true;
                    });
                    dragPlay();
                  },
                  child: Stack(
                    clipBehavior: Clip.none,
                    alignment: Alignment.bottomCenter,
                    children: [
                      Container(
                        height: 102,
                        width: 102,
                        decoration: const BoxDecoration(
                          image: DecorationImage(
                            image:
                                AssetImage('assets/images/bg_drift_drag.png'),
                            fit: BoxFit.fill, // 完全填充
                          ),
                        ),
                      ),
                      Positioned(
                        left: 10,
                        child: Container(
                          margin: const EdgeInsets.only(bottom: 20),
                          child: const Image(
                              image: AssetImage(
                                  'assets/images/icon_drift_net.png'),
                              width: 100,
                              fit: BoxFit.fitWidth),
                        ),
                      ),
                      Container(
                          padding: const EdgeInsets.only(bottom: 10),
                          child: Text(
                            S.current.bottle_grab,
                            style: const TextStyle(
                                fontSize: 14,
                                color: Color(0xFFFFF5F1),
                                decoration: TextDecoration.none),
                          )),
                    ],
                  ),
                ),
                Positioned(
                    right: -5, child: showMessageNumView(remainFishTimes))
              ],
            ),
          )),
          Expanded(
              child: Container(
            alignment: Alignment.center,
            child: Stack(
              clipBehavior: Clip.none,
              alignment: Alignment.topRight,
              children: [
                GestureDetector(
                  onTap: () {
                    showThrowBottleDialog();
                  },
                  child: Stack(
                    clipBehavior: Clip.none,
                    alignment: Alignment.bottomCenter,
                    children: [
                      Container(
                        height: 102,
                        width: 102,
                        decoration: const BoxDecoration(
                          image: DecorationImage(
                            image:
                                AssetImage('assets/images/bg_drift_throw.png'),
                            fit: BoxFit.fill, // 完全填充
                          ),
                        ),
                      ),
                      Positioned(
                        left: 20,
                        child: Container(
                          margin: const EdgeInsets.only(bottom: 35),
                          child: const Image(
                              image:
                                  AssetImage('assets/images/icon_bottle.png'),
                              width: 64,
                              fit: BoxFit.fitWidth),
                        ),
                      ),
                      Container(
                          padding: const EdgeInsets.only(bottom: 10),
                          child: Text(
                            S.current.bottle_throw,
                            style: const TextStyle(
                                fontSize: 14,
                                color: const Color(0xFFFFF5F1),
                                decoration: TextDecoration.none),
                          )),
                    ],
                  ),
                ),
                Positioned(
                    right: -5, child: showMessageNumView(remainThrowTimes))
              ],
            ),
          )),
          Expanded(
              child: Container(
                alignment: Alignment.center,
            child: Stack(
              clipBehavior: Clip.none,
              alignment: Alignment.topRight,
              children: [
                GestureDetector(
                  onTap: () {
                    MyRouter.pushMy(context, const MyBottleNav())
                        .then((value) => getMessageNum());
                  },
                  child: Stack(
                    clipBehavior: Clip.none,
                    alignment: Alignment.bottomCenter,
                    children: [
                      Container(
                        height: 102,
                        width: 102,
                        decoration: const BoxDecoration(
                          image: DecorationImage(
                            image: AssetImage(
                                'assets/images/bg_drift_bottles.png'),
                            fit: BoxFit.fill, // 完全填充
                          ),
                        ),
                      ),
                      Positioned(
                        left: 10,
                        child: Container(
                          margin: const EdgeInsets.only(bottom: 35),
                          child: const Image(
                              image: AssetImage(
                                  'assets/images/icon_drift_bottles.png'),
                              width: 84,
                              fit: BoxFit.fitWidth),
                        ),
                      ),
                      Container(
                          padding: const EdgeInsets.only(bottom: 10),
                          child: Text(
                            S.current.bottle_my,
                            style: const TextStyle(
                                fontSize: 14,
                                color: Color(0xFFFFF5F1),
                                decoration: TextDecoration.none),
                          )),
                    ],
                  ),
                ),
                Positioned(right: -5, child: showMessageNumView(MesNum))
              ],
            ),
          )),
        ],
      ),
    );
  }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值