Refactor color management and UI components for consistency

- Updated color references in various widgets to use the new `opaquePrimary` color for better visual consistency.
- Refactored `ColorsManager` to improve color definitions and removed redundant color declarations.
- Enhanced UI elements across multiple dialogs and widgets to ensure a cohesive design language.

This change promotes maintainability and aligns with the updated color scheme.
This commit is contained in:
Faris Armoush
2025-07-24 10:27:17 +03:00
parent 04d1c37308
commit 99924c1e62
164 changed files with 911 additions and 997 deletions

View File

@ -17,10 +17,9 @@ class SaveRoutineHelper {
builder: (context) {
return BlocBuilder<RoutineBloc, RoutineState>(
builder: (context, state) {
final selectedConditionLabel =
state.selectedAutomationOperator == 'and'
? 'All Conditions are met'
: 'Any Condition is met';
final selectedConditionLabel = state.selectedAutomationOperator == 'and'
? 'All Conditions are met'
: 'Any Condition is met';
return AlertDialog(
contentPadding: EdgeInsets.zero,
@ -38,11 +37,10 @@ class SaveRoutineHelper {
Text(
'Create a scene: ${state.routineName ?? ""}',
textAlign: TextAlign.center,
style:
Theme.of(context).textTheme.headlineMedium!.copyWith(
color: ColorsManager.primaryColorWithOpacity,
fontWeight: FontWeight.bold,
),
style: Theme.of(context).textTheme.headlineMedium!.copyWith(
color: ColorsManager.opaquePrimary,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 18),
_buildDivider(),
@ -60,8 +58,7 @@ class SaveRoutineHelper {
_buildIfConditions(state, context),
Container(
width: 1,
color: ColorsManager.greyColor
.withValues(alpha: 0.8),
color: ColorsManager.greyColor.withValues(alpha: 0.8),
),
_buildThenActions(state, context),
],
@ -100,8 +97,7 @@ class SaveRoutineHelper {
child: Row(
spacing: 16,
children: [
Expanded(
child: Text('IF: $selectedConditionLabel', style: textStyle)),
Expanded(child: Text('IF: $selectedConditionLabel', style: textStyle)),
const Expanded(child: Text('THEN:', style: textStyle)),
],
),
@ -136,7 +132,7 @@ class SaveRoutineHelper {
Navigator.pop(context);
},
textColor: ColorsManager.primaryColorWithOpacity,
textColor: ColorsManager.opaquePrimary,
),
],
);
@ -147,8 +143,7 @@ class SaveRoutineHelper {
child: ListView(
// shrinkWrap: true,
children: state.thenItems.map((item) {
final functions =
state.selectedFunctions[item['uniqueCustomId']] ?? [];
final functions = state.selectedFunctions[item['uniqueCustomId']] ?? [];
return functionRow(item, context, functions);
}).toList(),
),
@ -208,20 +203,19 @@ class SaveRoutineHelper {
),
),
child: Center(
child:
item['type'] == 'tap_to_run' || item['type'] == 'scene'
? Image.memory(
base64Decode(item['icon']),
width: 12,
height: 22,
fit: BoxFit.scaleDown,
)
: SvgPicture.asset(
item['imagePath'],
width: 12,
height: 12,
fit: BoxFit.scaleDown,
),
child: item['type'] == 'tap_to_run' || item['type'] == 'scene'
? Image.memory(
base64Decode(item['icon']),
width: 12,
height: 22,
fit: BoxFit.scaleDown,
)
: SvgPicture.asset(
item['imagePath'],
width: 12,
height: 12,
fit: BoxFit.scaleDown,
),
),
),
Flexible(