From 44406e6cd0107cb87e3db13f818caaedb3e6b837 Mon Sep 17 00:00:00 2001 From: zaid_daoud Date: Wed, 15 Nov 2023 14:04:50 +0300 Subject: [PATCH] change cards & text fields & timer & date picker bg colors when disabled --- .../common_widgets/app_text_form_field.dart | 6 +++- .../single_item_drop_down_menu.dart | 9 ++++-- .../widgets/date_and_time/date_picker.dart | 28 +++++++++++-------- lib/views/widgets/timer/app_timer.dart | 6 +++- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/lib/new_views/common_widgets/app_text_form_field.dart b/lib/new_views/common_widgets/app_text_form_field.dart index 405880ad..1db35075 100644 --- a/lib/new_views/common_widgets/app_text_form_field.dart +++ b/lib/new_views/common_widgets/app_text_form_field.dart @@ -101,7 +101,11 @@ class _AppTextFormFieldState extends State { constraints: const BoxConstraints(), suffixIconConstraints: const BoxConstraints(minWidth: 0), filled: true, - fillColor: widget.backgroundColor ?? (context.isDark ? AppColor.neutral50 : Colors.white), + fillColor: widget.backgroundColor ?? context.isDark && (widget.enable == false) + ? AppColor.neutral60 + : (widget.enable == false) + ? AppColor.neutral40 + : Theme.of(context).cardColor, errorStyle: AppTextStyle.tiny.copyWith(color: context.isDark ? AppColor.red50 : AppColor.red60), floatingLabelStyle: AppTextStyle.body1?.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? null : AppColor.neutral20), hintText: widget.hintText ?? "", diff --git a/lib/new_views/common_widgets/single_item_drop_down_menu.dart b/lib/new_views/common_widgets/single_item_drop_down_menu.dart index bcba6124..8596b210 100644 --- a/lib/new_views/common_widgets/single_item_drop_down_menu.dart +++ b/lib/new_views/common_widgets/single_item_drop_down_menu.dart @@ -80,6 +80,7 @@ class _SingleItemDropDownMenuState { height: 56.toScreenHeight, padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth), decoration: BoxDecoration( - color: context.isDark ? AppColor.neutral50 : Theme.of(context).cardColor, + color: context.isDark && (widget.enabled == false) + ? AppColor.neutral60 + : (widget.enabled == false) + ? AppColor.neutral40 + : Theme.of(context).cardColor, borderRadius: BorderRadius.circular(10), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)], ),