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