//底部三个按键
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))
],
),
)),
],
),
);
}
flutter 做底部的三个按键,有叠加,有填充
最新推荐文章于 2024-05-07 14:22:16 发布