mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 06:14:55 +00:00
switched the safe area to be in the scaffold
This commit is contained in:
@ -15,32 +15,20 @@ class AppBody extends StatelessWidget {
|
||||
return BlocConsumer<HomeCubit, HomeState>(
|
||||
listener: (context, state) {
|
||||
if (state is GetSpacesError) {
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// SnackBar(
|
||||
// content: Text(state.errMessage),
|
||||
// ),
|
||||
// );
|
||||
ScaffoldMessenger.of(context).removeCurrentSnackBar();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(state.errMessage),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
return Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
Assets.imagesBackground,
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
opacity: 0.4,
|
||||
),
|
||||
),
|
||||
child: state is! GetSpacesLoading
|
||||
? state is! GetSpaceRoomsLoading
|
||||
? HomeCubit.getInstance().pages[HomeCubit.pageIndex]
|
||||
: const Center(child: CircularProgressIndicator())
|
||||
: const Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
return state is! GetSpacesLoading
|
||||
? state is! GetSpaceRoomsLoading
|
||||
? HomeCubit.getInstance().pages[HomeCubit.pageIndex]
|
||||
: const Center(child: CircularProgressIndicator())
|
||||
: const Center(child: CircularProgressIndicator());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
|
||||
class DefaultNavBar extends StatelessWidget {
|
||||
const DefaultNavBar({
|
||||
@ -15,34 +14,23 @@ class DefaultNavBar extends StatelessWidget {
|
||||
return BlocBuilder<HomeCubit, HomeState>(
|
||||
builder: (context, state) {
|
||||
var cubit = HomeCubit.getInstance();
|
||||
return SizedBox(
|
||||
height: Constants.bottomNavBarHeight,
|
||||
child: BottomNavigationBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
onTap: (int index) {
|
||||
cubit.updatePageIndex(index);
|
||||
// if (DevicesCubit.getInstance().chosenCategoryView != null) {
|
||||
// DevicesCubit.getInstance()
|
||||
// .clearCategoriesSelection(context);
|
||||
// }
|
||||
// if (HomeCubit.getInstance().selectedRoom != null) {
|
||||
// HomeCubit.getInstance().unselectRoom();
|
||||
// }
|
||||
|
||||
HomeCubit.getInstance().updatePageIndex(index);
|
||||
},
|
||||
currentIndex: HomeCubit.pageIndex,
|
||||
selectedItemColor: ColorsManager.primaryColor,
|
||||
selectedLabelStyle: const TextStyle(
|
||||
color: ColorsManager.primaryColor,
|
||||
fontSize: 10,
|
||||
),
|
||||
showUnselectedLabels: true,
|
||||
unselectedItemColor: Colors.grey,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
elevation: 0,
|
||||
items: HomeCubit.bottomNavItems,
|
||||
return BottomNavigationBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
onTap: (int index) {
|
||||
cubit.updatePageIndex(index);
|
||||
HomeCubit.getInstance().updatePageIndex(index);
|
||||
},
|
||||
currentIndex: HomeCubit.pageIndex,
|
||||
selectedItemColor: ColorsManager.primaryColor,
|
||||
selectedLabelStyle: const TextStyle(
|
||||
color: ColorsManager.primaryColor,
|
||||
fontSize: 10,
|
||||
),
|
||||
showUnselectedLabels: true,
|
||||
unselectedItemColor: Colors.grey,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
elevation: 0,
|
||||
items: HomeCubit.bottomNavItems,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user