style: apply dart format across project
This commit is contained in:
@@ -36,25 +36,25 @@ class NavigationProvider extends ChangeNotifier {
|
||||
|
||||
void updateCurrentIndex(int index, {bool addToHistory = true}) {
|
||||
if (_currentIndex == index) return;
|
||||
|
||||
|
||||
_currentIndex = index;
|
||||
_currentRoute = indexToRoute[index] ?? '/';
|
||||
_currentTitle = indexToTitle[index] ?? 'home';
|
||||
|
||||
|
||||
if (addToHistory && index >= 0) {
|
||||
_navigationHistory.add(index);
|
||||
if (_navigationHistory.length > 10) {
|
||||
_navigationHistory.removeAt(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void updateByRoute(String route) {
|
||||
final index = routeToIndex[route] ?? 0;
|
||||
_currentRoute = route;
|
||||
|
||||
|
||||
if (index >= 0) {
|
||||
_currentIndex = index;
|
||||
_currentTitle = indexToTitle[index] ?? 'home';
|
||||
@@ -70,7 +70,7 @@ class NavigationProvider extends ChangeNotifier {
|
||||
_currentTitle = 'home';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@@ -103,4 +103,4 @@ class NavigationProvider extends ChangeNotifier {
|
||||
_navigationHistory.add(0);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user