feat : on Tap BottomSheet

This commit is contained in:
2025-05-04 08:44:39 +03:30
parent 5770116def
commit 2ba786b556

View File

@@ -83,47 +83,56 @@ class _WaveBottomNavigationState extends State<WaveBottomNavigation> {
physics: const ClampingScrollPhysics(),
itemBuilder: (context, index) {
final WaveBottomNavigationItem item = widget.items[index];
return Center(
child: AnimatedBuilder(
animation: _controller,
builder: (context, child) {
double value = 0.0;
final scale = _calculateScale(_controller.page ?? 0, index);
value = index - (_controller.page ?? 0);
value = (value).clamp(-1, 1);
double offset = value * 30;
if (value.abs() < 0.2 || value.abs() > 0.2) {
offset = -7 * (1 - value.abs() * 2);
}
return GestureDetector(
onTap: () {
_controller.animateToPage(
index,
duration: Duration(milliseconds: 500),
curve: Curves.easeInOut,
);
},
child: Center(
child: AnimatedBuilder(
animation: _controller,
builder: (context, child) {
double value = 0.0;
final scale = _calculateScale(_controller.page ?? 0, index);
value = index - (_controller.page ?? 0);
value = (value).clamp(-1, 1);
double offset = value * 30;
if (value.abs() < 0.2 || value.abs() > 0.2) {
offset = -7 * (1 - value.abs() * 2);
}
return Transform.scale(
scale: scale,
child: Transform.translate(
offset: Offset(0, offset),
child: Column(
children: [
Tooltip(
message: item.title,
child: vecWidget(
item.icon,
color: Colors.white,
width: 32,
height: 32,
return Transform.scale(
scale: scale,
child: Transform.translate(
offset: Offset(0, offset),
child: Column(
children: [
Tooltip(
message: item.title,
child: vecWidget(
item.icon,
color: Colors.white,
width: 32,
height: 32,
),
),
),
/* Visibility(
visible: (_controller.page ?? 0) == index,
child: Text(
item.title,
style: AppFonts.yekan10.copyWith(color: Colors.white),
),
),*/
],
/* Visibility(
visible: (_controller.page ?? 0) == index,
child: Text(
item.title,
style: AppFonts.yekan10.copyWith(color: Colors.white),
),
),*/
],
),
),
),
);
},
);
},
),
),
);
},