client_network_manager 1.0.1
client_network_manager: ^1.0.1 copied to clipboard
A comprehensive Flutter network manager package with authentication, interceptors, and error handling support.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.1 - 2025-06-18 #
Added #
- Enhanced error handling with more detailed error messages
- Improved network connectivity detection
- Better token refresh mechanism
- Additional logging options for debugging
Changed #
- Updated Dio dependency to latest stable version
- Improved performance for large file uploads
- Enhanced type safety for response models
Fixed #
- Fixed issue with token expiration handling
- Resolved memory leak in long-running requests
- Fixed connectivity interceptor edge cases
- Corrected JSON parsing for nested objects
1.0.0 #
Added #
- Initial release of Flutter Client Network Manager
- Comprehensive network manager interface with generic type support
- Default implementation using Dio HTTP client
- Authentication support with token management
- Built-in interceptors for connectivity and logging
- File upload and download capabilities with progress tracking
- Comprehensive error handling with multiple error model types
- Response caching with configurable expiration
- Cross-platform support (iOS, Android, Web, Desktop)
- Custom transformers for background processing
- Header management functionality
- Interceptor management (add, remove, insert)
- Type-safe response models
- Support for all HTTP methods (GET, POST, PUT, DELETE, PATCH)
- Query parameter support
- URL suffix support
- Request cancellation support
- Progress callbacks for uploads and downloads
- Automatic JSON serialization/deserialization
- Network constants configuration
- JWT helper utilities
- Status code helper utilities
- JSON helper utilities
- Platform-specific adapters (IO and Web)
- Custom background transformers
- Token repository for authentication management
- Auth interceptor for automatic token handling
- Connectivity interceptor for network status checking
- Custom log interceptor for request/response logging
Features #
- NetworkManager Interface: Abstract interface defining all network operations
- DefaultBaseNetworkManager: Concrete implementation using Dio
- Error Models: DefaultErrorModel, NetworkErrorsModel, ResponseErrorsModel, InternalErrorsModel
- Response Models: BaseNetworkResponseModel, BaseNetworkSuccessModel, ListResponseModel
- Interceptors: AuthInterceptor, ConnectivityInterceptor, CustomLogInterceptor
- Utilities: JWT helpers, JSON helpers, status code helpers
- Platform Support: IO and Web adapters for cross-platform compatibility
Technical Details #
- Built with Dio 5.8.0+1 for HTTP client functionality
- Uses flutter_shared_utilities for shared utilities
- Implements custom linting rules for code quality
- Full type safety with generic response models
- Comprehensive documentation and examples