mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
Implemented Navigation
This commit is contained in:
58
lib/features/shared_widgets/default_nav_bar.dart
Normal file
58
lib/features/shared_widgets/default_nav_bar.dart
Normal 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',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user