What problem does it solve?
Provides a consistent, production-ready HTTP networking foundation for Flutter apps so API calls are authenticated, reliable, and resilient to connectivity issues.
Core Features & Use Cases
- ApiClientFactory: central factory to create a fully-configured Dio client with base options and ordered interceptors.
- NetworkInfo: connectivity abstraction over connectivity_plus to check online status and stream connectivity changes.
- Interceptors: Auth interceptor with token refresh queuing, Error interceptor mapping Dio errors to typed app exceptions, and conditional Logging interceptor for debug builds.
- Use Case: Integrate into the DataSource layer to ensure all API calls include auth, handle 401 refresh flow safely, map network/server errors to app-level exceptions, and avoid requests when offline.
Quick Start
Initialize the network stack by calling ApiClientFactory.create with your baseUrl and a FlutterSecureStorage instance to obtain the Dio client for dependency injection.