file_cache 0.1.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 75

file_cache #

File cached Json,Buffer,FileCacheImage for flutter package project.

Dart2 Ready

Getting Started #

import 'package:file_cache/file_cache.dart';

// Create the instance of FileCache
FileCache fileCache = await FileCache.fromDefault();

// Usage: get Json map
Map data = await fileCache.getJson('http://httpbin.org/cache/600');

// Usage: get bytes
Uint8List bytes = await fileCache.getBytes('http://httpbin.org/images/jpeg');

// Usage: replace NetworkImage
new Image(
    fit: BoxFit.cover,
    image: new FileCacheImage('http://httpbin.org/images/jpeg'),
);

// Usage: clean file cache
await fileCache.clean();

// Usage: statistics
print(fileCache.stats.toString());
// "Bytes(Memory): $bytesInMemory\n"
// "Miss(Memory): $missInMemory\n"
// "Hit(Memory): $hitMemory\n"
// "Hit(Files): $hitFiles\n"
// "Bytes(File): $bytesInFile\n"
// "Bytes Read from File: $bytesRead\n"
// "Bytes download: $bytesDownload";

[0.1.0 - initial version

  • Dart2
  • remove httpClient
  • add defaultLoader

[0.0.1] - initial version

  • getJson/getBytes
  • clean
  • stats
  • FileCacheImage

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  file_cache: ^0.1.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:file_cache/file_cache.dart';
  
Version Uploaded Documentation Archive
0.1.2 Apr 8, 2019 Go to the documentation of file_cache 0.1.2 Download file_cache 0.1.2 archive
0.1.1 Apr 7, 2019 Go to the documentation of file_cache 0.1.1 Download file_cache 0.1.1 archive
0.1.0 Apr 6, 2019 Go to the documentation of file_cache 0.1.0 Download file_cache 0.1.0 archive
0.0.3 Apr 6, 2019 Go to the documentation of file_cache 0.0.3 Download file_cache 0.0.3 archive
0.0.2 Apr 6, 2019 Go to the documentation of file_cache 0.0.2 Download file_cache 0.0.2 archive
0.0.1 Apr 13, 2018 Go to the documentation of file_cache 0.0.1 Download file_cache 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
49
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Apr 24, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and file_cache.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
path_provider ^0.5.0+1 0.5.0+1
quiver >=2.0.0 <3.0.0 2.0.3
Transitive dependencies
collection 1.14.11
matcher 0.12.5
meta 1.1.6 1.1.7
path 1.6.2
sky_engine 0.0.99
stack_trace 1.9.3
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
test any