mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 22:47:54 +00:00
push autoamtion api connect
This commit is contained in:
@@ -6,10 +6,9 @@ import 'package:syncrow_app/features/scene/model/scene_settings_route_arguments.
|
||||
import 'package:syncrow_app/features/scene/widgets/scene_list_tile.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/navigation/navigate_to_route.dart';
|
||||
import 'package:syncrow_app/navigation/routing_constants.dart';
|
||||
|
||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||
|
||||
class CreateSceneView extends StatelessWidget {
|
||||
@@ -22,7 +21,7 @@ class CreateSceneView extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(top: 24),
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
navigateToRoute(context, Routes.sceneTasksRoute);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back_ios,
|
||||
@@ -48,6 +47,9 @@ class CreateSceneView extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
context.read<CreateSceneBloc>().add(const ClearTaskListEvent());
|
||||
context
|
||||
.read<CreateSceneBloc>()
|
||||
.add(const SceneTypeEvent(CreateSceneEnum.tabToRun));
|
||||
},
|
||||
),
|
||||
DefaultContainer(
|
||||
@@ -71,6 +73,8 @@ class CreateSceneView extends StatelessWidget {
|
||||
context
|
||||
.read<CreateSceneBloc>()
|
||||
.add(const ClearTaskListEvent(isAutomation: true));
|
||||
context.read<CreateSceneBloc>().add(
|
||||
const SceneTypeEvent(CreateSceneEnum.deviceStatusChanges));
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/light_divider.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
import 'package:syncrow_app/navigation/navigate_to_route.dart';
|
||||
import 'package:syncrow_app/navigation/routing_constants.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
|
||||
@@ -53,9 +54,7 @@ class DeviceFunctionsView extends StatelessWidget
|
||||
context
|
||||
.read<CreateSceneBloc>()
|
||||
.add(AddTaskEvent(isAutomation: isAutomation));
|
||||
Navigator.popUntil(context, (route) {
|
||||
return route.settings.name == Routes.sceneTasksRoute;
|
||||
});
|
||||
navigateToRoute(context, Routes.sceneTasksRoute);
|
||||
},
|
||||
child: BodyMedium(
|
||||
text: 'Save',
|
||||
|
||||
@@ -8,6 +8,8 @@ import 'package:syncrow_app/features/scene/bloc/tab_change/tab_change_event.dart
|
||||
import 'package:syncrow_app/features/scene/widgets/scene_devices/scene_devices_body.dart';
|
||||
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
import 'package:syncrow_app/navigation/navigate_to_route.dart';
|
||||
import 'package:syncrow_app/navigation/routing_constants.dart';
|
||||
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||
@@ -16,10 +18,12 @@ class SceneRoomsTabBarDevicesView extends StatefulWidget {
|
||||
const SceneRoomsTabBarDevicesView({super.key});
|
||||
|
||||
@override
|
||||
State<SceneRoomsTabBarDevicesView> createState() => _SceneRoomsTabBarDevicesViewState();
|
||||
State<SceneRoomsTabBarDevicesView> createState() =>
|
||||
_SceneRoomsTabBarDevicesViewState();
|
||||
}
|
||||
|
||||
class _SceneRoomsTabBarDevicesViewState extends State<SceneRoomsTabBarDevicesView>
|
||||
class _SceneRoomsTabBarDevicesViewState
|
||||
extends State<SceneRoomsTabBarDevicesView>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late final TabController _tabController;
|
||||
List<RoomModel>? rooms = [];
|
||||
@@ -41,7 +45,8 @@ class _SceneRoomsTabBarDevicesViewState extends State<SceneRoomsTabBarDevicesVie
|
||||
}
|
||||
}
|
||||
|
||||
_tabController = TabController(length: rooms!.length, vsync: this, initialIndex: 0);
|
||||
_tabController =
|
||||
TabController(length: rooms!.length, vsync: this, initialIndex: 0);
|
||||
_tabController.addListener(_handleTabSwitched);
|
||||
super.initState();
|
||||
}
|
||||
@@ -51,9 +56,8 @@ class _SceneRoomsTabBarDevicesViewState extends State<SceneRoomsTabBarDevicesVie
|
||||
final value = _tabController.index;
|
||||
|
||||
/// select tab
|
||||
context
|
||||
.read<TabBarBloc>()
|
||||
.add(TabChanged(selectedIndex: value, roomId: rooms?[value].id ?? ''));
|
||||
context.read<TabBarBloc>().add(
|
||||
TabChanged(selectedIndex: value, roomId: rooms?[value].id ?? ''));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -72,8 +76,7 @@ class _SceneRoomsTabBarDevicesViewState extends State<SceneRoomsTabBarDevicesVie
|
||||
padding: EdgeInsets.zero,
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
Navigator.pop(context);
|
||||
navigateToRoute(context, Routes.sceneTasksRoute);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back_ios,
|
||||
|
||||
Reference in New Issue
Block a user