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

Overview

Chopper

All Contributors

pub package Dart CI codecov

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

Documentation

Installation

Please refer to the installation guide at pub.dev or in the Getting started document.

Examples

Issue Tracker

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Hadrien Lejard

πŸ’» πŸ‘€ ⚠️ πŸ“–

IstvΓ‘n Juhos

πŸ’» πŸ‘€ ⚠️ πŸ“–

Ivan Terekhin

πŸ’» πŸ‘€ ⚠️ πŸ“–

Eugeny Sampir

πŸ’»

Uladzimir_Paliukhovich

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

Comments
  • Feature/null safety migration

    Feature/null safety migration

    This PR contributes to #194

    We also will try to migrate the swagger dart code generator as well and check on more than 100 of our swaggers that everything generated successfuly

    enhancement 
    opened by fryette 27
  • Support for null-safety

    Support for null-safety

    Hi! First of all, thank you for your work and time creating this package, is amazing and help me a lot of times!!

    There are any plan to migrate this package to null-safety? I think this is a package that another packages depends on, so there are a roadmap to be migrated?

    Thank you!

    enhancement 
    opened by alfredo-handcash 26
  • Error in generating files build runner for version 4.0.0-nullsafety.0

    Error in generating files build runner for version 4.0.0-nullsafety.0

    Getting error with running "flutter pub run build_runner build --delete-conflicting-outputs".

    Here's my definition in service

    @Post(path: "/api/updateMember") Future<Response> updateMember(@Body() Member body);

    and I'm getting this error

    image

    It used to work on previous build (version 3.0.6). Any idea on why this does not work now

    opened by mammba01012018 25
  • Implement authenticator

    Implement authenticator

    An attempt to solve https://github.com/lejard-h/chopper/issues/47

    Inspired by OkHTTP's authenticator

    The idea is to provide a reactive authentication in the event that an auth challenge is raised. It returns a nullable Request that contains a possible update to the original Request to satisfy the authentication challenge.

    e.g. a request is made to a server that responses with a 401. The authenticator can be implemented however needed to update the original request, such as using a refresh token, then pass a new request back to be executed.

    enhancement 
    opened by grahamsmith 24
  • Fix converter getting called twice if using an authenticator with a JsonConverter on the request

    Fix converter getting called twice if using an authenticator with a JsonConverter on the request

    Fix _handleRequestConverter getting called twice if using an authenticator with a JsonConverter on the request.

    Otherwise an already encoded body string in req.body will be encoded again after the authentication challenge was solved.

    So in the end in this MR we call send() with the same arguments as the initial request which fails with 403 as the token is outdated.

    This behaviour was last changed in #310 to fix #308.

    opened by maxroehrl 19
  • Please update analyzer version

    Please update analyzer version

    pr here #110

    Because every version of copy_with_extension_gen depends on analyzer >=0.39.0 <1.0.0 and chopper_generator 3.0.3 depends on analyzer ^0.38.2, copy_with_extension_gen is incompatible with chopper_generator 3.0.3.

    And because no versions of chopper_generator match >3.0.3 <4.0.0, copy_with_extension_gen is incompatible with chopper_generator ^3.0.3.

    So, because wechat depends on both chopper_generator ^3.0.3 and copy_with_extension_gen ^1.0.7, version solving failed. pub get failed (1; So, because wechat depends on both chopper_generator ^3.0.3 and copy_with_extension_gen ^1.0.7, version solving failed.)

    opened by windrunner414 16
  • Retry original request inside Interceptor

    Retry original request inside Interceptor

    OkHttp provides a Chain to each interceptor. This makes it possible to easily implement failed request repetition, which is useful, for example, for refreshing access tokens.

    Is there a way to replicate something like this with Chopper's current API?

    enhancement help wanted 
    opened by s0nerik 15
  • [Feature] Replace the String based path with Uri

    [Feature] Replace the String based path with Uri

    I took the liberty of replacing the String based url path in the client calls with an Uri as request in the #304 feature request.

    This is now more in line with the underlying Http.Client.

    Any feedback is welcome :)

    enhancement 
    opened by Guldem 13
  • type 'Null' is not a subtype of type 'String' in type cast

    type 'Null' is not a subtype of type 'String' in type cast

    build runner throws this error.

    [SEVERE] chopper_generator:chopper_generator:

    type 'Null' is not a subtype of type 'String' in type cast package:chopper_generator/chopper_generator.dart 7:69 chopperGeneratorFactory package:build_runner_core/src/package_graph/apply_builders.dart 179:47 new BuilderApplication.forBuilder... dart:async runZonedGuarded

    opened by mizzb 13
  • How to send MultipartFile

    How to send MultipartFile

    The current method of sending a file or image is using List<int> bytes but this removes important info like fileName and contentType

    is it possible to use MultipartFile like this: https://stackoverflow.com/a/49645074/3998402

    enhancement good first issue 
    opened by humazed 12
  • Code generation is not working after upgrade

    Code generation is not working after upgrade

    I am getting following errors in all my service files:

    "line 47, column 50 of .: Expected to find ')'. β•· 47 β”‚ @override Future<Response> getCities(Map<String, dynamic> body) { final $url = 'BASE_URL/city_list';."**

    chopper version is : 4.0.1 flutter version is : 2.2.0

    opened by strmchsr 11
  • Configurable HttpLoggingInterceptor

    Configurable HttpLoggingInterceptor

    Updated the HttpLoggingInterceptor so users can specify a more fine grained logging level for there needs.

    Inspired by the HttpLoggingInterceptor configuration of OkHttp.

    enhancement 
    opened by Guldem 1
  • Content-Type for JsonConverter request  is case-sensitive causing applyingHeader to always override

    Content-Type for JsonConverter request is case-sensitive causing applyingHeader to always override

    Problem

    When using the default JsonConverter for requests that contain a header with Content-Type, the value is always overridden with content-type: application/json, even though override: false. The issue is due to JsonConverter always expecting content-type to be in lowercase.

    Steps to Reproduce

    1. Using the default JsonConverter. Make a request with headers containing e.g Content-Type: application/vnd.api+json
    2. Inspect or log the final outgoing header, which will instead contain content-type: application/json.

    Workaround

    Use lowercase content-type instead of Content-Type

    opened by sheldontuitt 0
  • Version 5.2.0 is a breaking change

    Version 5.2.0 is a breaking change

    Steps to Reproduce

    1. Use version 5.1.0
    2. Update to version 5.2.0 without changing your code
    3. Your project won't compile

    Semantic versioning depends on developers upgrading a major version when there is a breaking change. PR #383 replaces strings with URI's. Of course a String is not a URI, so existing code will break working. On package level you should not commit pubspec.lock files, but that means the CI checks will pick any newest version that's in the current major, so our CI pipelines in the PR failed on totally unrelated files.

    I'm not sure if it still make sense to fix this (by reverting it in 5.1.1 and releasing 6.0.0), but my main goal is to make you aware of your responsibilities as package maintainers on versioning. (I know, as I'm a package maintainer myself as well, so I'm trying to be constructive and positive.)

    Major versions in semantic versioning are not just nice numbers, they have actually a function. Please use them as well for that.

    bug 
    opened by renefloor 8
  • Large auth token for header error for ChopperClient

    Large auth token for header error for ChopperClient

    Steps to Reproduce

    1. Create ChopperClient for API POST call with interceptors and the chopper inbuilt jsonconverter.
    2. Add an auth interceptor with the token header.
    3. Make sure the token header is larger than 200 letters.

    Expected results:

    1. I expected the api to be invoked.

    Actual results: I got an error with the converter saying that the data types are not compatible.

    Code sample ``` register(UserCreate user) async { final client = ChopperClient( baseUrl: API, services: [AccountApiService.create()], interceptors: [headerInterceptor], converter: JsonConverter()); final responseData = client.getService(); var response = await responseData.register(user); return response; }

    Future headerInterceptor(Request request) async { final headers = Map<String, String>.from(request.headers); this.token = GetStorage().read('token'); headers['accept'] = '/'; headers['Content-Type'] = ApiConstants.contentType; headers['Authorization'] = token; request = request.copyWith(headers: headers); return request; }

    <!--
          Please create a minimal reproducible sample that shows the problem
          and attach it below between the lines with the backticks.
    
          To create it you can use `dart create bug` command and update the `main.dart` file.
    
          Alternatively, you can use https://dartpad.dev/
          which is capable of creating and running small Dart apps.
    
          Without this we will unlikely be able to progress on the issue, and because of that
          we regretfully will have to close it.
    -->
    
    
    
    </details>
    
    <details>
      <summary>Logs</summary>
    
    > E/flutter ( 5213): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'String' is not a subtype of type 'UserCreate?'
    > E/flutter ( 5213): #0      JsonConverter.decodeJson (package:chopper/src/interceptor.dart:272:46)
    > E/flutter ( 5213): <asynchronous suspension>
    > E/flutter ( 5213): #1      JsonConverter.convertResponse (package:chopper/src/interceptor.dart:279:8)
    > E/flutter ( 5213): <asynchronous suspension>
    > E/flutter ( 5213): #2      ChopperClient._decodeResponse (package:chopper/src/base.dart:186:7)
    > E/flutter ( 5213): <asynchronous suspension>
    > E/flutter ( 5213): #3      ChopperClient._handleSuccessResponse (package:chopper/src/base.dart:254:11)
    > E/flutter ( 5213): <asynchronous suspension>
    > E/flutter ( 5213): #4      ChopperClient.send (package:chopper/src/base.dart:324:11)
    > E/flutter ( 5213): <asynchronous suspension>
    > E/flutter ( 5213): #5      UserRest.register (package:fairfare/resource/chopper_service/user/user_rest.dart:39:20)
    > E/flutter ( 5213): <asynchronous suspension>
    > E/flutter ( 5213): #6      AuthController.register (package:fairfare/controller/auth_controller.dart:41:25)
    > E/flutter ( 5213): <asynchronous suspension>
    > E/flutter ( 5213):
    <!--
          Run your application with `dart run main.dart --verbose` and attach all the
          log output below between the lines with the backticks. If there is an
          exception, please see if the error message includes enough information
          to explain how to solve the issue.
    -->
    
    

    Output too big.

    
    <!--
         Run `dart analyze` and attach any output of that command below.
         If there are any analysis errors, try resolving them before filing this issue.
    -->
    
    

    $ dart analyze Analyzing fairfare mobile flutter...

    info β€’ lib\controller\register_controller.dart:1:8 β€’ Unused import: 'package:fairfare/models/user/user.dart'. Try removing the import
    directive. β€’ unused_import info β€’ lib\controller\register_controller.dart:2:8 β€’ Unused import: 'package:fairfare/sharedPreferences.dart'. Try removing the import
    directive. β€’ unused_import info β€’ lib\location_resources.dart:9:20 β€’ The declaration 'determinePosition' isn't referenced. Try removing the declaration of 'determinePosition'. β€’ unused_element info β€’ lib\models\amazon_gift_card\amazon_gift_card.g.dart:9:26 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\amazon_gift_card\amazon_gift_card.g.dart:23:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\card\card.g.dart:9:15 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\card\card.g.dart:28:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\feedback\feedback.g.dart:9:16 β€’ The declaration '$FeedBackCreateFromJson' isn't referenced. Try removing the declaration of '$FeedBackCreateFromJson'. β€’ unused_element info β€’ lib\models\feedback\feedback.g.dart:23:13 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names
    info β€’ lib\models\feedback\feedback.g.dart:30:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names
    info β€’ lib\models\gift_card\card.g.dart:9:16 β€’ The declaration '$GiftCardCreateFromJson' isn't referenced. Try removing the declaration of '$GiftCardCreateFromJson'. β€’ unused_element info β€’ lib\models\gift_card\card.g.dart:27:13 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\gift_card\card.g.dart:36:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:9:23 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:28:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:45:23 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:56:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:67:13 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:74:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:81:13 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:88:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:95:13 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:100:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:106:30 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:120:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:128:20 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\lime\lime.g.dart:136:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\location\location.g.dart:9:16 β€’ The declaration '$LocationCreateFromJson' isn't referenced. Try removing the declaration of '$LocationCreateFromJson'. β€’ unused_element info β€’ lib\models\location\location.g.dart:27:13 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names
    info β€’ lib\models\location\location.g.dart:36:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names
    info β€’ lib\models\location\location.g.dart:46:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names
    info β€’ lib\models\location\location.g.dart:55:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names
    info β€’ lib\models\preference\preference.g.dart:9:15 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names
    info β€’ lib\models\preference\preference.g.dart:15:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names
    info β€’ lib\models\referral\referral.g.dart:9:13 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names
    info β€’ lib\models\referral\referral.g.dart:17:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names
    info β€’ lib\models\service_provider\service_provider.g.dart:9:28 β€’ The declaration '$SavedServiceProviderCreateFromJson' isn't referenced.
    Try removing the declaration of '
    $SavedServiceProviderCreateFromJson'. β€’ unused_element info β€’ lib\models\service_provider\service_provider.g.dart:32:20 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\service_provider\service_provider.g.dart:40:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\service_provider\service_provider.g.dart:48:25 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\service_provider\service_provider.g.dart:62:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:9:26 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:16:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:23:27 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:40:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:53:16 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:71:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:86:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:99:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:113:21 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:121:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:129:21 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:142:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:150:25 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:158:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:166:25 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:181:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:193:5 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:201:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:210:34 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:219:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:228:30 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:245:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:258:15 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:267:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:276:16 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:284:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:292:13 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\uber\uber.g.dart:311:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\user\user.g.dart:9:9 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\models\user\user.g.dart:31:22 β€’ Name non-constant identifiers using lowerCamelCase. β€’ non_constant_identifier_names info β€’ lib\sharedPreferences.dart:1:8 β€’ Unused import: 'package:get/get.dart'. Try removing the import directive. β€’ unused_import info β€’ lib\sharedPreferences.dart:5:16 β€’ The value of the field '_authDetails' isn't used. Try removing the field, or using it. β€’ unused_field info β€’ lib\utils\local_string.dart:28:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:42:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:83:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:84:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:85:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:86:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:108:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:164:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:165:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:192:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:206:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:247:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:248:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:249:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:250:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:272:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:328:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:329:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:356:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:370:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:411:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:412:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:413:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:414:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:436:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:492:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map info β€’ lib\utils\local_string.dart:493:11 β€’ Two keys in a map literal shouldn't be equal. Change or remove the duplicate key. β€’ equal_keys_in_map

    100 issues found.

    
    <!-- Finally, paste the output of running `dart --version` here. -->
    
    
    

    $ dart --version Dart SDK version: 2.19.0-146.2.beta (beta) (Tue Sep 20 10:30:48 2022 +0000) on "windows_x64"

    
    </details>
    
    bug 
    opened by Chrisphine10 1
  • [Feature request] Multipart request progress support

    [Feature request] Multipart request progress support

    It would be great to have a way to get the upload progress of multipart requests. An example of how to achieve this with http package can be found here. Maybe by adding a new annotation? Something like:

      @Post(path: '/file')
      @Multipart()
      Future<Response<void>> uploadFile(
        @Query('filename') String fileName,
        @PartFile() String filePath,
        /// A callback that take the progress of the upload as a double between 0 and 1
        @ProgressCallback() void Function(double) progressCallback,
    );
    
    opened by Pierre2tm 0
  • Response Headers are not complete

    Response Headers are not complete

    Hey,

    I use Chopper in a few of my projects and have found that when I call reponse.header I only get an incomplete list of headers that are actually returned with the response.

    (Response response) async {
            print(response.headers);
            return response;
    },
    

    This call returns the following in my case:

    {content-type: application/json; charset=utf-8}
    

    But when I look into the browser a lot of other headers come back.

    HTTP/1.1 200 OK
    Server: nginx/1.18.0
    Date: Tue, 13 Sep 2022 19:19:44 GMT
    Content-Type: application/json; charset=utf-8
    Transfer-Encoding: chunked
    Connection: keep-alive
    Access-Control-Allow-Origin: *
    

    I also tested this with custom headers I set in the browser, I couldn't read those in my Flutter app either. Is there any other way to get a complete list of headers? Thanks for your help.

    opened by morzan1001 5
Releases(v4.0.6)
  • v4.0.6(Jun 22, 2022)

  • v4.0.0(May 17, 2021)

    • Null safety support
    • Fix infinite loop when using Authenticators
    • Remove deprecated FileField, use PartFile instead
    • Remove deprecated Request.replace, use Request.copyWith instead
    • Remove deprecated PartValue.replace, use PartValue.copyWith instead
    • Remove deprecated Response.replace, use Response.copyWith instead
    • Support for OPTIONS requests
    • Support for passing data in the body of GET requests (anti-pattern, but requested)
    • Support for OkHttp-like Authenticator implementation
    • Support for generic API methods
    • Updated public API documentation and how-tos
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0-nullsafety.1(Apr 13, 2021)

    chopper

    • Fix infinite loop when using Authenticators
    • Remove deprecated FileField, use PartFile instead
    • Remove deprecated Request.replace, use Request.copyWith instead
    • Remove deprecated PartValue.replace, use PartValue.copyWith instead
    • Remove deprecated Response.replace, use Response.copyWith instead

    chopper_generator

    • Fix @Header annotation not generating null safe code
    • Respect required keyword in functions
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0-nullsafety.0(Mar 27, 2021)

    • Null safety support
    • Support for OPTIONS requests
    • Support for passing data in the body of GET requests (anti-pattern, but requested)
    • Support for OkHttp-like Authenticator implementation
    • Support for generic API methods
    • Updated public API documentation and how-tos
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Nov 17, 2019)

    Breaking: Removed name parameter on ChopperApi

    New way to instanciate a service.

      @ChopperApi()
      abstract class MyService extends ChopperService {
          static MyService create([ChopperClient client]) => _$MyService(client);
      }
    
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Nov 17, 2019)

    • Multipart request
    • Support form url encoded
    • Add jsonAPI and formUrlEncodedApi boolean to ChopperClient
    • Json and formUrlEncoding are now builtin
    • onError, onResponse, onRequest stream
    • Add error converter
    • Add withClient constructor
    Source code(tar.gz)
    Source code(zip)
Owner
Hadrien Lejard
Front end developer at @leftyio with @dart-lang @angular @flutter
Hadrien Lejard
Petit httpd - This is a simple HTTP file server integrated with Let's Encrypt, gzip and CORS

Petit httpd - This is a simple HTTP file server integrated with Let's Encrypt, gzip and CORS

Graciliano Monteiro Passos 4 Nov 24, 2022
server side dart micro-framework to handle incoming http requests

Queen Palace ???? Introduction server side dart micro-framework to handle incoming http requests

Ahmed Masoud 32 Aug 30, 2022
Concepts used Flutter layout,State management, Blockchain integration, Http api integration, Smart contracts

HS_CryptoCoin_Wallet First project using Flutter with Blockchain Getting Started This project is a starting point for a Flutter application. A few res

Harsh Saxena 1 Dec 23, 2021
Easy way to store http response.

Starlight Http Cached The easiest way to store data such as http response,String,int,double,bool,map,list. Features β˜‘οΈ Set Cached β˜‘οΈ Get Cached β˜‘οΈ Del

Ye Myo Aung 3 Jan 9, 2023
Fetchx - Simplified http requests in Dart

Fetchx Fetchx is a simple, fast, and secure HTTP client for Dart. It leverages extensions to allow using url-like strings to make http requests. Read

Brian Omondi 9 Nov 26, 2022
Open source password generator app for Android and iOS

Parole is an open-source, free, and cross-platform service that is intended to make people secure on the internet ecosystem. Parole excels to build up

Shivam Yadav 1 Oct 19, 2021
Dart GraphQL server implementation. Utilities, code generator, examples and reference implementation.

Leto - GraphQL Server A complete implementation of the official GraphQL specification in the Dart programming language. Inspired by graphql-js, async-

Juan Manuel Castillo 29 Nov 27, 2022
This is a Flutter project inspired by sustainability and powered by the community

This is a Flutter project inspired by sustainability and powered by the community. TrashTrack is a demo of a social platform with geolocation features that brings people a new way of collaboration.

David 0 Oct 31, 2021
Modern and elegant test framework for Flutter, inspired by Cypress

flutter_modern_test: Modern, elegant and productive test framework for Flutter, inspired by Cypress GitHub: https://github.com/fzyzcjy/flutter_modern_

fzyzcjy 14 Oct 19, 2022
Ethers: A dart library that connects to interact with the Ethereum blockchain and inspired by ethers.js

Ethers For Flutter Ethers is a dart library that connects to interact with the Ethereum blockchain and inspired by ethers.js. Thanks to web3dart which

Hanggi 12 Oct 30, 2022
Dependency Injection oversimplified. Inspired by Koin, with focus on scopes.

Dependency Injection oversimplified. Inspired by Koin, with focus on scopes. Features Define your dependencies in a syntax as close to DSL as possible

TamΓ‘s Barta 1 Dec 5, 2022
A mock library for Dart inspired by mockito

?? mocktail This repository contains mocking libraries for Dart inspired by mockito. package:mocktail A Dart mocking library which simplifies mocking

Felix Angelov 430 Dec 25, 2022
Releases for the Delta-y app: A scrum-inspired personal productivity app for data-nerds with goals

Delta-y Releases This repository contains the public releases for the Delta-y app, which is currently closed source. Resources delta-y-flyer.pdf Video

Delta-y 2 Dec 10, 2021
Medikkare is a doctor appointment app. Written in Flutter. Inspired by Dribbble.

Medikkare is a doctor appointment app. Written in Flutter. Inspired by Dribbble.

Hyunjae Park 76 Jan 1, 2023
Pet Adoption App concept built with Flutter inspired by Aman UX

?? Adopt Me ?? Pet Adoption App concept built with Flutter inspired by Aman UX.

martinoyovo 38 Dec 8, 2022
Lime client built using flutter

** This project ist OUT OF DATE and I am currently not able to maintain it ** What we are building Lime is a social media app, which allows you to pos

Sebastian Sellmair 376 Dec 24, 2022
A fully cross-platform wrap of the Matomo tracking client for Flutter, using the Matomo API.

A fully cross-platform wrap of the Matomo tracking client for Flutter, using the Matomo Tracking API.

Floating Dartists 12 Jan 8, 2023
A beautiful and cross platform NHentai Client, Support desktop and mobile phone

A beautiful and cross platform NHentai Client. Support desktop and mobile phone (Mac/Windows/Linux/Android/IOS).

null 324 Dec 29, 2022