From d5321a9ca09fb375409021aa2f139deecac285d2 Mon Sep 17 00:00:00 2001 From: Rafeek-Khoudare Date: Mon, 21 Jul 2025 13:21:02 +0300 Subject: [PATCH 1/2] fix inncorrect parent in automation screen by removing Expanded --- lib/features/scene/view/routines_view.dart | 56 +++++++++++----------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/lib/features/scene/view/routines_view.dart b/lib/features/scene/view/routines_view.dart index 696612b..3814c70 100644 --- a/lib/features/scene/view/routines_view.dart +++ b/lib/features/scene/view/routines_view.dart @@ -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().add(const SmartSceneClearEvent()); + context + .read() + .add(const SmartSceneClearEvent()); } } return BlocListener( @@ -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() ..add(LoadScenes(selectedSpace!.id, selectedSpace, showInDevice: false)) ..add(LoadAutomation(selectedSpace.id, selectedSpace.community.uuid)); From 4ac60770111d92f2036c6a84d14fbb05f42fbb1e Mon Sep 17 00:00:00 2001 From: Rafeek-Khoudare Date: Mon, 21 Jul 2025 13:22:29 +0300 Subject: [PATCH 2/2] change all routine words into automation --- lib/features/app_layout/bloc/home_cubit.dart | 4 ++-- lib/features/scene/view/scene_view.dart | 2 +- .../scene/widgets/alert_dialogs/delete_routine_dialog.dart | 4 ++-- lib/features/scene/widgets/delete_routine_b.dart | 2 +- lib/features/scene/widgets/empty_devices_widget.dart | 2 +- lib/features/scene/widgets/empty_routines_widget.dart | 2 +- lib/utils/resource_manager/strings_manager.dart | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/features/app_layout/bloc/home_cubit.dart b/lib/features/app_layout/bloc/home_cubit.dart index fe3794c..36e68fb 100644 --- a/lib/features/app_layout/bloc/home_cubit.dart +++ b/lib/features/app_layout/bloc/home_cubit.dart @@ -479,7 +479,7 @@ class HomeCubit extends Cubit { // onPressed: () {}, // ), ], - 'Routine': [ + 'Automation': [ // IconButton( // icon: Image.asset( // Assets.assetsIconsFilter, @@ -553,7 +553,7 @@ class HomeCubit extends Cubit { static Map appBarLeading = { // 'Dashboard': const AppBarHomeDropdown(), 'Devices': const AppBarHomeDropdown(), - 'Routine': const AppBarHomeDropdown(), + 'Automation': const AppBarHomeDropdown(), 'Menu': Padding( padding: const EdgeInsets.only(left: 15), child: Image.asset( diff --git a/lib/features/scene/view/scene_view.dart b/lib/features/scene/view/scene_view.dart index c6cadc9..b81d0ca 100644 --- a/lib/features/scene/view/scene_view.dart +++ b/lib/features/scene/view/scene_view.dart @@ -100,7 +100,7 @@ class SceneView extends StatelessWidget { initiallyExpanded: true, iconColor: ColorsManager.grayColor, title: const BodyMedium( - text: 'Tap to run routines', + text: 'Tap to run automations', ), children: [ if (scenes.isNotEmpty) diff --git a/lib/features/scene/widgets/alert_dialogs/delete_routine_dialog.dart b/lib/features/scene/widgets/alert_dialogs/delete_routine_dialog.dart index d92698c..c183e71 100644 --- a/lib/features/scene/widgets/alert_dialogs/delete_routine_dialog.dart +++ b/lib/features/scene/widgets/alert_dialogs/delete_routine_dialog.dart @@ -23,7 +23,7 @@ class DeleteRoutineDialog extends StatelessWidget { height: 10, ), const BodyLarge( - text: 'Delete Routine', + text: 'Delete Automation', fontWeight: FontWeight.w700, fontColor: ColorsManager.red, fontSize: 16, @@ -39,7 +39,7 @@ class DeleteRoutineDialog extends StatelessWidget { child: Column( children: [ Center(child: const Text('Are you sure you want to ')), - Center(child: const Text('delete the routine?')) + Center(child: const Text('delete the automation?')) ], ), ), diff --git a/lib/features/scene/widgets/delete_routine_b.dart b/lib/features/scene/widgets/delete_routine_b.dart index 216eed2..656d267 100644 --- a/lib/features/scene/widgets/delete_routine_b.dart +++ b/lib/features/scene/widgets/delete_routine_b.dart @@ -52,7 +52,7 @@ class DeleteRoutineButton extends StatelessWidget { }, child: const Center( child: Text( - 'Remove Routine', + 'Remove Automation', style: TextStyle(color: ColorsManager.red), )) // : SceneListTile( diff --git a/lib/features/scene/widgets/empty_devices_widget.dart b/lib/features/scene/widgets/empty_devices_widget.dart index 1c0b4f6..cd210ff 100644 --- a/lib/features/scene/widgets/empty_devices_widget.dart +++ b/lib/features/scene/widgets/empty_devices_widget.dart @@ -9,7 +9,7 @@ class EmptyDevicesWidget extends StatelessWidget { return Padding( padding: const EdgeInsets.symmetric(vertical: 48), child: Text( - "No routines.\nEnable 'Show on Home Screen' to add routines", + "No automations.\nEnable 'Show on Home Screen' to add automations", textAlign: TextAlign.center, style: TextStyle( color: ColorsManager.grayColor, diff --git a/lib/features/scene/widgets/empty_routines_widget.dart b/lib/features/scene/widgets/empty_routines_widget.dart index e572bdc..5c92970 100644 --- a/lib/features/scene/widgets/empty_routines_widget.dart +++ b/lib/features/scene/widgets/empty_routines_widget.dart @@ -23,7 +23,7 @@ class EmptyRoutinesWidget extends StatelessWidget { ), ), BodyMedium( - text: 'No Routines yet', + text: 'No automations yet', fontColor: ColorsManager.textGray, ), ], diff --git a/lib/utils/resource_manager/strings_manager.dart b/lib/utils/resource_manager/strings_manager.dart index da17d36..7aa8117 100644 --- a/lib/utils/resource_manager/strings_manager.dart +++ b/lib/utils/resource_manager/strings_manager.dart @@ -5,7 +5,7 @@ class StringsManager { static const String dashboard = 'Dashboard'; static const String devices = 'Devices'; static const String routine = 'Automation'; - static const String tapToRunRoutine = 'Tap to run routine'; + static const String tapToRunRoutine = 'Tap to run automation'; static const String wizard = 'Wizard'; static const String active = 'Active'; static const String current = 'Current'; @@ -39,6 +39,6 @@ class StringsManager { 'Example: when an unusual activity is detected.'; static const String functions = "Functions"; static const String firstLaunch = "firstLaunch"; - static const String deleteScene = 'Remove Routine'; + static const String deleteScene = 'Remove Automation'; static const String deleteAutomation = 'Delete Automation'; }