diff --git a/lib/core/theme/colors.dart b/lib/core/theme/colors.dart index ce739df..20f97e3 100644 --- a/lib/core/theme/colors.dart +++ b/lib/core/theme/colors.dart @@ -181,4 +181,5 @@ class AppColors { static const Color yellow4 = Color(0xFFC07A25); static const Color secondaryborder = Color(0xFFCDCDCD); static const Color secondaryborder2 = Color(0xFFDADADA); + static const Color orange20 = Color(0xFFF6D7AB); } diff --git a/lib/views/home/pages/d_home_page.dart b/lib/views/home/pages/d_home_page.dart index b184d63..68f37f9 100644 --- a/lib/views/home/pages/d_home_page.dart +++ b/lib/views/home/pages/d_home_page.dart @@ -52,8 +52,13 @@ class DesktopHomePage extends StatelessWidget { _progressBarsRow(homeViewModel), SizedBox(height: 32.0.h()), Padding( - padding: EdgeInsets.symmetric(horizontal: 15.0.w()), - child: _firstTenderCardsRow(context, homeViewModel), + padding: EdgeInsets.symmetric( + horizontal: 15.0.w(), + ), + child: _firstTenderCardsRow( + context, + homeViewModel, + ), ), SizedBox(height: 32.0.h()), _yourTenderText(homeViewModel), @@ -166,8 +171,8 @@ class DesktopHomePage extends StatelessWidget { iconPath: AssetsManager.thumbLike, title: HomeStrings.likedTenders, amount: homeViewModel.feedbackStats?.totalLikes.toString() ?? '0', - textColor: AppColors.grey80, - enableTap: true, + textColor: AppColors.grey50, + enableTap: (homeViewModel.feedbackStats?.totalLikes ?? 0) != 0, width: 178, height: 148, onTap: () { diff --git a/lib/views/home/pages/m_home_page.dart b/lib/views/home/pages/m_home_page.dart index 74f2525..2d9f150 100644 --- a/lib/views/home/pages/m_home_page.dart +++ b/lib/views/home/pages/m_home_page.dart @@ -151,8 +151,8 @@ class MobileHomePage extends StatelessWidget { iconPath: AssetsManager.thumbLike, title: HomeStrings.likedTenders, amount: homeViewModel.feedbackStats?.totalLikes.toString() ?? '0', - textColor: AppColors.grey80, - enableTap: true, + textColor: AppColors.grey50, + enableTap: (homeViewModel.feedbackStats?.totalLikes ?? 0) != 0, onTap: () { const LikedTendersRouteData().push(context).then((value) { homeViewModel.init(); diff --git a/lib/views/home/pages/t_home_page.dart b/lib/views/home/pages/t_home_page.dart index 4d8ad26..b5a0c2e 100644 --- a/lib/views/home/pages/t_home_page.dart +++ b/lib/views/home/pages/t_home_page.dart @@ -141,7 +141,6 @@ class TabletHomePage extends StatelessWidget { iconPath: AssetsManager.approve, title: HomeStrings.approvedTenders, amount: '0', - textColor: AppColors.jellyBean, enableTap: true, width: double.infinity, @@ -155,7 +154,6 @@ class TabletHomePage extends StatelessWidget { ); } - // ignore: unused_element Widget _secondTenderCardsRow( HomeViewModel homeViewModel, BuildContext context, @@ -183,8 +181,8 @@ class TabletHomePage extends StatelessWidget { iconPath: AssetsManager.thumbLike, title: HomeStrings.likedTenders, amount: homeViewModel.feedbackStats?.totalLikes.toString() ?? '0', - textColor: AppColors.grey80, - enableTap: true, + textColor: AppColors.grey50, + enableTap: (homeViewModel.feedbackStats?.totalLikes ?? 0) != 0, width: double.infinity, height: 148, onTap: () { diff --git a/lib/views/notification/strings/notification_strings.dart b/lib/views/notification/strings/notification_strings.dart index adca448..32af793 100644 --- a/lib/views/notification/strings/notification_strings.dart +++ b/lib/views/notification/strings/notification_strings.dart @@ -23,4 +23,5 @@ class NotificationStrings { static const String info = 'info'; static const String noUnreadNotifications = 'No unread notifications'; static const String noImportantNotifications = 'No important notifications'; + static const String moreTextButton = 'More'; } diff --git a/lib/views/notification/widgets/notification_card.dart b/lib/views/notification/widgets/notification_card.dart index 0d97fdf..63b9d36 100644 --- a/lib/views/notification/widgets/notification_card.dart +++ b/lib/views/notification/widgets/notification_card.dart @@ -19,97 +19,129 @@ class NotificationCard extends StatelessWidget { return Container( width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 24.0.w()), - padding: const EdgeInsets.all(16.0), + padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 16.0.h()), decoration: BoxDecoration( - color: AppColors.primary10Light, + color: + notification.priority == NotificationStrings.important.toLowerCase() + ? AppColors.orange10 + : AppColors.primary10Light, borderRadius: BorderRadius.circular(4), - border: Border.all(color: AppColors.primary20), + border: + notification.priority == NotificationStrings.important.toLowerCase() + ? Border.all(color: AppColors.orange20) + : Border.all(color: AppColors.primary20), ), - child: Row( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(top: 3.0.h()), - child: SvgPicture.asset(AssetsManager.notification), - ), - SizedBox(width: 5.0.w()), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - notification.title!, - style: TextStyle( - fontSize: 16.0.sp(), - fontWeight: FontWeight.w600, - color: AppColors.grey80, - ), - ), - const Spacer(), - Visibility( - visible: - notification.priority == - NotificationStrings.important.toLowerCase(), - child: Container( - width: 86.0.w(), - height: 24.0.h(), - decoration: BoxDecoration( - color: AppColors.blue0, - borderRadius: BorderRadius.circular(8), - ), - alignment: Alignment.center, - child: Text( - NotificationStrings.important, - style: TextStyle( - fontSize: 12.0.sp(), - fontWeight: FontWeight.w500, - color: AppColors.cyanTeal, - ), - ), - ), - ), - SizedBox(width: !notification.seen! ? 8.0.w() : 0), - !notification.seen! - ? Container( - width: 12.0.w(), - height: 12.0.w(), - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: AppColors.mainBlue, - ), - ) - : const SizedBox(), - ], + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SvgPicture.asset(AssetsManager.notification), + SizedBox(width: 8.0.w()), + Text( + notification.title!, + style: TextStyle( + fontSize: 16.0.sp(), + fontWeight: FontWeight.w600, + color: AppColors.grey80, ), - SizedBox(height: 8.0.h()), - Text( - notification.message!, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 14.0.sp(), - fontWeight: FontWeight.w400, - color: AppColors.grey70, + ), + const Spacer(), + Visibility( + visible: + notification.priority == + NotificationStrings.important.toLowerCase(), + child: Container( + width: 86.0.w(), + height: 24.0.h(), + decoration: BoxDecoration( + color: AppColors.orange20, + borderRadius: BorderRadius.circular(8), + ), + alignment: Alignment.center, + child: Text( + NotificationStrings.important, + style: TextStyle( + fontSize: 12.0.sp(), + fontWeight: FontWeight.w500, + color: AppColors.yellow4, + ), ), ), - SizedBox(height: 8.0.h()), - Row( - children: [ - SvgPicture.asset(AssetsManager.calendar), - SizedBox(width: 4.0.w()), - Text( - viewModel.timeAgo(notification.createdAt!), - style: TextStyle( - fontSize: 12.0.sp(), - fontWeight: FontWeight.w400, - color: AppColors.grey60, - ), + ), + SizedBox(width: !notification.seen! ? 8.0.w() : 0), + !notification.seen! + ? Container( + width: 12.0.w(), + height: 12.0.w(), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: + notification.priority == + NotificationStrings.important.toLowerCase() + ? AppColors.orange + : AppColors.mainBlue, ), - ], + ) + : const SizedBox(), + SizedBox(width: 5.0.w()), + ], + ), + + SizedBox(height: 8.0.h()), + Padding( + padding: EdgeInsets.only(left: 28.0.w()), + child: Text( + notification.message!, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w400, + color: AppColors.grey70, + ), + ), + ), + SizedBox(height: 12.0.h()), + Padding( + padding: EdgeInsets.only(left: 28.0.w()), + child: Row( + children: [ + SvgPicture.asset(AssetsManager.calendar), + SizedBox(width: 4.0.w()), + Text( + viewModel.timeAgo(notification.createdAt!), + style: TextStyle( + fontSize: 12.0.sp(), + fontWeight: FontWeight.w400, + color: AppColors.grey60, + ), + ), + const Spacer(), + TextButton( + onPressed: () {}, + child: Row( + children: [ + Text( + NotificationStrings.moreTextButton, + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w500, + color: AppColors.mainBlue, + ), + ), + SizedBox(width: 4.0.w()), + SvgPicture.asset( + AssetsManager.arrowRight, + colorFilter: const ColorFilter.mode( + AppColors.mainBlue, + BlendMode.srcIn, + ), + ), + ], + ), ), ], ),