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) { 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,11 +75,10 @@ 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 routines', title: 'Tap to run automations',
emptyRoutinesMessage: emptyRoutinesMessage:
'No scenes have been added yet', 'No scenes have been added yet',
routines: state.scenes, routines: state.scenes,
@ -96,7 +98,6 @@ class RoutinesView extends StatelessWidget {
const SizedBox(height: 15), const SizedBox(height: 15),
], ],
), ),
),
); );
} }
return const SizedBox.shrink(); return const SizedBox.shrink();
@ -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));