cross_file_manager 0.4.3 copy "cross_file_manager: ^0.4.3" to clipboard
cross_file_manager: ^0.4.3 copied to clipboard

Transparent reading of files from assets, Internet (by URL), zip archives by uploader priority.

Cross File Manager #

Cover - Cross File Manager

Transparent reading of files from Flutter assets, Internet (by URL), zip archives by uploader priority.

Features #

We can choose with Cross File Manager the priority for uploaders yourself. For example, if the file is not in the assets, an attempt will be made to get the file from the cloud.

Can develop own loader for download files from Firebase, Firestore, Amazon AWS, Google Drive, Microsoft Azure Cloud Storage, OneDrive, Dropbox, etc. - any data source can be included in the CrossFileManager. See class Loader and already implemented loaders.

Can retrieve the needed file from an archive. It comes in handy when you need to download thousands of small files.

Can memorize a received file and retrieve it from local storage the next time it is requested.

Able to download files in formats:

  • String
  • Image like dart.ui
  • Image like package:flutter/widgets.dart
  • File, binary data

How it works #

Direct path to file

Direct path to file - CrossFileManager

Direct path to file with cache

Direct path to file with cache - CrossFileManager

ZIP path to file

ZIP path to file - CrossFileManager

Getting started #

Add this package to pubspec.yaml. See Installing tab above.

Usage #

Create a manager for App:

final fm = CrossFileManager.create(
  loaders: const [
    PlainAssetsLoader(),
    ZipAssetsLoader(),
    PlainFileLoader(),
    ZipFileLoader(),
  ],
);

Use the manager in the App:

final String? r = await fm.loadString(path);
import 'dart:ui' as ui;

final ui.Image? r = await fm.loadImageUi(path);
import 'package:flutter/widgets.dart' as widgets;

final widgets.Image? r = await fm.loadImageWidget(path);
final File? r = await fm.loadFile(path);
final bool r = await fm.exists(path);
final bool r = await fm.existsInCache(path);
/// Just add file to cache for fast access in the future.
await fm.warmUp(path);

The manager announced above will search file by path in the local assets, then in the zip archives of local assets, then in the local filesystem, then in the zip archives of local filesystem.

It will return the first file found.

See example/main.dart for more use cases:

Example App with CrossFileManager

License #

MIT

TODO #

4
likes
0
pub points
0%
popularity

Publisher

verified publishersyrokomskyi.com

Transparent reading of files from assets, Internet (by URL), zip archives by uploader priority.

Repository (GitHub)
View/report issues

Topics

#files #cache #path #assets #archive

License

unknown (license)

Dependencies

archive, flutter, flutter_cache_manager, path, path_provider, stash, stash_memory

More

Packages that depend on cross_file_manager