mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 23:04:54 +00:00
49 lines
1.1 KiB
Dart
49 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/features/profile/profile_view.dart';
|
|
import 'package:syncrow_app/features/scene/scene_view.dart';
|
|
import 'package:syncrow_app/features/smart/smart_view.dart';
|
|
|
|
import 'home_state.dart';
|
|
import 'widgets/home_view_body.dart';
|
|
|
|
class HomeProvider extends ChangeNotifier {
|
|
final state = HomeState();
|
|
|
|
static int pageIndex = 0;
|
|
|
|
var bottomNavItems = [
|
|
const BottomNavigationBarItem(
|
|
icon: Icon(Icons.home_outlined),
|
|
label: 'Home',
|
|
),
|
|
const BottomNavigationBarItem(
|
|
icon: Icon(Icons.check_box_outlined),
|
|
label: 'Scene',
|
|
),
|
|
const BottomNavigationBarItem(
|
|
icon: Icon(Icons.view_in_ar),
|
|
label: 'Smart',
|
|
),
|
|
const BottomNavigationBarItem(
|
|
icon: Icon(Icons.account_circle),
|
|
label: 'Profile',
|
|
),
|
|
];
|
|
|
|
final List<Widget> pages = [
|
|
const HomeViewBody(),
|
|
const ScenePage(),
|
|
const SmartPage(),
|
|
const ProfilePage(),
|
|
];
|
|
|
|
Widget currentPage() {
|
|
return pages[pageIndex];
|
|
}
|
|
|
|
void updatePageIndex(int index, BuildContext context) {
|
|
pageIndex = index;
|
|
notifyListeners();
|
|
}
|
|
}
|