From b8d4f38d67b52c48f1b55fdd5ee2a95931aae36f Mon Sep 17 00:00:00 2001 From: llsajjad Date: Sun, 10 Aug 2025 16:33:30 +0330 Subject: [PATCH] fixed dark theme bugs --- lib/core/theme/colors.dart | 14 ++++++++++++-- lib/views/detail/widgets/deadline_item.dart | 4 ++-- lib/views/detail/widgets/info_item.dart | 2 +- lib/views/detail/widgets/tender_detail_action.dart | 6 +++--- lib/views/detail/widgets/tender_detail_card.dart | 1 + lib/views/detail/widgets/tender_detail_header.dart | 2 +- .../detail/widgets/tender_location_section.dart | 2 +- lib/views/login/pages/login_mobile_page.dart | 9 +++++---- lib/views/login/widgets/widgets.dart | 2 +- .../login_button.dart => shared/base_button.dart} | 8 ++++---- 10 files changed, 31 insertions(+), 19 deletions(-) rename lib/views/{login/widgets/login_button.dart => shared/base_button.dart} (92%) diff --git a/lib/core/theme/colors.dart b/lib/core/theme/colors.dart index 6fa6140..c9994d1 100644 --- a/lib/core/theme/colors.dart +++ b/lib/core/theme/colors.dart @@ -104,11 +104,23 @@ class AppColors { ? const Color.fromRGBO(111, 134, 165, 0.2) : const Color.fromRGBO(11, 134, 165, 0.2); + static Color get primary30 => + _isDarkMode ? const Color(0xFF06162E) : const Color(0xFFD9E8FF); + static Color get orange10 => _isDarkMode ? const Color.fromRGBO(131, 120, 105, 0.2) : const Color(0xFFFFF2DE); + static Color get white => + _isDarkMode ? const Color(0xFFFFFFFF) : const Color(0xFFFFFFFF); + + static Color get paleOrange => + _isDarkMode ? const Color(0xFF260000) : const Color(0xFFfff7ee); + + static Color get veryPaleOrange => + _isDarkMode ? const Color(0xFF581010) : const Color(0xFFFFE4C9); + // Primary color variations static const Color primary2 = Color(0xFFE5EFFF); static const Color secondary50 = Color(0xFF34BCCB); @@ -124,9 +136,7 @@ class AppColors { static const Color red = Color(0xFFFF3B30); // Other colors - static const Color paleOrange = Color(0xFFfff7ee); static const Color lightBlue = Color(0xFFe8ecfc); static const Color cyanAqua = Color(0xFFd6f4f8); static const Color cyanTeal = Color(0xFF24A6B4); - static const Color white = Color(0xFFFFFFFF); } diff --git a/lib/views/detail/widgets/deadline_item.dart b/lib/views/detail/widgets/deadline_item.dart index 23947ef..e77bbdb 100644 --- a/lib/views/detail/widgets/deadline_item.dart +++ b/lib/views/detail/widgets/deadline_item.dart @@ -99,7 +99,7 @@ class DeadlineItem extends StatelessWidget { ), ), SizedBox(height: 8.0.h()), - const Divider(), + Divider(color: AppColors.grey20,), ], ), ) @@ -163,7 +163,7 @@ class DeadlineItem extends StatelessWidget { ], ), SizedBox(height: 8.0.h()), - const Divider(), + Divider(color: AppColors.grey20,), ], ), ); diff --git a/lib/views/detail/widgets/info_item.dart b/lib/views/detail/widgets/info_item.dart index 21c326b..1cc585d 100644 --- a/lib/views/detail/widgets/info_item.dart +++ b/lib/views/detail/widgets/info_item.dart @@ -35,7 +35,7 @@ class InfoItem extends StatelessWidget { ), ), SizedBox(height: 8.0.h()), - const Divider(), + Divider(color: AppColors.grey20,), ], ), ); diff --git a/lib/views/detail/widgets/tender_detail_action.dart b/lib/views/detail/widgets/tender_detail_action.dart index 21db0a6..bd92e6a 100644 --- a/lib/views/detail/widgets/tender_detail_action.dart +++ b/lib/views/detail/widgets/tender_detail_action.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:tm_app/core/constants/strings.dart'; import 'package:tm_app/core/theme/colors.dart'; import 'package:tm_app/core/utils/size_config.dart'; -import 'package:tm_app/views/login/widgets/login_button.dart'; +import 'package:tm_app/views/shared/base_button.dart'; class TenderDetailActions extends StatelessWidget { final bool isScreenBig; @@ -28,7 +28,7 @@ class TenderDetailActions extends StatelessWidget { isEnabled: true, text: AppStrings.tenderSubmitButton, backgroundColor: AppColors.lightBlue, - textColor: AppColors.mainBlue, + textColor: AppColors.primary30, onPressed: () {}, width: 120.0.w(), ), @@ -39,7 +39,7 @@ class TenderDetailActions extends StatelessWidget { BaseButton( isEnabled: true, text: AppStrings.tenderSubmitButton, - backgroundColor: AppColors.lightBlue, + backgroundColor: AppColors.primary30, textColor: AppColors.mainBlue, onPressed: () {}, ), diff --git a/lib/views/detail/widgets/tender_detail_card.dart b/lib/views/detail/widgets/tender_detail_card.dart index 22f3ab4..d31e48e 100644 --- a/lib/views/detail/widgets/tender_detail_card.dart +++ b/lib/views/detail/widgets/tender_detail_card.dart @@ -16,6 +16,7 @@ class TenderDetailCard extends StatelessWidget { decoration: BoxDecoration( color: AppColors.paleOrange, borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColors.veryPaleOrange), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/views/detail/widgets/tender_detail_header.dart b/lib/views/detail/widgets/tender_detail_header.dart index 07accb1..6396622 100644 --- a/lib/views/detail/widgets/tender_detail_header.dart +++ b/lib/views/detail/widgets/tender_detail_header.dart @@ -29,7 +29,7 @@ class TenderDetailHeader extends StatelessWidget { SizedBox(height: 12.0.h()), _buildTitle(), SizedBox(height: 10.0.h()), - const Divider(), + Divider(color: AppColors.grey20,), SizedBox(height: 5.0.h()), TenderDetailInfoSection(isScreenBig: isScreenBig, detail: detail), TenderLocationSection(detail: detail), diff --git a/lib/views/detail/widgets/tender_location_section.dart b/lib/views/detail/widgets/tender_location_section.dart index 418118f..d2ec023 100644 --- a/lib/views/detail/widgets/tender_location_section.dart +++ b/lib/views/detail/widgets/tender_location_section.dart @@ -9,7 +9,7 @@ import 'package:tm_app/data/services/model/tender_detail_response/tender_detail_ class TenderLocationSection extends StatelessWidget { final TenderDetailResponseModel detail; - const TenderLocationSection({super.key, required this.detail}); + const TenderLocationSection({required this.detail, super.key}); @override Widget build(BuildContext context) { diff --git a/lib/views/login/pages/login_mobile_page.dart b/lib/views/login/pages/login_mobile_page.dart index d150dc5..21c7aee 100644 --- a/lib/views/login/pages/login_mobile_page.dart +++ b/lib/views/login/pages/login_mobile_page.dart @@ -52,10 +52,11 @@ class LoginMobilePage extends StatelessWidget { if (viewModel.isLoading) BaseButton( - isEnabled: false, - onPressed: null, - isLoading: true, - ) + isEnabled: false, + onPressed: null, + isLoading: true, + textColor: AppColors.white, + ) else BaseButton( isEnabled: viewModel.isLoginEnabled, diff --git a/lib/views/login/widgets/widgets.dart b/lib/views/login/widgets/widgets.dart index ab511f9..6984144 100644 --- a/lib/views/login/widgets/widgets.dart +++ b/lib/views/login/widgets/widgets.dart @@ -1,4 +1,4 @@ -export 'login_button.dart'; +export '../../shared/base_button.dart'; export 'login_logo.dart'; export 'login_textfield.dart'; export 'login_title.dart'; diff --git a/lib/views/login/widgets/login_button.dart b/lib/views/shared/base_button.dart similarity index 92% rename from lib/views/login/widgets/login_button.dart rename to lib/views/shared/base_button.dart index 67869d2..b0b193f 100644 --- a/lib/views/login/widgets/login_button.dart +++ b/lib/views/shared/base_button.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; -import '../../../core/constants/strings.dart'; -import '../../../core/theme/colors.dart'; -import '../../../core/utils/size_config.dart'; +import '../../core/constants/strings.dart'; +import '../../core/theme/colors.dart'; +import '../../core/utils/size_config.dart'; class BaseButton extends StatelessWidget { final bool isEnabled; @@ -77,7 +77,7 @@ class BaseButton extends StatelessWidget { style: TextStyle( fontSize: 16.0.sp(), fontWeight: FontWeight.bold, - color: textColor ?? AppColors.backgroundColor, + color: textColor ?? AppColors.white, ), ), ),