mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 20:44:54 +00:00
Refactor device-related views and add error handling
Refactor device-related views to improve code structure and readability. Add error handling for authentication token in the splash view. Remove unnecessary NavCubit from the app initialization.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
||||
|
||||
import 'package:syncrow_app/features/app_layout/bloc/spaces_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
@ -13,9 +13,9 @@ class DefaultNavBar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<NavCubit, NavState>(
|
||||
return BlocBuilder<SpacesCubit, SpacesState>(
|
||||
builder: (context, state) {
|
||||
var cubit = NavCubit.of(context);
|
||||
var cubit = SpacesCubit.get(context);
|
||||
return SizedBox(
|
||||
height: Constants.bottomNavBarHeight,
|
||||
child: BottomNavigationBar(
|
||||
@ -29,7 +29,7 @@ class DefaultNavBar extends StatelessWidget {
|
||||
SpacesCubit.get(context).unselectRoom();
|
||||
}
|
||||
},
|
||||
currentIndex: NavCubit.pageIndex,
|
||||
currentIndex: SpacesCubit.pageIndex,
|
||||
selectedItemColor: ColorsManager.primaryColor,
|
||||
selectedLabelStyle: const TextStyle(
|
||||
color: ColorsManager.primaryColor,
|
||||
|
||||
Reference in New Issue
Block a user