chopper_generator 2.1.0

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

Chopper is an http client generator using source_gen and inspired by Retrofit.

Changelog #

2.0.0 #

  • Request is now containing baseUrl

  • Can call Request.toHttpRequest() direclty to get the http.BaseRequest will receive

  • If a full url is specified in the path (ex: @Get(path: 'https://...')), it won't be concaten with the baseUrl of the ChopperClient and the ChopperAPI

  • Add CurlInterceptor thanks @edwardaux

  • Add HttpLoggingInterceptor

  • Add FactoryConverter annotation @FactoryConverter(request: convertRequest, response: convertResponse)

  • BreakingChange

    • Method.url renamed to path
    • Converter.encode and Converter.decode removed, implement Converter.convertResponse and Converter.convertRequest` instead
    • ChopperClient.jsonApi deprecated, use a JsonConverter instead
    • ChopperClient.formUrlEncodedApi, use FormUrlEncodedConverter instead
    • remove JsonEncoded annotation, use FactoryConverter instead

1.1.0 #

  • BreakingChange Removed name parameter on ChopperApi New way to instanciate a service dart @ChopperApi() abstract class MyService extends ChopperService { static MyService create([ChopperClient client]) => _$MyService(client); }

1.0.1 #

  • update build package

1.0.0 #

  • Multipart request
  • form url encoded
  • add jsonAPI and formUrlEncodedApi boolean to ChopperClient
  • json and formUrlEncoding are now builtin
  • onError, onResponse, onRequest stream
  • error converter
  • add withClient constructor

0.1.0 #

  • update dart sdk

0.0.2 #

  • the generated extension is now *.chopper.dart

  • rename ServiceDefinition to ChopperApi

  • rename ChopperClient.services field to ChopperClient.apis

0.0.1 #

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

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


dependencies:
  chopper_generator: ^2.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:chopper_generator/chopper_generator.dart';
  
Version Uploaded Documentation Archive
2.1.0 Feb 16, 2019 Go to the documentation of chopper_generator 2.1.0 Download chopper_generator 2.1.0 archive
2.0.0 Feb 12, 2019 Go to the documentation of chopper_generator 2.0.0 Download chopper_generator 2.0.0 archive
1.1.0 Dec 9, 2018 Go to the documentation of chopper_generator 1.1.0 Download chopper_generator 1.1.0 archive
1.0.1 Nov 29, 2018 Go to the documentation of chopper_generator 1.0.1 Download chopper_generator 1.0.1 archive
1.0.0 Sep 29, 2018 Go to the documentation of chopper_generator 1.0.0 Download chopper_generator 1.0.0 archive
0.1.0 Aug 1, 2018 Go to the documentation of chopper_generator 0.1.0 Download chopper_generator 0.1.0 archive
0.0.2 Apr 8, 2018 Go to the documentation of chopper_generator 0.0.2 Download chopper_generator 0.0.2 archive
0.0.1 Apr 7, 2018 Go to the documentation of chopper_generator 0.0.1 Download chopper_generator 0.0.1 archive
1.2.0-dev2 Jan 15, 2019 Go to the documentation of chopper_generator 1.2.0-dev2 Download chopper_generator 1.2.0-dev2 archive
1.2.0-dev1 Dec 21, 2018 Go to the documentation of chopper_generator 1.2.0-dev1 Download chopper_generator 1.2.0-dev1 archive

All 12 versions...

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

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

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: other

Primary library: package:chopper_generator/chopper_generator.dart with components: io, build, mirrors.

Health issues and suggestions

Document public APIs. (-1 points)

2 out of 2 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/generator.dart. (-1.99 points)

Analysis of lib/src/generator.dart reported 4 hints:

line 336 col 17: Use = to separate a named parameter from its default value.

line 337 col 18: Use = to separate a named parameter from its default value.

line 338 col 20: Use = to separate a named parameter from its default value.

line 339 col 20: Use = to separate a named parameter from its default value.

Maintenance suggestions

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 chopper_generator.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
analyzer ^0.33.0 0.33.6+1 0.35.1
build ^1.0.0 1.1.0 1.1.1
built_collection ^3.1.3 3.1.3 4.1.0
chopper ^2.1.0 2.1.0
code_builder ^3.0.0 3.2.0
dart_style ^1.0.10 1.2.0 1.2.3
logging ^0.11.0 0.11.3+2
meta ^1.1.2 1.1.7
source_gen ^0.9.0 0.9.4+1
Transitive dependencies
args 1.5.1
async 2.0.8
built_value 6.3.0
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
csslib 0.14.6
fixnum 0.10.9
front_end 0.1.6+9 0.1.11
glob 1.1.7
html 0.13.3+3
http 0.11.3+17 0.12.0+1
http_parser 3.1.3
kernel 0.3.6+9 0.3.11
matcher 0.12.4
package_config 1.0.5
path 1.6.2
plugin 0.2.0+3
pub_semver 1.4.2
quiver 2.0.1
source_span 1.5.4
stack_trace 1.9.3
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
test ^1.3.0