mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 15:07:54 +00:00
Added latest changes from dev and solved conflicts
This commit is contained in:
@@ -16,19 +16,17 @@ 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 = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
rooms = HomeCubit.getInstance().selectedSpace?.rooms;
|
||||
rooms = List.from(HomeCubit.getInstance().selectedSpace?.rooms ?? []);
|
||||
if (rooms != null) {
|
||||
if (rooms![0].id != '-1') {
|
||||
rooms?.insert(
|
||||
@@ -43,8 +41,7 @@ class _SceneRoomsTabBarDevicesViewState
|
||||
}
|
||||
}
|
||||
|
||||
_tabController =
|
||||
TabController(length: rooms!.length, vsync: this, initialIndex: 0);
|
||||
_tabController = TabController(length: rooms!.length, vsync: this, initialIndex: 0);
|
||||
_tabController.addListener(_handleTabSwitched);
|
||||
super.initState();
|
||||
}
|
||||
@@ -54,8 +51,9 @@ class _SceneRoomsTabBarDevicesViewState
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user