blueprint_network library
HTTP client, Dio, services, Firebase client, and networking utilities.
ApiEndpoints is exported from blueprint_flutter_core.dart with AppConfig.
import 'package:blueprint_flutter_core/blueprint_network.dart';
Classes
- ApiClient
- Configured Dio HTTP client used by all foundation services.
- AppService
- AuthInterceptor
- Injects Bearer tokens and handles auth failures for all outgoing requests.
- DioProvider
-
The shared authenticated
Dioinstance, owned by AuthController. - ErrorInterceptor
- Handles 401 responses by attempting a token refresh then retrying the original request once. If the refresh also fails, throws UnauthorizedException which the auth controller listens to.
- ErrorMapper
-
Maps raw
DioExceptions into typed NetworkException or UnauthorizedException errors that the rest of the app can handle. - FirebaseClient
-
Initialises Firebase using the platform-appropriate
FirebaseOptions. - LogInterceptor
- Logs all requests and responses in development/staging. Silenced automatically in production via FxLogger.
- PendingRequestHandler
- Stores requests that arrived while a token refresh was in progress and either retries or rejects them once the refresh settles.
- RefreshCoordinator
- Manages the token refresh lifecycle.
- ServiceContext
- ServiceContextProvider
-
Bundles
Dio+ ApiEndpoints for use in all AppService subclasses. - TokenManager
- Holds the access token in memory only — never persisted to disk.
Properties
- dioProvider → DioProvider
-
The shared authenticated
Dioinstance, owned by AuthController.final - serviceContextProvider → ServiceContextProvider
-
Bundles
Dio+ ApiEndpoints for use in all AppService subclasses.final
Functions
-
dio(
Ref ref) → Dio -
The shared authenticated
Dioinstance, owned by AuthController. -
serviceContext(
Ref ref) → ServiceContext -
Bundles
Dio+ ApiEndpoints for use in all AppService subclasses.