internet_file 1.2.0 copy "internet_file: ^1.2.0" to clipboard
internet_file: ^1.2.0 copied to clipboard

A internet file getter (also optional downloader) that works in all platforms


A internet file getter (also optional downloader) that works in all platforms (browsers, mobile, desktop, and server-side)


PurposeGetting StartedApiCredits

Purpose #

The library is made to allow direct access to Internet files on all platforms. It also has the middleware to store files locally if needed. Aimed primarily at use with plugins, without the ability to work with the Internet

Getting Started #

Simple usage anywhere:

import 'package:internet_file/internet_file.dart';

final Uint8List bytes = await InternetFile.get(
    progress: (receivedLength, contentLength) {
      final percentage = receivedLength / contentLength * 100;
          'download progress: $receivedLength of $contentLength ($percentage%)');

For local store files you can usage InternetFileStorageIO (not works on web):

import 'package:internet_file/storage_io.dart';

final storageIO = InternetFileStorageIO();

await InternetFile.get(
    storage: storageIO,
    storageAdditional: storageIO.additional( 
      filename: 'ui_icons.ttf',
      location: '',

Or you can write you own storage not requires io (web support etc.):

class MyOwnInternetFileStorage extends InternetFileStorage {
  Future<Uint8List?> findExist(
    String url,
    InternetFileStorageAdditional additional,
  ) {
    # find local here

    # access you own string property:
    print(additional['my_string_property'] as String);

    # access you own any type property:
    print((additional['my_date_property'] as DateTime).toString())

  Future<void> save(
    String url,
    InternetFileStorageAdditional additional,
    Uint8List bytes,
  ) async {
    # save file here

final myOwnStorage = MyOwnInternetFileStorage();
await InternetFile.get(
    storage: myOwnStorage,
    storageAdditional: {
        'my_string_property': 'string',
        'my_int_property': 99,

Api #

InternetFile.get params

Parameter Description Optional Default
url Link to network file required -
headers Headers passed for wile load optional -
progress Callback with received & all bytes length progress value called when file loads optional -
storage Implements of InternetFileStorage with save & find local methods for saving files optional -
storageAdditional Additional args for pass to InternetFileStorage implementation passed in storage optional {}

Full api reference available here

Credits #

Inspired by flutter_cache_manager, but make for support all platforms


  • http - for file loading from internet
  • path - for filename & location joint in InternetFileStorageIO
  • universal_file - for work File in web

Created for usage in:

pub points



A internet file getter (also optional downloader) that works in all platforms

Repository (GitHub)
View/report issues


API reference




http, path, universal_file


Packages that depend on internet_file