mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 18:16:21 +00:00
25 lines
681 B
Dart
25 lines
681 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/features/home/view/home_view.dart';
|
|
import 'package:syncrow_app/features/profile/view/profile_view.dart';
|
|
import 'package:syncrow_app/features/scene/view/scene_view.dart';
|
|
import 'package:syncrow_app/features/smart/view/smart_view.dart';
|
|
|
|
class HomeProvider extends ChangeNotifier {
|
|
int pageIndex = 0;
|
|
|
|
final List<Widget> pages = [
|
|
const HomeView(),
|
|
const SceneView(),
|
|
const SmartView(),
|
|
const ProfileView(),
|
|
];
|
|
|
|
//get current page
|
|
Widget get currentPage => pages[pageIndex];
|
|
|
|
void updatePageIndex(int index, BuildContext context) {
|
|
pageIndex = index;
|
|
notifyListeners();
|
|
}
|
|
}
|