Files
syncrow-app/lib/features/app_layout/view/widgets/default_nav_bar.dart
Mohammad Salameh a9fdb2fc76 modified UI padding handling approach
added auth API endpoints
initialized curtains view for further development
2024-03-05 11:18:08 +03:00

45 lines
1.5 KiB
Dart

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/devices/bloc/devices_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({
super.key,
});
@override
Widget build(BuildContext context) {
return BlocBuilder<NavCubit, NavState>(
builder: (context, state) {
var cubit = NavCubit.of(context);
return SizedBox(
height: Constants.bottomNavBarHeight,
child: BottomNavigationBar(
backgroundColor: Colors.transparent,
onTap: (int index) {
cubit.updatePageIndex(index, context);
if (DevicesCubit.get(context).chosenCategoryView != null) {
DevicesCubit().clearCategoriesSelection(context);
}
},
currentIndex: cubit.getPageIndex,
selectedItemColor: ColorsManager.primaryColor,
selectedLabelStyle: const TextStyle(
color: ColorsManager.primaryColor,
fontSize: 10,
),
showUnselectedLabels: true,
unselectedItemColor: Colors.grey,
type: BottomNavigationBarType.fixed,
elevation: 0,
items: cubit.bottomNavItems,
),
);
},
);
}
}