mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-25 15:59:39 +00:00
fix inncorrect parent in automation screen by removing Expanded
This commit is contained in:
@ -27,12 +27,15 @@ class RoutinesView extends StatelessWidget {
|
|||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final selectedSpace = HomeCubit.getInstance().selectedSpace;
|
final selectedSpace = HomeCubit.getInstance().selectedSpace;
|
||||||
if (state is DeleteSceneSuccess) {
|
if (state is DeleteSceneSuccess) {
|
||||||
if (state.success) _loadScenesAndAutomations(context, selectedSpace);
|
if (state.success)
|
||||||
|
_loadScenesAndAutomations(context, selectedSpace);
|
||||||
}
|
}
|
||||||
if (state is CreateSceneWithTasks) {
|
if (state is CreateSceneWithTasks) {
|
||||||
if (state.success) {
|
if (state.success) {
|
||||||
_loadScenesAndAutomations(context, selectedSpace);
|
_loadScenesAndAutomations(context, selectedSpace);
|
||||||
context.read<SmartSceneSelectBloc>().add(const SmartSceneClearEvent());
|
context
|
||||||
|
.read<SmartSceneSelectBloc>()
|
||||||
|
.add(const SmartSceneClearEvent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return BlocListener<SceneBloc, SceneState>(
|
return BlocListener<SceneBloc, SceneState>(
|
||||||
@ -72,30 +75,28 @@ class RoutinesView extends StatelessWidget {
|
|||||||
data: Theme.of(context).copyWith(
|
data: Theme.of(context).copyWith(
|
||||||
dividerColor: Colors.transparent,
|
dividerColor: Colors.transparent,
|
||||||
),
|
),
|
||||||
child: Expanded(
|
child: ListView(
|
||||||
child: ListView(
|
children: [
|
||||||
children: [
|
RoutinesExpansionTile(
|
||||||
RoutinesExpansionTile(
|
title: 'Tap to run automations',
|
||||||
title: 'Tap to run routines',
|
emptyRoutinesMessage:
|
||||||
emptyRoutinesMessage:
|
'No scenes have been added yet',
|
||||||
'No scenes have been added yet',
|
routines: state.scenes,
|
||||||
routines: state.scenes,
|
loadingStates: state.loadingStates,
|
||||||
loadingStates: state.loadingStates,
|
loadingSceneId: state.loadingSceneId,
|
||||||
loadingSceneId: state.loadingSceneId,
|
disablePlayButton: false,
|
||||||
disablePlayButton: false,
|
),
|
||||||
),
|
RoutinesExpansionTile(
|
||||||
RoutinesExpansionTile(
|
title: 'Automation',
|
||||||
title: 'Automation',
|
emptyRoutinesMessage:
|
||||||
emptyRoutinesMessage:
|
'No automations have been added yet',
|
||||||
'No automations have been added yet',
|
routines: state.automationList,
|
||||||
routines: state.automationList,
|
loadingStates: state.loadingStates,
|
||||||
loadingStates: state.loadingStates,
|
loadingSceneId: state.loadingSceneId,
|
||||||
loadingSceneId: state.loadingSceneId,
|
disablePlayButton: true,
|
||||||
disablePlayButton: true,
|
),
|
||||||
),
|
const SizedBox(height: 15),
|
||||||
const SizedBox(height: 15),
|
],
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -111,7 +112,8 @@ class RoutinesView extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _loadScenesAndAutomations(BuildContext context, SpaceModel? selectedSpace) {
|
void _loadScenesAndAutomations(
|
||||||
|
BuildContext context, SpaceModel? selectedSpace) {
|
||||||
context.read<SceneBloc>()
|
context.read<SceneBloc>()
|
||||||
..add(LoadScenes(selectedSpace!.id, selectedSpace, showInDevice: false))
|
..add(LoadScenes(selectedSpace!.id, selectedSpace, showInDevice: false))
|
||||||
..add(LoadAutomation(selectedSpace.id, selectedSpace.community.uuid));
|
..add(LoadAutomation(selectedSpace.id, selectedSpace.community.uuid));
|
||||||
|
Reference in New Issue
Block a user