internet_file
1.3.0, released a year ago by serge.software
Download internet files and optionally cache them locally across all platforms.
What it does
InternetFile provides a simple API to fetch files from the web and return them as Uint8List. It can also store the file locally using a pluggable storage implementation, supporting progress callbacks and custom headers.
AI-written summary of version 1.3.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Fetching assets like fonts, PDFs or images that need to be cached locally
- Integrating with plugins that require direct file access on any platform
- Implementing custom storage logic for web or offline support
Skip it when
- You only need a single HTTP request without caching or progress tracking
- You prefer a full-featured HTTP client like Dio for complex request handling
Strengths
- Cross-platform support (web, mobile, desktop, server)
- Optional local storage with pluggable implementation
- Progress callback with received and total bytes
- Simple API, no code generation required
Weaknesses
- No advanced caching policies (e.g., TTL, eviction)
- Relies on http and universal_file, so adding it increases dependencies
- Limited to file download, not general HTTP requests
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
import 'package:internet_file/internet_file.dart';
final Uint8List bytes = await InternetFile.get(
'https://example.com/file.ttf',
progress: (received, total) {
print('downloaded $received of $total bytes');
},
);Alternatives
Packages that do the same job and could replace internet_file.
- background_downloader
Multi-platform background file downloading and uploading for Flutter.
92Compare - file_selector_macos
macOS implementation of the file_selector plugin
82Compare - flutter_downloader
Plugin to create and manage background download tasks on Android and iOS.
80Compare - path_provider_android
Android implementation of the path_provider plugin for finding commonly used locations.
79Compare