mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
style: improve code formatting and readability in SaveRoutineHelper
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user