add all devices fetch

This commit is contained in:
ashrafzarkanisala
2024-06-23 12:01:06 +03:00
parent 1fe4603cbf
commit b58af41b88
6 changed files with 48 additions and 8 deletions

View File

@ -28,10 +28,19 @@ class _SceneControlDevicesViewState extends State<SceneControlDevicesView>
@override
void initState() {
rooms = HomeCubit.getInstance().selectedSpace?.rooms;
rooms?.insert(
0,
RoomModel(
name: 'All Devices', devices: [], id: '-1', type: SpaceType.Room));
if (rooms != null) {
if (rooms![0].id != '-1') {
rooms?.insert(
0,
RoomModel(
name: 'All Devices',
devices: [],
id: '-1',
type: SpaceType.Room,
),
);
}
}
_tabController =
TabController(length: rooms!.length, vsync: this, initialIndex: 0);