From e468ec9c43ce936dfad7827e1663edff6dba815a Mon Sep 17 00:00:00 2001 From: llsajjad Date: Sat, 9 Aug 2025 16:55:29 +0330 Subject: [PATCH] Fixed size on web and changed details design button in desktop and tablet --- .../detail/pages/detail_desktop_page.dart | 6 +- .../detail/pages/detail_mobile_page.dart | 6 +- .../detail/pages/detail_tablet_page.dart | 6 +- lib/views/detail/widgets/deadline_item.dart | 278 +++++++++--------- .../detail/widgets/tender_detail_action.dart | 71 +++-- .../detail/widgets/tender_detail_header.dart | 6 +- .../widgets/tender_detail_info_section.dart | 7 +- lib/views/login/pages/login_desktop_page.dart | 11 +- lib/views/login/pages/login_screen.dart | 2 +- lib/views/login/pages/login_tablet_page.dart | 13 +- lib/views/login/widgets/login_button.dart | 4 +- 11 files changed, 225 insertions(+), 185 deletions(-) diff --git a/lib/views/detail/pages/detail_desktop_page.dart b/lib/views/detail/pages/detail_desktop_page.dart index 651fbf5..4829a59 100644 --- a/lib/views/detail/pages/detail_desktop_page.dart +++ b/lib/views/detail/pages/detail_desktop_page.dart @@ -13,6 +13,8 @@ class TenderDetailDesktopPage extends StatelessWidget { @override Widget build(BuildContext context) { + SizeConfig.init(context); + return Scaffold( backgroundColor: AppColors.backgroundColor, appBar: _buildAppBar(context), @@ -25,11 +27,11 @@ class TenderDetailDesktopPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - TenderDetailHeader(isBig: true), + TenderDetailHeader(isScreenBig: true), SizedBox(height: 24.0.h()), const TenderDetailCard(), SizedBox(height: 24.0.h()), - TenderDetailActions(), + TenderDetailActions(isScreenBig: true), ], ), ), diff --git a/lib/views/detail/pages/detail_mobile_page.dart b/lib/views/detail/pages/detail_mobile_page.dart index 829d12c..9a71896 100644 --- a/lib/views/detail/pages/detail_mobile_page.dart +++ b/lib/views/detail/pages/detail_mobile_page.dart @@ -22,11 +22,11 @@ class TenderDetailMobilePage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - TenderDetailHeader(isBig: false), + TenderDetailHeader(isScreenBig: false), SizedBox(height: 24.0.h()), const TenderDetailCard(), SizedBox(height: 24.0.h()), - TenderDetailActions(), + TenderDetailActions(isScreenBig: false,), ], ), ), @@ -38,7 +38,7 @@ class TenderDetailMobilePage extends StatelessWidget { return PreferredSize( preferredSize: const Size.fromHeight(60), child: AppBar( - backgroundColor: AppColors.backgroundColor, + backgroundColor: AppColors.backgroundColor, elevation: 0, titleSpacing: 0, leading: IconButton( diff --git a/lib/views/detail/pages/detail_tablet_page.dart b/lib/views/detail/pages/detail_tablet_page.dart index 643cd7c..b567541 100644 --- a/lib/views/detail/pages/detail_tablet_page.dart +++ b/lib/views/detail/pages/detail_tablet_page.dart @@ -25,11 +25,11 @@ class TenderDetailTabletPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - TenderDetailHeader(isBig: true), + TenderDetailHeader(isScreenBig: true), SizedBox(height: 24.0.h()), const TenderDetailCard(), SizedBox(height: 24.0.h()), - TenderDetailActions(), + TenderDetailActions(isScreenBig: true,), ], ), ), @@ -43,7 +43,7 @@ class TenderDetailTabletPage extends StatelessWidget { return PreferredSize( preferredSize: const Size.fromHeight(60), child: AppBar( - backgroundColor: AppColors.backgroundColor, + backgroundColor: AppColors.backgroundColor, elevation: 0, titleSpacing: 0, leading: IconButton( diff --git a/lib/views/detail/widgets/deadline_item.dart b/lib/views/detail/widgets/deadline_item.dart index 81ffba5..23947ef 100644 --- a/lib/views/detail/widgets/deadline_item.dart +++ b/lib/views/detail/widgets/deadline_item.dart @@ -8,156 +8,164 @@ class DeadlineItem extends StatelessWidget { final String approvalDate; final String submissionText; final String submissionDate; - final bool isBig; + final bool isScreenBig; const DeadlineItem({ - required this.title, required this.approvalText, required this.approvalDate, required this.submissionText, required this.submissionDate, required this.isBig, super.key, + required this.title, + required this.approvalText, + required this.approvalDate, + required this.submissionText, + required this.submissionDate, + required this.isScreenBig, + super.key, }); @override Widget build(BuildContext context) { - return isBig ? Padding( - padding: EdgeInsets.symmetric(vertical: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 45.0.h(), - child: Text( - title, - style: TextStyle( - color: AppColors.grey80, - fontWeight: FontWeight.w600, - fontSize: 16.0.sp(), - ), - ), - ), - IntrinsicHeight( - child: Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - approvalText, - style: TextStyle( - color: AppColors.grey70, - fontWeight: FontWeight.w400, - fontSize: 14.0.sp(), - ), - ), - SizedBox(height: 4.0.h()), - Text( - approvalDate, - style: TextStyle( - color: AppColors.grey80, - fontWeight: FontWeight.w400, - fontSize: 14.0.sp(), - ), - ), - ], + return isScreenBig + ? Padding( + padding: EdgeInsets.symmetric(vertical: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 45.0.h(), + child: Text( + title, + style: TextStyle( + color: AppColors.grey80, + fontWeight: FontWeight.w600, + fontSize: 16.0.sp(), ), ), - VerticalDivider( - color: AppColors.grey30, - thickness: 1, - width: 24, + ), + IntrinsicHeight( + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + approvalText, + style: TextStyle( + color: AppColors.grey70, + fontWeight: FontWeight.w400, + fontSize: 14.0.sp(), + ), + ), + SizedBox(height: 4.0.h()), + Text( + approvalDate, + style: TextStyle( + color: AppColors.grey80, + fontWeight: FontWeight.w400, + fontSize: 14.0.sp(), + ), + ), + ], + ), + ), + VerticalDivider( + color: AppColors.grey30, + thickness: 1, + width: 24, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + submissionText, + style: TextStyle( + color: AppColors.grey70, + fontWeight: FontWeight.w400, + fontSize: 14.0.sp(), + ), + ), + SizedBox(height: 4.0.h()), + Text( + submissionDate, + style: TextStyle( + color: AppColors.grey80, + fontWeight: FontWeight.w400, + fontSize: 14.0.sp(), + ), + ), + ], + ), + ), + ], ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - submissionText, - style: TextStyle( - color: AppColors.grey70, - fontWeight: FontWeight.w400, - fontSize: 14.0.sp(), - ), - ), - SizedBox(height: 4.0.h()), - Text( - submissionDate, - style: TextStyle( - color: AppColors.grey80, - fontWeight: FontWeight.w400, - fontSize: 14.0.sp(), - ), - ), - ], + ), + SizedBox(height: 8.0.h()), + const Divider(), + ], + ), + ) + : Padding( + padding: EdgeInsets.symmetric(vertical: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 45.0.h(), + child: Text( + title, + style: TextStyle( + color: AppColors.grey80, + fontWeight: FontWeight.w600, + fontSize: 16.0.sp(), ), ), - ], - ), - ), - SizedBox(height: 8.0.h()), - const Divider(), - ], - ), - ) : Padding( - padding: EdgeInsets.symmetric(vertical: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 45.0.h(), - child: Text( - title, - style: TextStyle( - color: AppColors.grey80, - fontWeight: FontWeight.w600, - fontSize: 16.0.sp(), ), - ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - approvalText, - style: TextStyle( - color: AppColors.grey70, - fontWeight: FontWeight.w400, - fontSize: 14.0.sp(), - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + approvalText, + style: TextStyle( + color: AppColors.grey70, + fontWeight: FontWeight.w400, + fontSize: 14.0.sp(), + ), + ), + Text( + approvalDate, + style: TextStyle( + color: AppColors.grey70, + fontWeight: FontWeight.w400, + fontSize: 14.0.sp(), + ), + ), + ], ), - Text( - approvalDate, - style: TextStyle( - color: AppColors.grey70, - fontWeight: FontWeight.w400, - fontSize: 14.0.sp(), - ), + SizedBox(height: 4.0.h()), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + submissionText, + style: TextStyle( + color: AppColors.grey70, + fontWeight: FontWeight.w400, + fontSize: 14.0.sp(), + ), + ), + Text( + submissionDate, + style: TextStyle( + color: AppColors.grey70, + fontWeight: FontWeight.w400, + fontSize: 14.0.sp(), + ), + ), + ], ), + SizedBox(height: 8.0.h()), + const Divider(), ], ), - SizedBox(height: 4.0.h()), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - submissionText, - style: TextStyle( - color: AppColors.grey70, - fontWeight: FontWeight.w400, - fontSize: 14.0.sp(), - ), - ), - Text( - submissionDate, - style: TextStyle( - color: AppColors.grey70, - fontWeight: FontWeight.w400, - fontSize: 14.0.sp(), - ), - ), - ], - ), - SizedBox(height: 8.0.h()), - const Divider(), - ], - ), - ); + ); } } diff --git a/lib/views/detail/widgets/tender_detail_action.dart b/lib/views/detail/widgets/tender_detail_action.dart index 514ee7d..21db0a6 100644 --- a/lib/views/detail/widgets/tender_detail_action.dart +++ b/lib/views/detail/widgets/tender_detail_action.dart @@ -5,31 +5,56 @@ import 'package:tm_app/core/utils/size_config.dart'; import 'package:tm_app/views/login/widgets/login_button.dart'; class TenderDetailActions extends StatelessWidget { - const TenderDetailActions({super.key}); + final bool isScreenBig; + const TenderDetailActions({required this.isScreenBig, super.key}); @override Widget build(BuildContext context) { - return Column( - children: [ - BaseButton( - isEnabled: true, - text: AppStrings.tenderSubmitButton, - backgroundColor: AppColors.lightBlue, - textColor: AppColors.mainBlue, - onPressed: () {}, - ), - SizedBox(height: 16.0.h()), - BaseButton( - isEnabled: true, - text: AppStrings.tenderRejectButton, - borderColor: AppColors.red10, - textColor: AppColors.red10, - backgroundColor: AppColors.backgroundColor, - borderWidth: 1, - onPressed: () {}, - ), - SizedBox(height: 16.0.h()), - ], - ); + return isScreenBig + ? Row( + children: [ + Spacer(), + BaseButton( + isEnabled: true, + text: AppStrings.tenderRejectButton, + textColor: AppColors.red10, + backgroundColor: AppColors.backgroundColor, + borderWidth: 1, + onPressed: () {}, + width: 120.0.w(), + ), + SizedBox(width: 5.0.w()), + BaseButton( + isEnabled: true, + text: AppStrings.tenderSubmitButton, + backgroundColor: AppColors.lightBlue, + textColor: AppColors.mainBlue, + onPressed: () {}, + width: 120.0.w(), + ), + ], + ) + : Column( + children: [ + BaseButton( + isEnabled: true, + text: AppStrings.tenderSubmitButton, + backgroundColor: AppColors.lightBlue, + textColor: AppColors.mainBlue, + onPressed: () {}, + ), + SizedBox(height: 16.0.h()), + BaseButton( + isEnabled: true, + text: AppStrings.tenderRejectButton, + borderColor: AppColors.red10, + textColor: AppColors.red10, + backgroundColor: AppColors.backgroundColor, + borderWidth: 1, + onPressed: () {}, + ), + SizedBox(height: 16.0.h()), + ], + ); } } diff --git a/lib/views/detail/widgets/tender_detail_header.dart b/lib/views/detail/widgets/tender_detail_header.dart index 6ee55f7..a1a71aa 100644 --- a/lib/views/detail/widgets/tender_detail_header.dart +++ b/lib/views/detail/widgets/tender_detail_header.dart @@ -8,8 +8,8 @@ import 'package:tm_app/views/detail/widgets/tender_document_section.dart'; import 'package:tm_app/views/detail/widgets/tender_location_section.dart'; class TenderDetailHeader extends StatelessWidget { - final bool isBig; - const TenderDetailHeader({required this.isBig, super.key}); + final bool isScreenBig; + const TenderDetailHeader({required this.isScreenBig, super.key}); @override Widget build(BuildContext context) { @@ -29,7 +29,7 @@ class TenderDetailHeader extends StatelessWidget { SizedBox(height: 10.0.h()), const Divider(), SizedBox(height: 5.0.h()), - TenderDetailInfoSection(isBig: isBig,), + TenderDetailInfoSection(isScreenBig: isScreenBig), TenderLocationSection(), SizedBox(height: 16.0.h()), TenderDocumentSection(), diff --git a/lib/views/detail/widgets/tender_detail_info_section.dart b/lib/views/detail/widgets/tender_detail_info_section.dart index eaac5d5..440829d 100644 --- a/lib/views/detail/widgets/tender_detail_info_section.dart +++ b/lib/views/detail/widgets/tender_detail_info_section.dart @@ -4,9 +4,9 @@ import 'package:tm_app/views/detail/widgets/deadline_item.dart'; import 'package:tm_app/views/detail/widgets/info_item.dart'; class TenderDetailInfoSection extends StatelessWidget { - final bool isBig; + final bool isScreenBig; - const TenderDetailInfoSection({required this.isBig ,super.key}); + const TenderDetailInfoSection({required this.isScreenBig, super.key}); @override Widget build(BuildContext context) { @@ -22,7 +22,8 @@ class TenderDetailInfoSection extends StatelessWidget { approvalText: AppStrings.tenderApprovalText, approvalDate: AppStrings.tenderApprovalDateExample, submissionText: AppStrings.tenderSubmissionText, - submissionDate: AppStrings.tenderSubmissionDateExample, isBig: isBig, + submissionDate: AppStrings.tenderSubmissionDateExample, + isScreenBig: isScreenBig, ), InfoItem( title: AppStrings.tenderClientLabel, diff --git a/lib/views/login/pages/login_desktop_page.dart b/lib/views/login/pages/login_desktop_page.dart index 12ea8a3..f9bf5ed 100644 --- a/lib/views/login/pages/login_desktop_page.dart +++ b/lib/views/login/pages/login_desktop_page.dart @@ -6,8 +6,8 @@ import 'package:tm_app/core/theme/colors.dart'; import '../../../core/constants/assets.dart'; import '../../../core/constants/strings.dart'; import '../../../core/utils/size_config.dart'; -import '../widgets/widgets.dart'; import '../../../view_models/login_view_model.dart'; +import '../widgets/widgets.dart'; class LoginDesktopPage extends StatefulWidget { const LoginDesktopPage({super.key}); @@ -40,7 +40,7 @@ class _LoginDesktopPageState extends State { child: SingleChildScrollView( padding: EdgeInsets.symmetric(horizontal: 24.0.w()), child: SizedBox( - width: 120.0.w(), + width: 526, child: ListenableBuilder( listenable: _viewModel, builder: (context, _) { @@ -79,9 +79,10 @@ class _LoginDesktopPageState extends State { BaseButton( isEnabled: _viewModel.isLoginEnabled, - onPressed: _viewModel.isLoginEnabled - ? () => HomeRouteData().go(context) - : null, + onPressed: + _viewModel.isLoginEnabled + ? () => HomeRouteData().go(context) + : null, ), ], ); diff --git a/lib/views/login/pages/login_screen.dart b/lib/views/login/pages/login_screen.dart index e170e00..6a0e0e7 100644 --- a/lib/views/login/pages/login_screen.dart +++ b/lib/views/login/pages/login_screen.dart @@ -12,7 +12,7 @@ class LoginScreen extends StatelessWidget { Widget build(BuildContext context) { SizeConfig.init(context); return ResponsiveBuilder( - mobile: LoginMobilePage(), + mobile: LoginMobilePage(), tablet: LoginTabletPage(), desktop: LoginDesktopPage(), ); diff --git a/lib/views/login/pages/login_tablet_page.dart b/lib/views/login/pages/login_tablet_page.dart index 255b7c3..64a36aa 100644 --- a/lib/views/login/pages/login_tablet_page.dart +++ b/lib/views/login/pages/login_tablet_page.dart @@ -6,8 +6,8 @@ import 'package:tm_app/core/theme/colors.dart'; import '../../../core/constants/assets.dart'; import '../../../core/constants/strings.dart'; import '../../../core/utils/size_config.dart'; -import '../widgets/widgets.dart'; import '../../../view_models/login_view_model.dart'; +import '../widgets/widgets.dart'; class LoginTabletPage extends StatefulWidget { const LoginTabletPage({super.key}); @@ -35,12 +35,12 @@ class _LoginTabletPageState extends State { Widget build(BuildContext context) { SizeConfig.init(context); return Scaffold( - backgroundColor:AppColors.backgroundColor, + backgroundColor: AppColors.backgroundColor, body: Center( child: SingleChildScrollView( padding: EdgeInsets.symmetric(horizontal: 24.0.w()), child: SizedBox( - width: 120.0.w(), + width: 526, child: ListenableBuilder( listenable: _viewModel, builder: (context, _) { @@ -79,9 +79,10 @@ class _LoginTabletPageState extends State { BaseButton( isEnabled: _viewModel.isLoginEnabled, - onPressed: _viewModel.isLoginEnabled - ? () => HomeRouteData().go(context) - : null, + onPressed: + _viewModel.isLoginEnabled + ? () => HomeRouteData().go(context) + : null, ), ], ); diff --git a/lib/views/login/widgets/login_button.dart b/lib/views/login/widgets/login_button.dart index 9b7d34a..50a78be 100644 --- a/lib/views/login/widgets/login_button.dart +++ b/lib/views/login/widgets/login_button.dart @@ -14,6 +14,7 @@ class BaseButton extends StatelessWidget { final double? borderWidth; final double? borderRadius; final double? elevation; + final double? width; const BaseButton({ required this.isEnabled, @@ -25,13 +26,14 @@ class BaseButton extends StatelessWidget { this.borderWidth, this.borderRadius, this.elevation, + this.width, super.key, }); @override Widget build(BuildContext context) { return SizedBox( - width: double.infinity, + width: width ?? double.infinity, height: 55.0.h(), child: ElevatedButton( onPressed: isEnabled ? onPressed : null,