feat: Implement agent network management and refactor app navigation with a new AppShell component.

This commit is contained in:
pradeepkumar
2026-03-08 16:05:08 +05:30
parent b4d22df8ba
commit 0362d7cfe0
25 changed files with 1545 additions and 1423 deletions

View File

@@ -51,7 +51,8 @@ class AuthState {
class AuthNotifier extends StateNotifier<AuthState> {
final AuthRepository _repository;
AuthNotifier(this._repository) : super(const AuthState()) {
AuthNotifier(this._repository)
: super(const AuthState(status: AuthStatus.loading)) {
// Wire up force logout callback so API client can reset auth state
// when token refresh fails
ApiClient.onForceLogout = () {
@@ -61,14 +62,14 @@ class AuthNotifier extends StateNotifier<AuthState> {
}
Future<void> checkAuthStatus() async {
state = state.copyWith(status: AuthStatus.loading);
final token = await SecureStorage.getAccessToken();
if (token == null) {
state = state.copyWith(status: AuthStatus.initial);
return;
}
state = state.copyWith(status: AuthStatus.loading);
try {
final user = await _repository.getMe();
state = state.copyWith(