PackageTrack
Sign in Get early access

retrofit

retrofit.dart is an dio client generator using source_gen and inspired by Chopper and Retrofit.

4.10.0 504K downloads/mo #512 most downloaded on pub.dev trevorwang/retrofit.dart

What this package is like to depend on

Last release 11 days ago

13 Aug 2026

Release timing varies

gaps range from 9 days to 8 months

Most releases are documented

notes for 37 of 58 stable releases

3 versions withdrawn

withdrawn after publishing

7 years old

63 releases · first in 2019

6 releases in the last 12 months

see the full history below

Release timeline

63 releases · Apr 2019 to Aug 2026
2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 63
  1. 4.10.0 13 Aug 2026
    Release notes

    fix(generator): detect generated and abstract toJson on Freezed models (

    #927)

    lookUpMethod misses toJson when the Freezed part file is hidden from
    retrofit_generator. Treat a source fromJson factory as evidence that
    json_serializable generated toJson, and still look up mixin/abstract
    methods when they are visible.

    Fixes #914

    Open source →
  2. 4.9.2 28 Dec 2025
    Release notes

    What's Changed

    • Add dart_mappable parser support for type conversion by @Copilot in #847
    • Fix toJson detection for Freezed models using lookUpMethod2 by @Copilot in #860
    • Enhance error handling documentation in README by @farmery in #864
    • Support analyzer '>=8.0.0 <10.0.0' and update deprecated methods by @Carapacik in #863
    • Make Response parameter in ParseErrorLogger optional for backward compatibility by @Copilot in #865
    • Add format_output option to control dart format comments in generated code by @Copilot in #861
    • Update protobuf to 6.0.0 and update protobuf example by @Carapacik in #866
    • fix: added code generation logic for multipart datetime by @kryptonpust in #874
    • Fix streaming response handling and add SSE support by @westito in #881

    New Contributors

    Full Changelog: retrofit-v4.9.1...retrofit-v4.9.2

    Open source →
    Release notes
    • Add DartMappable parser support for dart_mappable package integration
    Open source →
  3. 4.9.1 20 Nov 2025
    Release notes
    • Make Response parameter in ParseErrorLogger callback optional for backward compatibility
      • The response parameter in logError is now a named optional parameter {Response? response}
      • This allows existing implementations without the response parameter to continue working
    Open source →
  4. 4.9.0 03 Nov 2025
    Release notes
    • Version bump to 4.9.0
    Open source →
  5. 4.8.0 27 Oct 2025
    Release notes
    • Add global headers support to @RestApi annotation
    • This version is required for retrofit_generator 10.1.0+
    Open source →
  6. 4.7.3 30 Sep 2025

    Nothing published for this version

  7. 4.7.2 21 Aug 2025
    Release notes
    • Add comments for each public methods
    • Enable linter rules for public api docs
    Open source →
  8. 4.7.1 07 Aug 2025
    Release notes
    • update to new tag format with prefix letter v
    Open source →
  9. 4.7.0 29 Jul 2025
    Release notes
    • Updates minimum supported SDK version to Dart 3.8.
    Open source →
  10. 4.6.0 09 Jul 2025

    Nothing published for this version

  11. 4.5.0 30 Jun 2025
    Release notes
    • Added @BodyExtra annotation to support adding individual fields to request body, enhancing flexibility and extensibility.

      Example :

      @http.POST('/path/')
      Future<String> updateValue(@BodyExtra('id') int id, @BodyExtra('value') String value);
      

      The request body will be:

      {"id": 123, "value": "some value"}
      
    Open source →
  12. 4.4.2 30 Dec 2024
    Release notes
    • Introduced CallAdapters, This feature allows adaptation of a Call with return type R into the type of T. e.g. Future<User> to Future<Result<User>>

      Code Example:

      class MyCallAdapter<T> extends CallAdapter<Future<T>, Future<Either<ApiError, T>>> {
        @override
        Future<Either<ApiError, T>> adapt(Future<T> Function() call) async {
          try {
            final response = await call();
            return Either.right(response);
          }
          catch (e) {
            return Either.left(ApiError(e))
          }
        }
      }
      
      @RestApi()
      abstract class RestClient {
        factory RestClient(Dio dio, {String? baseUrl}) = _RestClient;
    
        @UseCallAdapter(MyCallAdapter)
        @GET('/')
        Future<User> getTasks();
      }
    
    Open source →
  13. 4.4.1 08 Sep 2024

    Nothing published for this version

  14. 4.4.0 06 Sep 2024
    Release notes
    • Added @TypedExtras to pass extra options to dio requests using custom annotations.

      Example :

      @TypedExtrasSubClass(
        id: 'abcd',
        count: 5,
        shouldProceed: true,
      )
      @http.POST('/path/')
      Future<String> myMethod(@Extras() Map<String, dynamic> extras);
      
    Open source →
  15. 4.3.0 03 Sep 2024
    Release notes
    • Required Dart 2.19
    • Update README
    Open source →
  16. 4.2.0 13 Aug 2024

    Nothing published for this version

  17. 4.1.0 03 Feb 2024
    Release notes
    • Added @Extras to pass extra options to dio requests, response, transformer and interceptors.

      Example :

      @http.POST('/path/')
      Future<String> myMethod(@Extras() Map<String, dynamic> extras);
      
    Open source →
  18. 4.0.3 12 Oct 2023

    Nothing published for this version

  19. 4.0.2 02 Oct 2023

    Nothing published for this version

  20. 4.0.1 13 Feb 2023

    Nothing published for this version

  21. 4.0.0 13 Feb 2023 withdrawn
    Release notes
    • Update dio to ^5.0.0
    Open source →
  22. 3.3.1 06 Oct 2022

    Nothing published for this version

  23. 3.3.0 06 Oct 2022 withdrawn
    Release notes
    • remove autoCastResponse annotation
    Open source →
  24. 3.0.2 03 Oct 2022 withdrawn
    Release notes
    • add recommended dart lints to project
    Open source →
  25. 3.0.2+1 06 Oct 2022

    Nothing published for this version

  26. 3.0.1 24 Dec 2021
    Release notes
    • add multipart mime type (#437)
    Open source →
  27. 3.0.1+1 07 Feb 2022
    Release notes
    • fix pub warning
    Open source →
  28. 3.0.0 10 Nov 2021
    Release notes
    • add compute support
    Open source →
  29. 2.2.0 09 Nov 2021
    Release notes
    • rollback to dio
    • update dio to 4.0.1
    Open source →
  30. 2.1.0 02 Nov 2021

    Nothing published for this version

  31. 2.0.1 17 Jul 2021
    Release notes
    • add CacheControl
    Open source →
  32. 2.0.0 16 May 2021

    Nothing published for this version

  33. 2.0.0-beta1 18 Mar 2021 pre-release
    Release notes
    • Nullsafety support
    Open source →
  34. 1.3.4 20 Apr 2020
    Release notes
    • Add dart json mapper deserialize support
    Open source →
  35. 1.3.4+1 04 Oct 2020

    Nothing published for this version

  36. 1.3.3 14 Apr 2020
    Release notes
    • [BREAKING CHANGE] Change Part's params to named parameters from optional ones.
    Open source →
  37. 1.3.2 14 Apr 2020
    Release notes
    • Add contentType to Part annotation
    Open source →
  38. 1.3.1 24 Feb 2020
    Release notes
    • Add custom options support to each request
    • fix #132
    Open source →
  39. 1.3.1+1 24 Feb 2020

    Nothing published for this version

  40. 1.3.1-dev 23 Feb 2020 pre-release

    Nothing published for this version

  41. 1.3.0 15 Feb 2020
    Release notes
    • Bumped retrofit's SDK requirement to >=2.6.0
    Open source →
  42. 1.2.0 05 Feb 2020
    Release notes
    • Add HttpReponse to handle original response
    Open source →
  43. 1.1.0 02 Feb 2020
    Release notes
    • [BREAKING CHANGE] Add new Part annotation to send multipart/form-data request. Field will not be used in the future, please use Part instead.
    Open source →
  44. 1.1.0+1 02 Feb 2020

    Nothing published for this version

  45. 1.0.1 30 Sep 2019
    Release notes
    • Add dio response type support
    Open source →
  46. 1.0.1+1 01 Nov 2019

    Nothing published for this version

  47. 1.0.0 23 Sep 2019
    Release notes
    • Support dio 3.0
    Open source →
  48. 0.6.3 17 Sep 2019
    Release notes
    • Added autoCastResponse option to RestApi and all Method annotations (default : true)

    • Added auto_cast_response to builder options.

      • Users can specify this in build.yaml as global default

        targets:
          $default:
            sources: ["lib/**"]
            builders:
              retrofit_generator|retrofit:
                enabled: true
                options:
                  auto_cast_response: true
        
    Open source →
  49. 0.6.2 27 Aug 2019
    Release notes
    • fix: fix bad cast exception (#47)
    • add CancelToken, SendProgress, and ReceiveProgress (#46)
    Open source →
  50. 0.6.2+1 05 Sep 2019

    Nothing published for this version

  51. 0.6.0 15 Aug 2019
    Release notes
    • [BREAKING CHANGE] only works dart 2.2.2 and above
    • Added support to multiple clients with different base urls.
    Open source →
  52. 0.5.0 12 Aug 2019
    Release notes
    • Fixed analysis report use retrofit.dart instead of http.dart and dio.dart to import classes
    Open source →
  53. 0.4.3 12 Aug 2019
    Release notes
    • Updated docs and sample code
    Open source →
  54. 0.3.1 09 Aug 2019

    Nothing published for this version

  55. 0.3.0 11 Jul 2019

    Nothing published for this version

  56. 0.2.3 08 Jul 2019
    Release notes
    • Added optional parameter fileName in @Field annotation for custom file name
    Open source →
  57. 0.2.2 19 Jun 2019
    Release notes
    • add example
    Open source →
  58. 0.2.0 27 May 2019
    Release notes
    • Added @Extra to pass extra options to dio requests, response, transformer and interceptors.

      Example :

      @http.POST('/path/')
      @dio.Extra({'my_key':'my_value'})
      Future<String> myMethod();
      
    • Fixed general dart style and code conventions

    • Automatically null check with ArgumentError.checkNotNull for required parameters

    • Now SuperClasses can use forwarding/redirecting constructors instead of static instance() method

      Example :

      @RestApi(baseUrl: "https://httpbin.org/")
      abstract class RestClient {
          /// Forwarding constructor
          factory RestClient([Dio dio]) = _RestClient;
      }
      
    Open source →
  59. 0.1.2 05 May 2019

    Nothing published for this version

  60. 0.1.1 23 Apr 2019

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive