all_devices and Restrict_user

This commit is contained in:
mohammad
2025-01-29 14:10:38 +03:00
parent d72253e3de
commit c578d63134
29 changed files with 1402 additions and 310 deletions

View File

@ -16,10 +16,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<SubSpaceModel>? rooms = [];
@ -35,14 +37,15 @@ class _SceneRoomsTabBarDevicesViewState extends State<SceneRoomsTabBarDevicesVie
0,
SubSpaceModel(
name: 'All Devices',
devices: DevicesCubit.getInstance().allDevices,
devices: context.read<DevicesCubit>().allDevices,
id: '-1',
),
);
}
}
_tabController = TabController(length: rooms!.length, vsync: this, initialIndex: 0);
_tabController =
TabController(length: rooms!.length, vsync: this, initialIndex: 0);
_tabController.addListener(_handleTabSwitched);
super.initState();
}
@ -52,8 +55,10 @@ class _SceneRoomsTabBarDevicesViewState extends State<SceneRoomsTabBarDevicesVie
final value = _tabController.index;
/// select tab
context.read<TabBarBloc>().add(
TabChanged(selectedIndex: value, roomId: rooms?[value].id ?? '', unit: selectedSpace));
context.read<TabBarBloc>().add(TabChanged(
selectedIndex: value,
roomId: rooms?[value].id ?? '',
unit: selectedSpace));
return;
}
}