feat(profile): Replaced the diet and calendar icons, reduced the height of the bottom nav bar, added the first version of the measurements graph, added the time of the chat message and changed the design slightly

This commit is contained in:
mso7nueh
2024-08-27 16:59:37 +03:00
parent ec19861eb2
commit 7e919d8f4c
18 changed files with 1102 additions and 138 deletions

View File

@@ -4,6 +4,8 @@ import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/new_
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart';
import 'package:eatvio_app/widgets/custom_navigation_menu.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -68,119 +70,154 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
Widget build(BuildContext context) {
return Scaffold(
body: widget.child,
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
onTap: _onItemTapped,
selectedFontSize: 12,
unselectedFontSize: 12,
selectedItemColor: appTheme.blueA400,
currentIndex: currentBottomNavBarIndex,
items: [
BottomNavigationBarItem(
label: '',
icon: SvgPicture.asset(
ImageConstant.imgLogo,
),
),
BottomNavigationBarItem(
label: 'Лента',
icon: SvgPicture.asset(
colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
width: 24,
height: 24,
ImageConstant.icnFeed,
),
activeIcon: SvgPicture.asset(
ImageConstant.icnFeed,
width: 24,
height: 24,
colorFilter: ColorFilter.mode(
appTheme.blueA400,
BlendMode.srcIn,
bottomNavigationBar: SizedBox(
height: 58,
child: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
onTap: _onItemTapped,
selectedFontSize: 10,
unselectedFontSize: 10,
selectedItemColor: appTheme.blueA400,
currentIndex: currentBottomNavBarIndex,
items: [
BottomNavigationBarItem(
label: '',
icon: SvgPicture.asset(
ImageConstant.imgLogo,
height: 32,
),
),
),
BottomNavigationBarItem(
label: "diary".tr,
icon: SvgPicture.asset(
colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
ImageConstant.icnDiary,
width: 24,
height: 24,
),
activeIcon: SvgPicture.asset(
ImageConstant.icnDiary,
width: 24,
height: 24,
colorFilter: ColorFilter.mode(
appTheme.blueA400,
BlendMode.srcIn,
BottomNavigationBarItem(
label: 'Лента',
icon: Padding(
padding: const EdgeInsets.only(bottom: 2),
child: SvgPicture.asset(
colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
width: 20,
height: 20,
ImageConstant.icnFeed,
),
),
activeIcon: Padding(
padding: const EdgeInsets.only(bottom: 2),
child: SvgPicture.asset(
ImageConstant.icnFeed,
width: 20,
height: 20,
colorFilter: ColorFilter.mode(
appTheme.blueA400,
BlendMode.srcIn,
),
),
),
),
),
BottomNavigationBarItem(
label: "chat".tr,
icon: BlocBuilder<NewMessagesCubit, NewMessagesState>(
builder: (BuildContext context, NewMessagesState state) {
return badges.Badge(
position: badges.BadgePosition.topEnd(),
badgeContent: Text(
(state is NewMessagesStateLoaded) ? state.messagesCount.toString() : '0',
style: TextStyle(
color: Colors.white,
BottomNavigationBarItem(
label: "diary".tr,
icon: Padding(
padding: const EdgeInsets.only(bottom: 2),
child: SvgPicture.asset(
colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
ImageConstant.icnDiary,
width: 20,
height: 20,
),
),
activeIcon: Padding(
padding: const EdgeInsets.only(bottom: 2),
child: SvgPicture.asset(
ImageConstant.icnDiary,
width: 20,
height: 20,
colorFilter: ColorFilter.mode(
appTheme.blueA400,
BlendMode.srcIn,
),
),
),
),
BottomNavigationBarItem(
label: "chat".tr,
icon: BlocBuilder<NewMessagesCubit, NewMessagesState>(
builder: (BuildContext context, NewMessagesState state) {
return badges.Badge(
position: badges.BadgePosition.topEnd(),
badgeAnimation: badges.BadgeAnimation.fade(),
badgeContent: Text(
(state is NewMessagesStateLoaded) ? state.messagesCount.toString() : '0',
style: TextStyle(
color: Colors.white,
fontSize: 8,
),
),
),
child: SvgPicture.asset(
ImageConstant.icnChat,
width: 24,
height: 24,
colorFilter: currentBottomNavBarIndex == 3
? ColorFilter.mode(
appTheme.blueA400,
BlendMode.srcIn,
)
: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
),
);
},
),
),
BottomNavigationBarItem(
label: '',
icon: BlocBuilder<NotificationsCubit, NotificationsState>(
builder: (BuildContext context, NotificationsState state) {
return badges.Badge(
position: badges.BadgePosition.topEnd(),
badgeContent: Text(
(state is NotificationsStateLoaded) ? state.notificationsCount.toString() : '0',
style: TextStyle(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.only(bottom: 2),
child: SvgPicture.asset(
ImageConstant.icnChat,
width: 20,
height: 20,
colorFilter: currentBottomNavBarIndex == 3
? ColorFilter.mode(
appTheme.blueA400,
BlendMode.srcIn,
)
: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
),
),
),
child: SvgPicture.asset(
ImageConstant.icnBell,
colorFilter: currentBottomNavBarIndex == 4
? ColorFilter.mode(
appTheme.blueA400,
BlendMode.srcIn,
)
: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
width: 24,
height: 24,
),
);
},
);
},
),
),
),
BottomNavigationBarItem(
label: '',
icon: Image.asset(
ImageConstant.imgEllipse1,
width: 32,
height: 32,
BottomNavigationBarItem(
label: 'Уведомления',
icon: BlocBuilder<NotificationsCubit, NotificationsState>(
builder: (BuildContext context, NotificationsState state) {
return badges.Badge(
position: badges.BadgePosition.topEnd(),
badgeAnimation: badges.BadgeAnimation.fade(),
badgeContent: Text(
(state is NotificationsStateLoaded) ? state.notificationsCount.toString() : '0',
style: TextStyle(
color: Colors.white,
fontSize: 8,
),
),
child: Padding(
padding: const EdgeInsets.only(bottom: 2),
child: SvgPicture.asset(
ImageConstant.icnBell,
colorFilter: currentBottomNavBarIndex == 4
? ColorFilter.mode(
appTheme.blueA400,
BlendMode.srcIn,
)
: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
width: 20,
height: 20,
),
),
);
},
),
),
),
],
BottomNavigationBarItem(
label: '',
icon: BlocBuilder<ProfileAvatarCubit, ProfileAvatarState>(
builder: (BuildContext context, ProfileAvatarState state) {
if (state is ProfileAvatarStateLoaded && state.profile.user.profilePhotoUrl.isNotEmpty) {
return CircleAvatar(
backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl),
radius: 16,
);
}
return CircleAvatar(
radius: 16,
backgroundColor: Colors.black12,
);
},
),
),
],
),
),
);
}