1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3import 'package:go_router/go_router.dart';
5import '../theme/color_palette.dart';
10 const NavBar(this.navigationShell, {super.key, this.body});
16class _NavBarState
extends State<NavBar> with TickerProviderStateMixin {
38 (index) => AnimationController(
39 duration:
const Duration(milliseconds: 50),
45 return Tween<double>(begin: 1.0, end: 0.85).animate(
48 curve: Curves.easeInOut,
70 bool shouldResetToInitialLocation = index == widget.navigationShell.currentIndex;
72 shouldResetToInitialLocation =
false;
75 widget.navigationShell.goBranch(
77 initialLocation: shouldResetToInitialLocation,
82 Widget
build(BuildContext context) {
85 body: widget.navigationShell,
86 bottomNavigationBar: Container(
87 decoration: BoxDecoration(
91 color: Colors.black.withValues(alpha:0.04),
93 offset:
const Offset(0, -4),
96 color: Colors.black.withValues(alpha:0.02),
98 offset:
const Offset(0, -2),
105 padding: EdgeInsets.symmetric(horizontal: 8.sp),
107 mainAxisAlignment: MainAxisAlignment.spaceAround,
108 children: List.generate(
121 bool isCenter = index == 2;
124 return GestureDetector(
131 child: ScaleTransition(
136 mainAxisSize: MainAxisSize.min,
139 duration:
const Duration(milliseconds: 50),
140 curve: Curves.easeInOut,
143 decoration: BoxDecoration(
155 begin: Alignment.topLeft,
156 end: Alignment.bottomRight,
162 shape: BoxShape.circle,
168 offset:
const Offset(0, 2),
195 NavItem({required this.icon, required this.label});
override void initState()
class App extends StatefulWidget build(BuildContext context)
NavItem({required this.icon, required this.label})
void _initializeAnimations()
late List< Animation< double > > _scaleAnimations
class NavBar extends StatefulWidget _selectedIndex
final List< NavItem > _navItems
void _handleTap(int index) async
late List< AnimationController > _animationControllers
Widget _buildNavItem(int index)
class UnloadingCollectionItem extends StatefulWidget isSelected
style SizedBox(height:2.h)
style Column(crossAxisAlignment:CrossAxisAlignment.end, children:[Container(padding:EdgeInsets.symmetric(horizontal:8.w, vertical:4.h), decoration:BoxDecoration(color:ColorPalette.tiffanyBlue.withValues(alpha:0.1), borderRadius:BorderRadius.circular(12),), child:Text(collection.type ?? '', style:Theme.of(context).textTheme.bodySmall?.copyWith(color:ColorPalette.tiffanyBlue, fontWeight:FontWeight.bold,),),),],)