fix inncorrect parent in automation screen by removing Expanded

This commit is contained in:
Rafeek-Khoudare
2025-07-21 13:21:02 +03:00
parent 09dc8cc330
commit d5321a9ca0

View File

@ -27,12 +27,15 @@ class RoutinesView extends StatelessWidget {
builder: (context, state) {
final selectedSpace = HomeCubit.getInstance().selectedSpace;
if (state is DeleteSceneSuccess) {
if (state.success) _loadScenesAndAutomations(context, selectedSpace);
if (state.success)
_loadScenesAndAutomations(context, selectedSpace);
}
if (state is CreateSceneWithTasks) {
if (state.success) {
_loadScenesAndAutomations(context, selectedSpace);
context.read<SmartSceneSelectBloc>().add(const SmartSceneClearEvent());
context
.read<SmartSceneSelectBloc>()
.add(const SmartSceneClearEvent());
}
}
return BlocListener<SceneBloc, SceneState>(
@ -72,30 +75,28 @@ class RoutinesView extends StatelessWidget {
data: Theme.of(context).copyWith(
dividerColor: Colors.transparent,
),
child: Expanded(
child: ListView(
children: [
RoutinesExpansionTile(
title: 'Tap to run routines',
emptyRoutinesMessage:
'No scenes have been added yet',
routines: state.scenes,
loadingStates: state.loadingStates,
loadingSceneId: state.loadingSceneId,
disablePlayButton: false,
),
RoutinesExpansionTile(
title: 'Automation',
emptyRoutinesMessage:
'No automations have been added yet',
routines: state.automationList,
loadingStates: state.loadingStates,
loadingSceneId: state.loadingSceneId,
disablePlayButton: true,
),
const SizedBox(height: 15),
],
),
child: ListView(
children: [
RoutinesExpansionTile(
title: 'Tap to run automations',
emptyRoutinesMessage:
'No scenes have been added yet',
routines: state.scenes,
loadingStates: state.loadingStates,
loadingSceneId: state.loadingSceneId,
disablePlayButton: false,
),
RoutinesExpansionTile(
title: 'Automation',
emptyRoutinesMessage:
'No automations have been added yet',
routines: state.automationList,
loadingStates: state.loadingStates,
loadingSceneId: state.loadingSceneId,
disablePlayButton: true,
),
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>()
..add(LoadScenes(selectedSpace!.id, selectedSpace, showInDevice: false))
..add(LoadAutomation(selectedSpace.id, selectedSpace.community.uuid));