api_client_cache 1.0.0

  • Readme
  • Changelog
  • Installing
  • 44

api_client #

Build Status

A HTTP Cache transporter for api_client

How to use #

import 'package:api_client/api_client.dart';
import 'package:api_client_cache/api_client_cache.dart';

final Spec spec = Spec(
        transporter: HttpCacheTransporter(expiresIn: 15000)
        // other configuration
      );

Arguments #

  • onlyGET apply caching for GET request only (default is true)
  • expiresIn set time to live (in milliseconds) for cache entry (default is 15000)
  • transporter set custom transporter rather than Transporter.factory()

[1.0.0] - First release

  • Initialize first version

Use this package as a library

1. Depend on it

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


dependencies:
  api_client_cache: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


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

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and api_client_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.0.0 <3.0.0
api_client ^2.2.0 2.2.0
crypto ^2.1.3 2.1.4
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
convert 2.1.1
emitter 1.0.4
http 0.12.0+4
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
coveralls ^5.1.0
mockito ^4.0.0
test ^1.3.4