style: improve code formatting and readability in SaveRoutineHelper

This commit is contained in:
Faris Armoush
2025-04-17 14:39:33 +03:00
parent c46cfb48a8
commit 2e4f904d3a

View File

@ -31,8 +31,10 @@ class SaveRoutineHelper {
children: [
DialogHeader('Create a scene: ${state.routineName ?? ""}'),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 8,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -56,7 +58,7 @@ class SaveRoutineHelper {
static DialogFooter _buildDialogFooter(BuildContext context, RoutineState state) {
return DialogFooter(
onCancel: () => Navigator.pop(context),
onConfirm: () async {
onConfirm: () {
if (state.isAutomation) {
if (state.isUpdate ?? false) {
context.read<RoutineBloc>().add(const UpdateAutomation());
@ -101,7 +103,6 @@ class SaveRoutineHelper {
static Expanded _buildIfConditions(RoutineState state, BuildContext context) {
return Expanded(
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
shrinkWrap: true,
children: [
const Text(
@ -193,13 +194,17 @@ class SaveRoutineHelper {
runSpacing: 16,
spacing: 4,
children: functions
.map((f) => Text(
'${f.operationName}: ${f.value}',
style: context.textTheme.bodySmall?.copyWith(
color: ColorsManager.grayColor, fontSize: 8),
overflow: TextOverflow.ellipsis,
maxLines: 3,
))
.map(
(function) => Text(
'${function.operationName}: ${function.value}',
style: context.textTheme.bodySmall?.copyWith(
color: ColorsManager.grayColor,
fontSize: 8,
),
overflow: TextOverflow.ellipsis,
maxLines: 3,
),
)
.toList(),
),
],
@ -219,9 +224,12 @@ class SaveRoutineHelper {
spacing: 2,
children: [
SizedBox(
width: 8,
height: 8,
child: SvgPicture.asset(Assets.deviceTagIcon)),
width: 8,
height: 8,
child: SvgPicture.asset(
Assets.deviceTagIcon,
),
),
Text(
item['tag'] ?? '',
textAlign: TextAlign.center,
@ -242,9 +250,12 @@ class SaveRoutineHelper {
spacing: 2,
children: [
SizedBox(
width: 8,
height: 8,
child: SvgPicture.asset(Assets.spaceLocationIcon)),
width: 8,
height: 8,
child: SvgPicture.asset(
Assets.spaceLocationIcon,
),
),
Text(
item['subSpace'] ?? '',
textAlign: TextAlign.center,