A comprehensive example Flutter app demonstrating the API Request package features.
- CRUD Operations: Full create, read, update, delete operations for posts
- File Downloads: Multiple approaches to downloading files with progress tracking
- Error Handling: Comprehensive error handling patterns
- Performance Monitoring: Built-in request performance tracking
- Mock vs Live API: Toggle between mock data and live API calls
This example showcases the file download capabilities:
- Action-based downloads using
FileDownloadAction - Direct downloads using
SimpleApiRequest - Progress tracking with visual indicators
- Stream-based progress monitoring
- Download cancellation support
- File management (view, delete downloaded files)
The app is configured with the necessary permissions for network access and file storage:
- Network client access for API calls
- File system access for downloads (user-selected and downloads folder)
- App Transport Security configured for HTTP requests
- App Transport Security configured for HTTP requests
- Internet permission for network access
- External storage read/write permissions for file downloads
-
Install dependencies:
flutter packages get
-
Run the app:
flutter run
-
Navigate between the "Posts" and "Downloads" tabs to explore different features
The app can be configured to use mock data or live API calls by modifying AppConfig.useMockData in lib/config/app_config.dart.
For complete documentation of the API Request package, visit the main README.