Refactor provider initialization to load only essential providers at startup. Introduce TabNavigationService for managing tab state and update screens to respond to tab changes. Clean up view models and navigation logic for improved performance and maintainability.

This commit is contained in:
amirrezaghabeli
2025-10-06 14:12:40 +03:30
parent 645247183b
commit b43ebf885b
24 changed files with 839 additions and 218 deletions
@@ -0,0 +1,17 @@
import 'package:flutter/foundation.dart';
/// Service to broadcast tab navigation events
/// Allows screens to refresh when their tab becomes active
class TabNavigationService extends ChangeNotifier {
int _currentTabIndex = 0;
int get currentTabIndex => _currentTabIndex;
/// Notify listeners that a tab has been selected
void onTabSelected(int index) {
if (_currentTabIndex != index) {
_currentTabIndex = index;
notifyListeners();
}
}
}