mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-27 03:17:55 +00:00
apend
This commit is contained in:
@@ -24,6 +24,7 @@ part 'devices_state.dart';
|
||||
|
||||
class DevicesCubit extends Cubit<DevicesState> {
|
||||
DevicesCubit._() : super(DevicesInitial()) {
|
||||
print('device cubit created');
|
||||
if (HomeCubit.getInstance().selectedSpace != null) {
|
||||
fetchGroups(HomeCubit.getInstance().selectedSpace!.id!);
|
||||
for (var room in HomeCubit.getInstance().selectedSpace!.rooms!) {
|
||||
@@ -35,9 +36,9 @@ class DevicesCubit extends Cubit<DevicesState> {
|
||||
|
||||
static DevicesCubit? _instance;
|
||||
static DevicesCubit getInstance() {
|
||||
// If an instance already exists, return it
|
||||
_instance ??= DevicesCubit._();
|
||||
return _instance!;
|
||||
print('device cubit instance found : ${_instance != null}');
|
||||
print('selected space : ${HomeCubit.getInstance().selectedSpace != null}');
|
||||
return _instance ??= DevicesCubit._();
|
||||
}
|
||||
|
||||
DeviceModel? selectedDevice;
|
||||
|
||||
Reference in New Issue
Block a user