From e67b021f267a762ef192e4d4744707905e77a721 Mon Sep 17 00:00:00 2001 From: llsajjad Date: Fri, 5 Sep 2025 12:33:48 +0330 Subject: [PATCH] Fixed size icon and web desktop design --- lib/views/home/tender_card.dart | 2 +- .../pages/liked_tenders_desktop_page.dart | 25 ++------ .../pages/liked_tenders_mobile_page.dart | 2 +- .../pages/liked_tenders_tablet_page.dart | 3 +- .../widgets/liked_tenders_list_item.dart | 62 +++++++++++++++++-- .../widgets/tender_action_buttons_row.dart | 16 ++--- 6 files changed, 74 insertions(+), 36 deletions(-) diff --git a/lib/views/home/tender_card.dart b/lib/views/home/tender_card.dart index a9e1be1..b739d42 100644 --- a/lib/views/home/tender_card.dart +++ b/lib/views/home/tender_card.dart @@ -44,7 +44,7 @@ class TenderCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SvgPicture.asset(iconPath), + SvgPicture.asset(iconPath,width: 32.0.w(),height: 32.0.h(),), SizedBox(height: 4.0.h()), Text( title, diff --git a/lib/views/liked_tenders/pages/liked_tenders_desktop_page.dart b/lib/views/liked_tenders/pages/liked_tenders_desktop_page.dart index d1bbb81..6759750 100644 --- a/lib/views/liked_tenders/pages/liked_tenders_desktop_page.dart +++ b/lib/views/liked_tenders/pages/liked_tenders_desktop_page.dart @@ -86,26 +86,9 @@ class _LikedTendersDesktopPageState extends State { final item = feedback[index]; return Padding( padding: EdgeInsets.only(bottom: 20.0.h()), - child: Dismissible( - key: ValueKey(item.tenderId ?? index), - direction: DismissDirection.endToStart, - background: Container( - alignment: Alignment.centerRight, - padding: EdgeInsets.symmetric( - horizontal: 20.0.w(), - ), - child: SvgPicture.asset( - AssetsManager.trash, - ), - ), - onDismissed: (_) { - if (item.tenderId != null) { - viewModel.removeTenderById( - item.tenderId!, - ); - } - }, - child: LikedListItem(tender: item.tender!), + child: LikedListItem( + tender: item.tender!, + isDesktop: true, ), ); }, @@ -128,7 +111,7 @@ class _LikedTendersDesktopPageState extends State { ), SizedBox(width: 10.0.w()), - GestureDetector( + InkWell( onTap: () async { final selectedPage = await showDialog( context: context, diff --git a/lib/views/liked_tenders/pages/liked_tenders_mobile_page.dart b/lib/views/liked_tenders/pages/liked_tenders_mobile_page.dart index 559292e..71991eb 100644 --- a/lib/views/liked_tenders/pages/liked_tenders_mobile_page.dart +++ b/lib/views/liked_tenders/pages/liked_tenders_mobile_page.dart @@ -103,7 +103,7 @@ class _LikedTendersMobilePageState extends State { padding: EdgeInsets.symmetric( horizontal: 20.0.w(), ), - child: SvgPicture.asset(AssetsManager.trash), + child: SvgPicture.asset(AssetsManager.trash,width: 32.0.w(),height: 32.0.h(),), ), onDismissed: (_) { if (item.tenderId != null) { diff --git a/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart b/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart index f8325d6..b594e9a 100644 --- a/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart +++ b/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart @@ -103,6 +103,7 @@ class _LikedTendersTabletPageState extends State { ), child: SvgPicture.asset( AssetsManager.trash, + width: 32.0.w(),height: 32.0.h(), ), ), onDismissed: (_) { @@ -135,7 +136,7 @@ class _LikedTendersTabletPageState extends State { ), SizedBox(width: 10.0.w()), - GestureDetector( + InkWell( onTap: () async { final selectedPage = await showDialog( context: context, diff --git a/lib/views/liked_tenders/widgets/liked_tenders_list_item.dart b/lib/views/liked_tenders/widgets/liked_tenders_list_item.dart index d0006b2..329fdeb 100644 --- a/lib/views/liked_tenders/widgets/liked_tenders_list_item.dart +++ b/lib/views/liked_tenders/widgets/liked_tenders_list_item.dart @@ -1,18 +1,26 @@ import 'package:country_flags/country_flags.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:provider/provider.dart'; import 'package:tm_app/core/constants/assets.dart'; import 'package:tm_app/core/theme/colors.dart'; import 'package:tm_app/core/utils/size_config.dart'; import 'package:tm_app/data/services/model/tender_data/tender_data.dart'; +import 'package:tm_app/view_models/liked_tenders_view_model.dart'; import 'package:tm_app/views/home/strings/home_strings.dart'; class LikedListItem extends StatelessWidget { - const LikedListItem({required this.tender, super.key}); + const LikedListItem({ + required this.tender, + super.key, + this.isDesktop = false, + }); final TenderData tender; + final bool isDesktop; @override Widget build(BuildContext context) { + final viewModel = context.read(); return Container( decoration: BoxDecoration( color: AppColors.cardBackground, @@ -28,7 +36,53 @@ class LikedListItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox(height: 10.0.h()), - Container( + isDesktop ? + Row( + children: [ + Expanded( + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 10.0.w(), + vertical: 5.0.h(), + ), + decoration: BoxDecoration( + color: AppColors.primary30, + borderRadius: BorderRadius.circular(4), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '${HomeStrings.tenderDeadline} :', + style: TextStyle( + fontSize: 15.0.sp(), + fontWeight: FontWeight.w500, + color: AppColors.textBlue, + ), + ), + Text( + timeConvertor(tender.tenderDeadline!), + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w500, + color: AppColors.grey80, + ), + ), + ], + ), + ), + ), + SizedBox(width: 8.0.w()), + InkWell( + child: SvgPicture.asset(AssetsManager.trash,width: 32.0.w(),height: 32.0.h(),), + onTap: () { + if (tender.id != null) { + viewModel.removeTenderById(tender.id!); + } + }, + ), + ], + ) : Container( padding: EdgeInsets.symmetric( horizontal: 10.0.w(), vertical: 5.0.h(), @@ -110,7 +164,7 @@ class LikedListItem extends StatelessWidget { Spacer(), Container( width: 32.0.w(), - height: 32.0.w(), + height: 32.0.h(), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all(color: AppColors.grey60, width: 1.5.w()), @@ -121,7 +175,7 @@ class LikedListItem extends StatelessWidget { SizedBox(width: 30.0.w()), Container( width: 32.0.w(), - height: 32.0.w(), + height: 32.0.h(), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all(color: AppColors.grey60, width: 1.5.w()), diff --git a/lib/views/tenders/widgets/tender_action_buttons_row.dart b/lib/views/tenders/widgets/tender_action_buttons_row.dart index 38ac042..7b07606 100644 --- a/lib/views/tenders/widgets/tender_action_buttons_row.dart +++ b/lib/views/tenders/widgets/tender_action_buttons_row.dart @@ -70,8 +70,8 @@ class TenderActionButtonsRow extends StatelessWidget { child: Column( children: [ Container( - width: 32.0.w(), - height: 32.0.w(), + width: 24.0.w(), + height: 24.0.w(), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all( @@ -161,8 +161,8 @@ class TenderActionButtonsRow extends StatelessWidget { child: Column( children: [ Container( - width: 32.0.w(), - height: 32.0.w(), + width: 24.0.w(), + height: 24.0.w(), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all( @@ -215,8 +215,8 @@ class TenderActionButtonsRow extends StatelessWidget { child: Column( children: [ SvgPicture.asset( - width: 32.0.w(), - height: 32.0.w(), + width: 24.0.w(), + height: 24.0.w(), fit: BoxFit.cover, AssetsManager.dislike, colorFilter: ColorFilter.mode( @@ -259,8 +259,8 @@ class TenderActionButtonsRow extends StatelessWidget { child: Column( children: [ SvgPicture.asset( - width: 32.0.w(), - height: 32.0.w(), + width: 24.0.w(), + height: 24.0.w(), fit: BoxFit.cover, AssetsManager.like, colorFilter: ColorFilter.mode(