jaguar_client 0.2.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 85

jaguar_client

Concise JSON client library for Dart and Jaguar based on package:http

  • Built-in PODO serialization using jaguar_serializer
  • Simple and intuitive API
  • Various authentication support
    • JSON authentication
    • url-encoded-form authentication
    • Basic authentication
    • Planned
      • Facebook oauth
      • Google oauth
      • Google 2FA
  • Session management
    • Browser: LocalStorage
    • Flutter: SharedPreferences
    • IO: DB, File
  • JWT authentication support
  • ResourceClient to access DataStore or a resource
  • SerializedJsonClient enables writing concise REST calls
  • Persistent Cookies on Flutter and IO

Usage

Basic requests

Get request

final JsonResponse resp =
    await client.get('http://localhost:8080/api/list');
print(resp.body);

Post request

final JsonResponse resp = await client
    .post('http://localhost:8080/api/map', body: {'posting': 'hello'});
print(resp.body);

Put request

final JsonResponse resp = await client
    .put('http://localhost:8080/api/map', body: {'putting': 'hello'});
print(resp.body);

Delete request

final JsonResponse resp =
    await client.delete('http://localhost:8080/api/map/123?query=why');
print(resp.body);

Automatic serialization

TODO

Authentication

TODO

Session management

TODO

TODO

-[ ] Persist cookie
-[ ] Persist auth header?

Changelog

0.1.5

  • Moved to jaguar_serializer 0.4.x

0.1.4

  • Matchers for testing

0.1.2

  • Fix in bug capturing Bearer auth header

0.1.1

  • Bearer auth header
  • Logout

1. Depend on it

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


dependencies:
  jaguar_client: "^0.2.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:jaguar_client/jaguar_client.dart';
        
Version Uploaded Documentation Archive
0.2.1 Dec 23, 2017 Go to the documentation of jaguar_client 0.2.1 Download jaguar_client 0.2.1 archive
0.2.0 Nov 3, 2017 Go to the documentation of jaguar_client 0.2.0 Download jaguar_client 0.2.0 archive
0.1.5 Aug 9, 2017 Go to the documentation of jaguar_client 0.1.5 Download jaguar_client 0.1.5 archive
0.1.4 Aug 2, 2017 Go to the documentation of jaguar_client 0.1.4 Download jaguar_client 0.1.4 archive
0.1.3 Jul 18, 2017 Go to the documentation of jaguar_client 0.1.3 Download jaguar_client 0.1.3 archive
0.1.2 Jul 16, 2017 Go to the documentation of jaguar_client 0.1.2 Download jaguar_client 0.1.2 archive
0.1.1 Jul 16, 2017 Go to the documentation of jaguar_client 0.1.1 Download jaguar_client 0.1.1 archive
0.1.0 Jul 15, 2017 Go to the documentation of jaguar_client 0.1.0 Download jaguar_client 0.1.0 archive
0.0.4-dev Jul 14, 2017 Go to the documentation of jaguar_client 0.0.4-dev Download jaguar_client 0.0.4-dev archive
0.0.3-dev Jul 14, 2017 Go to the documentation of jaguar_client 0.0.3-dev Download jaguar_client 0.0.3-dev archive

All 12 versions...

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

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
70 / 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]
85
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:jaguar_client/jaguar_client.dart.

Suggestions

  • Fix analysis_options.yaml.

    We were unable to parse analysis_options.yaml.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • 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.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 hints.

    Strong-mode analysis of lib/src/response.dart gave the following hint:

    line: 31 col: 15
    'JSON' is deprecated and shouldn't be used.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use jaguar_client.dart.

  • Enable strong mode analysis.

    Strong mode helps you to detect bugs and potential issues earlier.Start your analysis_options.yaml file with the following:

    analyzer:
      strong-mode: true
    

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0
auth_header ^0.0.3 0.0.3
client_cookie ^0.1.0 0.1.0 1.0.0
http >=0.11.3 <0.12.0 0.11.3+16
jaguar_common ^0.2.1 0.2.2
jaguar_serializer ^0.5.0 0.5.1 1.0.0-dev6
matcher ^0.12.1 0.12.2
Transitive dependencies
async 2.0.6
charcode 1.1.1
collection 1.14.9
http_parser 3.1.1
intl 0.15.6
meta 1.1.2
path 1.5.1
quiver_iterables 1.0.1
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
typed_data 1.1.5
yaml 2.1.13
yamlicious 0.0.5
Dev dependencies
jaguar ^0.6.5
test >=0.12.19+1 <0.13.0