| } | } | ||||
| class _HomeDrawerState extends State<HomeDrawer> { | class _HomeDrawerState extends State<HomeDrawer> { | ||||
| var currentDrawerIndex = DrawerIndex.Home; | |||||
| var pref = LocalPref(); | var pref = LocalPref(); | ||||
| UserRepository _userRepository = UserRepository(); | UserRepository _userRepository = UserRepository(); | ||||
| List<DrawerList> drawerList; | List<DrawerList> drawerList; | ||||
| color: Colors.black, | color: Colors.black, | ||||
| ), | ), | ||||
| onTap: () { | onTap: () { | ||||
| navigationtoScreen(currentDrawerIndex); | |||||
| Navigator.of(context).push( | Navigator.of(context).push( | ||||
| MaterialPageRoute(builder: (_) => NotificationScreen())); | MaterialPageRoute(builder: (_) => NotificationScreen())); | ||||
| }, | }, | ||||
| color: Colors.black, | color: Colors.black, | ||||
| ), | ), | ||||
| onTap: () { | onTap: () { | ||||
| navigationtoScreen(currentDrawerIndex); | |||||
| Navigator.of(context).push( | Navigator.of(context).push( | ||||
| MaterialPageRoute(builder: (_) => UpdateProfileScreen())); | MaterialPageRoute(builder: (_) => UpdateProfileScreen())); | ||||
| }, | }, | ||||
| splashColor: Colors.grey.withOpacity(0.1), | splashColor: Colors.grey.withOpacity(0.1), | ||||
| highlightColor: Colors.transparent, | highlightColor: Colors.transparent, | ||||
| onTap: () { | onTap: () { | ||||
| currentDrawerIndex = listData.index; | |||||
| navigationtoScreen(listData.index); | navigationtoScreen(listData.index); | ||||
| }, | }, | ||||
| child: Stack( | child: Stack( | ||||
| width: 24, | width: 24, | ||||
| height: 24, | height: 24, | ||||
| child: Image.asset(listData.imageName, | child: Image.asset(listData.imageName, | ||||
| color: widget.screenIndex == listData.index | |||||
| color: currentDrawerIndex == listData.index | |||||
| ? COLOR_CONST.DEFAULT | ? COLOR_CONST.DEFAULT | ||||
| : COLOR_CONST.BLACK), | : COLOR_CONST.BLACK), | ||||
| ) | ) |