mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
59 lines
1.5 KiB
Dart
59 lines
1.5 KiB
Dart
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',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|