file_cache 0.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • new50

file_cache

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

<font color="green">Dart2 Ready</font>

Getting Started

import 'package:file_cache/file_cache.dart';

// Provider a Loader function for Http request;
Future<HttpClientResponse> loader(String url) async {
  final Uri uri = Uri.parse(url);

  HttpClientRequest request = await httpClient.getUrl(uri);
  return await request.close();
}

// Create the instance of FileCache
FileCache fileCache = await FileCache.fromDefault(
  httpClient: httpClient,
  loader: loader,
);

// Usage: get Json map
Map data = await fileCache.getJson(url);

// Usage: get bytes
Uint8List bytes = await fileCache.getBytes(url);

// Usage: replace NetworkImage
new Image(
    fit: BoxFit.cover,
    image: new FileCacheImage(url),
);

// 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"
// "Bytes(File): $bytesInFile\n"
// "Bytes Read from File: $bytesRead\n"
// "Bytes download: $bytesDownload";

[0.0.1] - initial version

  • getJson/getBytes
  • clean
  • stats
  • FileCacheImage

1. Depend on it

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


dependencies:
  file_cache: "^0.0.1"

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support 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.0.1 Apr 13, 2018 Go to the documentation of file_cache 0.0.1 Download file_cache 0.0.1 archive

Analysis

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

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6
  • Flutter: 0.3.2

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
50
Learn more about scoring.

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use file_cache.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 hints.

    Run flutter format to format lib/src/consolidate_response.dart.

    Run flutter format to format lib/src/file_cache_image.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
flutter 0.0.0
path_provider >=0.4.0 <0.5.0 0.4.0
quiver >=0.28.0 <0.29.0 0.28.2 0.29.0+1
Transitive dependencies
collection 1.14.6 1.14.9
matcher 0.12.2
meta 1.1.2
path 1.5.1
sky_engine 0.0.99
stack_trace 1.9.2
typed_data 1.1.5
vector_math 2.0.6
Dev dependencies
flutter_test
test