当前位置:网站首页>flutter 做底部的三个按键,有叠加,有填充
flutter 做底部的三个按键,有叠加,有填充
2022-07-30 23:13:00 【氤氲息】
//底部三个按键
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))
],
),
)),
],
),
);
}
边栏推荐
猜你喜欢

#yyds干货盘点# 面试必刷TOP101:判断链表中是否有环

Detailed operator

Kotlin特殊类

Ningbo Zhongning Pawn will transfer 29.5% of the equity for 2.8338 million yuan, and the owner's equity in 2021 will be 9.6875 million yuan

【LeetCode】42. 接雨水 - Go 语言题解

$\text{ARC 145}$

抽象类和接口(学习笔记)

可视化工具Netron介绍

Go1.18升级功能 - 模糊测试Fuzz 从零开始Go语言

IJCAI2022教程 | 口语语言理解:最新进展和新领域
随机推荐
IDEA使用技巧
A detailed explanation: SRv6 Policy model, calculation and drainage
"Wei cup" school more than 2022 cattle summer camp 4 Nancy (polocy) pelosi article variance law of Arts
Go1.18升级功能 - 模糊测试Fuzz 从零开始Go语言
软件测试三阶段,你在哪一步?
【飞控开发基础教程10】疯壳·开源编队无人机-PID 基础原理
leetcode 406. Queue Reconstruction by Height 根据身高重建队列(中等)
反转链表-头插反转法
Gxlcms audio novel system/novel listening system source code
Golang 切片删除指定元素的几种方法
2022牛客暑期多校训练营1 J Serval and Essay
科技的成就(三十一)
# # yyds dry goods inventory interview will brush TOP101: to determine whether there is a part of the list
Abstract classes and interfaces (study notes)
如何在 AWS 中应用 DevOps 方法?
HF2022-EzPHP复现
Go1.18升级功能 - 泛型 从零开始Go语言
Introducing the visualization tool Netron
可视化工具Netron介绍
PhpMetrics 使用