diff --git a/packages/core/lib/presentation/widget/bottom_navigation/wave_bottom_navigation.dart b/packages/core/lib/presentation/widget/bottom_navigation/wave_bottom_navigation.dart index 95b808f..ddcc71f 100644 --- a/packages/core/lib/presentation/widget/bottom_navigation/wave_bottom_navigation.dart +++ b/packages/core/lib/presentation/widget/bottom_navigation/wave_bottom_navigation.dart @@ -83,47 +83,56 @@ class _WaveBottomNavigationState extends State { 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), + ), + ),*/ + ], + ), ), - ), - ); - }, + ); + }, + ), ), ); },