mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-26 01:09:39 +00:00
push automation
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/scene_listview.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
|
||||
@ -72,66 +73,75 @@ class SceneView extends StatelessWidget {
|
||||
final scenes = state.scenes;
|
||||
final automationList = state.automationList;
|
||||
|
||||
return Expanded(
|
||||
child: ListView(
|
||||
children: [
|
||||
ExpansionTile(
|
||||
tilePadding: const EdgeInsets.symmetric(
|
||||
horizontal: 6),
|
||||
initiallyExpanded: true,
|
||||
iconColor: ColorsManager.grayColor,
|
||||
title: const BodySmall(
|
||||
text: 'Tap to run routines'),
|
||||
children: [
|
||||
scenes.isNotEmpty
|
||||
? SceneGrid(
|
||||
scenes: scenes,
|
||||
loadingSceneId:
|
||||
state.loadingSceneId,
|
||||
disablePLayButton: false,
|
||||
)
|
||||
: const Center(
|
||||
child: BodyMedium(
|
||||
text:
|
||||
'No scenes have been added yet',
|
||||
),
|
||||
return pageType
|
||||
? Expanded(
|
||||
child: SceneListview(
|
||||
scenes: state.scenes,
|
||||
loadingSceneId: state.loadingSceneId,
|
||||
))
|
||||
: Expanded(
|
||||
child: ListView(
|
||||
children: [
|
||||
ExpansionTile(
|
||||
tilePadding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 6),
|
||||
initiallyExpanded: true,
|
||||
iconColor: ColorsManager.grayColor,
|
||||
title: const BodySmall(
|
||||
text: 'Tap to run routines'),
|
||||
children: [
|
||||
scenes.isNotEmpty
|
||||
? SceneGrid(
|
||||
scenes: scenes,
|
||||
loadingSceneId:
|
||||
state.loadingSceneId,
|
||||
disablePLayButton: false,
|
||||
)
|
||||
: const Center(
|
||||
child: BodyMedium(
|
||||
text:
|
||||
'No scenes have been added yet',
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
ExpansionTile(
|
||||
initiallyExpanded: true,
|
||||
iconColor: ColorsManager.grayColor,
|
||||
tilePadding: const EdgeInsets.symmetric(
|
||||
horizontal: 6),
|
||||
title: const BodySmall(text: 'Automation'),
|
||||
children: [
|
||||
automationList.isNotEmpty
|
||||
? SceneGrid(
|
||||
scenes: automationList,
|
||||
loadingSceneId:
|
||||
state.loadingSceneId,
|
||||
disablePLayButton: true,
|
||||
)
|
||||
: const Center(
|
||||
child: BodyMedium(
|
||||
text:
|
||||
'No automations have been added yet',
|
||||
),
|
||||
],
|
||||
),
|
||||
ExpansionTile(
|
||||
initiallyExpanded: true,
|
||||
iconColor: ColorsManager.grayColor,
|
||||
tilePadding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 6),
|
||||
title: const BodySmall(
|
||||
text: 'Automation'),
|
||||
children: [
|
||||
automationList.isNotEmpty
|
||||
? SceneGrid(
|
||||
scenes: automationList,
|
||||
loadingSceneId:
|
||||
state.loadingSceneId,
|
||||
disablePLayButton: true,
|
||||
)
|
||||
: const Center(
|
||||
child: BodyMedium(
|
||||
text:
|
||||
'No automations have been added yet',
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
return const SizedBox();
|
||||
},
|
||||
|
Reference in New Issue
Block a user