Fixed conditional rendering logic for app bar in AppLayout widget

Update the condition to check for the presence of spaces in HomeCubit
instance before displaying the DefaultAppBar component. This improves
readability and maintainability of the code.
This commit is contained in:
Mohammad Salameh
2024-04-03 02:00:46 +03:00
parent 127d3a0295
commit 313912a941

View File

@ -41,8 +41,9 @@ class AppLayout extends StatelessWidget {
backgroundColor: ColorsManager.backgroundColor,
extendBodyBehindAppBar: true,
extendBody: true,
appBar:
state is GetSpacesLoaded ? const DefaultAppBar() : null,
appBar: HomeCubit.getInstance().spaces != null
? const DefaultAppBar()
: null,
body: const AppBody(),
bottomNavigationBar: const DefaultNavBar(),
// floatingActionButton: FloatingActionButton(