mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 15:59:40 +00:00
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:
@ -32,8 +32,7 @@ class IfContainer extends StatelessWidget {
|
||||
fontSize: 18, fontWeight: FontWeight.bold)),
|
||||
if (state.isAutomation && state.ifItems.isNotEmpty)
|
||||
AutomationOperatorSelector(
|
||||
selectedOperator:
|
||||
state.selectedAutomationOperator),
|
||||
selectedOperator: state.selectedAutomationOperator),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
@ -57,8 +56,8 @@ class IfContainer extends StatelessWidget {
|
||||
(index) => GestureDetector(
|
||||
onTap: () async {
|
||||
if (!state.isTabToRun) {
|
||||
final result = await DeviceDialogHelper
|
||||
.showDeviceDialog(
|
||||
final result =
|
||||
await DeviceDialogHelper.showDeviceDialog(
|
||||
context: context,
|
||||
data: state.ifItems[index],
|
||||
removeComparetors: false,
|
||||
@ -79,8 +78,8 @@ class IfContainer extends StatelessWidget {
|
||||
'NCPS',
|
||||
'WH',
|
||||
'PC',
|
||||
].contains(state.ifItems[index]
|
||||
['productType'])) {
|
||||
].contains(
|
||||
state.ifItems[index]['productType'])) {
|
||||
context.read<RoutineBloc>().add(
|
||||
AddToIfContainer(
|
||||
state.ifItems[index], false));
|
||||
@ -97,12 +96,11 @@ class IfContainer extends StatelessWidget {
|
||||
isFromThen: false,
|
||||
isFromIf: true,
|
||||
onRemove: () {
|
||||
context.read<RoutineBloc>().add(
|
||||
RemoveDragCard(
|
||||
index: index,
|
||||
isFromThen: false,
|
||||
key: state.ifItems[index]
|
||||
['uniqueCustomId']));
|
||||
context.read<RoutineBloc>().add(RemoveDragCard(
|
||||
index: index,
|
||||
isFromThen: false,
|
||||
key: state.ifItems[index]
|
||||
['uniqueCustomId']));
|
||||
},
|
||||
),
|
||||
)),
|
||||
@ -123,9 +121,7 @@ class IfContainer extends StatelessWidget {
|
||||
|
||||
if (!state.isTabToRun) {
|
||||
if (mutableData['deviceId'] == 'tab_to_run') {
|
||||
context
|
||||
.read<RoutineBloc>()
|
||||
.add(AddToIfContainer(mutableData, true));
|
||||
context.read<RoutineBloc>().add(AddToIfContainer(mutableData, true));
|
||||
} else {
|
||||
final result = await DeviceDialogHelper.showDeviceDialog(
|
||||
dialogType: 'IF',
|
||||
@ -184,7 +180,7 @@ class AutomationOperatorSelector extends StatelessWidget {
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: selectedOperator.toLowerCase() == 'or'
|
||||
? ColorsManager.dialogBlueTitle
|
||||
: ColorsManager.whiteColors,
|
||||
: ColorsManager.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
),
|
||||
@ -193,7 +189,7 @@ class AutomationOperatorSelector extends StatelessWidget {
|
||||
'Any condition is met',
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
color: selectedOperator.toLowerCase() == 'or'
|
||||
? ColorsManager.whiteColors
|
||||
? ColorsManager.white
|
||||
: ColorsManager.blackColor,
|
||||
),
|
||||
),
|
||||
@ -212,7 +208,7 @@ class AutomationOperatorSelector extends StatelessWidget {
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: selectedOperator.toLowerCase() == 'and'
|
||||
? ColorsManager.dialogBlueTitle
|
||||
: ColorsManager.whiteColors,
|
||||
: ColorsManager.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
),
|
||||
@ -221,7 +217,7 @@ class AutomationOperatorSelector extends StatelessWidget {
|
||||
'All condition is met',
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
color: selectedOperator.toLowerCase() == 'and'
|
||||
? ColorsManager.whiteColors
|
||||
? ColorsManager.white
|
||||
: ColorsManager.blackColor,
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user