15 lines
309 B
Dart
15 lines
309 B
Dart
import 'package:flutter/foundation.dart';
|
|
|
|
class NavigationProvider extends ChangeNotifier {
|
|
int _currentIndex = 0; // 默认概览页
|
|
|
|
int get currentIndex => _currentIndex;
|
|
|
|
void setIndex(int index) {
|
|
if (_currentIndex != index) {
|
|
_currentIndex = index;
|
|
notifyListeners();
|
|
}
|
|
}
|
|
}
|