Implemented Navigation

This commit is contained in:
Mohammad Salameh
2024-02-14 13:26:09 +03:00
parent 2707124a10
commit 3f1f8e72b3
13 changed files with 191 additions and 75 deletions

View File

@ -0,0 +1,58 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:syncrow_app/features/home/provider/provider.dart';
class DefaultNavBar extends StatelessWidget {
const DefaultNavBar({
super.key,
});
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (BuildContext context) => HomeProvider(),
child: BottomNavigationBar(
onTap: (int index) {
context.read<HomeProvider>().updatePageIndex(index, context);
},
currentIndex: context.watch<HomeProvider>().pageIndex,
selectedIconTheme: const IconThemeData(
color: Colors.black,
),
selectedLabelStyle: const TextStyle(
color: Colors.black,
),
items: const [
BottomNavigationBarItem(
icon: Icon(
Icons.home_outlined,
color: Colors.grey,
),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(
Icons.view_in_ar,
color: Colors.grey,
),
label: 'Scene',
),
BottomNavigationBarItem(
icon: Icon(
Icons.smart_toy_outlined,
color: Colors.grey,
),
label: 'Smart',
),
BottomNavigationBarItem(
icon: Icon(
Icons.account_circle,
color: Colors.grey,
),
label: 'Account',
),
],
),
);
}
}