|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | +import 'package:flutter_svg/flutter_svg.dart'; |
| 3 | +import 'package:shop_app/screens/home/home_screen.dart'; |
| 4 | +import 'package:shop_app/screens/profile/profile_screen.dart'; |
| 5 | + |
| 6 | +import '../constants.dart'; |
| 7 | +import '../enums.dart'; |
| 8 | + |
| 9 | +class CustomBottomNavBar extends StatelessWidget { |
| 10 | + const CustomBottomNavBar({ |
| 11 | + Key key, |
| 12 | + @required this.selectedMenu, |
| 13 | + }) : super(key: key); |
| 14 | + |
| 15 | + final MenuState selectedMenu; |
| 16 | + |
| 17 | + @override |
| 18 | + Widget build(BuildContext context) { |
| 19 | + final Color inActiveIconColor = Color(0xFFB6B6B6); |
| 20 | + return Container( |
| 21 | + padding: EdgeInsets.symmetric(vertical: 14), |
| 22 | + decoration: BoxDecoration( |
| 23 | + color: Colors.white, |
| 24 | + boxShadow: [ |
| 25 | + BoxShadow( |
| 26 | + offset: Offset(0, -15), |
| 27 | + blurRadius: 20, |
| 28 | + color: Color(0xFFDADADA).withOpacity(0.15), |
| 29 | + ), |
| 30 | + ], |
| 31 | + borderRadius: BorderRadius.only( |
| 32 | + topLeft: Radius.circular(40), |
| 33 | + topRight: Radius.circular(40), |
| 34 | + ), |
| 35 | + ), |
| 36 | + child: SafeArea( |
| 37 | + top: false, |
| 38 | + child: Row( |
| 39 | + mainAxisAlignment: MainAxisAlignment.spaceAround, |
| 40 | + children: [ |
| 41 | + IconButton( |
| 42 | + icon: SvgPicture.asset( |
| 43 | + "assets/icons/Shop Icon.svg", |
| 44 | + color: MenuState.home == selectedMenu |
| 45 | + ? kPrimaryColor |
| 46 | + : inActiveIconColor, |
| 47 | + ), |
| 48 | + onPressed: () => |
| 49 | + Navigator.pushNamed(context, HomeScreen.routeName), |
| 50 | + ), |
| 51 | + IconButton( |
| 52 | + icon: SvgPicture.asset("assets/icons/Heart Icon.svg"), |
| 53 | + onPressed: () {}, |
| 54 | + ), |
| 55 | + IconButton( |
| 56 | + icon: SvgPicture.asset("assets/icons/Chat bubble Icon.svg"), |
| 57 | + onPressed: () {}, |
| 58 | + ), |
| 59 | + IconButton( |
| 60 | + icon: SvgPicture.asset( |
| 61 | + "assets/icons/User Icon.svg", |
| 62 | + color: MenuState.profile == selectedMenu |
| 63 | + ? kPrimaryColor |
| 64 | + : inActiveIconColor, |
| 65 | + ), |
| 66 | + onPressed: () => |
| 67 | + Navigator.pushNamed(context, ProfileScreen.routeName), |
| 68 | + ), |
| 69 | + ], |
| 70 | + )), |
| 71 | + ); |
| 72 | + } |
| 73 | +} |
0 commit comments