mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 11:37:56 +00:00
apend
This commit is contained in:
@@ -35,31 +35,27 @@ class AppLayout extends StatelessWidget {
|
||||
statusBarIconBrightness: Brightness.light,
|
||||
),
|
||||
child: SafeArea(
|
||||
child: BlocBuilder<HomeCubit, HomeState>(
|
||||
builder: (context, state) {
|
||||
return Scaffold(
|
||||
backgroundColor: ColorsManager.backgroundColor,
|
||||
extendBodyBehindAppBar: true,
|
||||
extendBody: true,
|
||||
appBar: HomeCubit.getInstance().spaces != null
|
||||
? const DefaultAppBar()
|
||||
: null,
|
||||
body: const AppBody(),
|
||||
bottomNavigationBar: const DefaultNavBar(),
|
||||
// floatingActionButton: FloatingActionButton(
|
||||
// onPressed: () {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// CustomPageRoute(
|
||||
// builder: (context) =>
|
||||
// const ThreeGangSwitchesView(),
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// child: const Icon(Icons.arrow_forward_ios_sharp),
|
||||
// ),
|
||||
);
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: ColorsManager.backgroundColor,
|
||||
extendBodyBehindAppBar: true,
|
||||
extendBody: true,
|
||||
appBar: HomeCubit.getInstance().spaces != null
|
||||
? const DefaultAppBar()
|
||||
: null,
|
||||
body: const AppBody(),
|
||||
bottomNavigationBar: const DefaultNavBar(),
|
||||
// floatingActionButton: FloatingActionButton(
|
||||
// onPressed: () {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// CustomPageRoute(
|
||||
// builder: (context) =>
|
||||
// const ThreeGangSwitchesView(),
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// child: const Icon(Icons.arrow_forward_ios_sharp),
|
||||
// ),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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