change cards & text fields & timer & date picker bg colors when disabled

main_design2.0
zaid_daoud 2 years ago
parent df147f3ef1
commit 44406e6cd0

@ -101,7 +101,11 @@ class _AppTextFormFieldState extends State<AppTextFormField> {
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 ?? "",

@ -80,6 +80,7 @@ class _SingleItemDropDownMenuState<T extends Base, X extends LoadingListNotifier
@override
Widget build(BuildContext context) {
bool isEmpty = ((X == NullableLoadingProvider ? widget.staticData : provider.items)?.isEmpty ?? true);
return AppLoadingManager(
isLoading: (X == NullableLoadingProvider) ? false : provider.loading,
isFailedLoading: (X == NullableLoadingProvider) ? false : provider.items == null,
@ -94,7 +95,11 @@ class _SingleItemDropDownMenuState<T extends Base, X extends LoadingListNotifier
height: 60.toScreenHeight,
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth),
decoration: BoxDecoration(
color: context.isDark ? AppColor.neutral50 : Colors.white,
color: context.isDark && (widget.enabled == false || isEmpty)
? AppColor.neutral60
: (widget.enabled == false || isEmpty)
? AppColor.neutral40
: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(10),
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
),
@ -118,7 +123,7 @@ class _SingleItemDropDownMenuState<T extends Base, X extends LoadingListNotifier
elevation: 0,
isExpanded: true,
hint: Text(
context.translation.select,
isEmpty || widget.enabled == false ? context.translation.noDataFound : context.translation.select,
style: Theme.of(context).textTheme.bodyLarge,
),
style: TextStyle(color: Theme.of(context).primaryColor),

@ -19,7 +19,11 @@ class ADatePicker extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: context.isDark?AppColor.neutral50:Colors.white,
color: context.isDark && (enable == false)
? AppColor.neutral60
: (enable == false)
? AppColor.neutral40
: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(10),
border: Border.all(width: 1, color: Theme.of(context).scaffoldBackgroundColor),
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
@ -27,16 +31,18 @@ class ADatePicker extends StatelessWidget {
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
label.tinyFont(context),
((date?.toIso8601String()?.split("T")?.first) ?? context.translation.pickADate).bodyText(context).custom(color: context.isDark?AppColor.neutral10: AppColor.neutral50),
],
).expanded,
16.width,
"calender".toSvgAsset(width: 20, color: context.isDark? AppColor.neutral10:null),
enable
? Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
label.tinyFont(context),
((date?.toIso8601String()?.split("T")?.first) ?? context.translation.pickADate).bodyText(context).custom(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
],
).expanded
: label.bodyText(context).paddingOnly(top: 8, bottom: 8),
enable ? 16.width : const Spacer(),
"calender".toSvgAsset(width: 20, color: context.isDark ? AppColor.neutral10 : null),
],
),
).onPress(enable

@ -108,7 +108,11 @@ class _AppTimerState extends State<AppTimer> {
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)],
),

Loading…
Cancel
Save