gt_api 1.0.0
gt_api: ^1.0.0 copied to clipboard
A production-ready Flutter API service package with Dio-based HTTP operations, automatic retry, comprehensive logging, file downloads, and network checking.
Changelog #
All notable changes to this project will be documented in this file.
1.0.0 - 2025-12-27 #
Added #
ApiService- Singleton service for HTTP operations- GET, POST, PUT, DELETE, PATCH methods
- Generic type support with custom parsers
- Parallel request execution with
multiRequest() - Configurable per-request timeouts and retry
ApiConfig- Centralized configuration- Base URL, timeouts, global headers
- Retry settings with exponential backoff
- Global exception handler and unauthorized callback
ApiResponse<T>- Type-safe response wrapper- Success/error states
- Parsed data and raw response
- Request duration tracking
ApiException- Comprehensive error handling- Categorized exception types
- DioException conversion
- User-friendly error messages
DownloadHelper- File download support- Progress tracking
- Multiple file downloads
- Image and video specific methods
- Download cancellation
FormDataHelper- Multipart form data builder- File upload support
- Multiple files per field
NetworkChecker- Connectivity checking- Connection type detection
- Status change stream
- Wait for connection utility
ApiLogger- Request/response logging- Timing information
- Curl command generation
- Error logging
RetryInterceptor- Automatic retry- Configurable retry count
- Exponential backoff