PackageTrack
Sign in Get early access

retrofit_generator

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

10.2.9 414K downloads/mo #574 most downloaded on pub.dev trevorwang/retrofit.dart

What this package is like to depend on

Last release 5 days ago

19 Aug 2026

Ships fairly regularly

a new release about every 4 weeks

Some releases are documented

notes for 88 of 161 stable releases

2 versions withdrawn

withdrawn after publishing

7 years old

166 releases · first in 2019

17 releases in the last 12 months

see the full history below

Release timeline

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

Releases

latest 60 of 166
  1. 10.2.9 19 Aug 2026
    Release notes

    fix(generator): use utf8.decoder.bind for string streams to prevent m…

    …alformed chunk exceptions (#931)

    Open source →
  2. 10.2.8 21 Jul 2026
    Release notes

    fix: keep the request future in the stream pipeline for ResponseType.…

    …stream (#921)

    Closes #907. Generated methods for @DioResponseType(ResponseType.stream) awaited
    the request future inside an async* body, so if the subscription was cancelled
    while suspended at the await, a later error from that future could escape the
    stream listener lifecycle and surface as an unhandled zone error. Emit
    _dio.fetch<ResponseBody>(...) without await and expand it through
    asStream().asyncExpand(...) instead, keeping the future inside the stream.

    Open source →
  3. 10.2.7 16 Jun 2026
    Release notes

    Fix map value deserialization for generic type-parameter models in ge…

    …nerator output (#916)

    * Initial plan

    * fix(generator): handle type parameters in map generic value deserialization

    Agent-Logs-Url: https://github.com/trevorwang/retrofit.dart/sessions/e48c0b86-23bc-473a-89ba-a5a699fabd2a

    Co-authored-by: trevorwang <[email protected]>

    ---------

    Co-authored-by: copilot-swe-agent[bot] <[email protected]>
    Co-authored-by: trevorwang <[email protected]>

    Open source →
  4. 10.2.6 08 May 2026
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v10.2.5...v10.2.6

    Open source →
    Release notes
    • Allow analyzer 13.0.0.
    Open source →
  5. 10.2.5 10 Apr 2026

    Nothing published for this version

  6. 10.2.4 07 Apr 2026
    Release notes

    What's Changed

    • Allow new analyzer and temp delete lean_builder form dependencies by @Carapacik in #897
    • build(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 by @dependabot[bot] in #853
    • build(deps-dev): bump lodash from 4.17.21 to 4.17.23 by @dependabot[bot] in #888
    • Release retrofit 4.9.1: Fix ParseErrorLogger signature for backward compatibility by @Copilot in #883
    • Fix: add warning for missing dart:convert import when using ResponseType.stream by @japanshah17 in #905

    New Contributors

    Full Changelog: v10.2.3...v10.2.4

    Open source →
    Release notes
    • Allow analyzer 12.0.0.
    Open source →
  7. 10.2.3 10 Feb 2026
    Release notes

    Document analyzer 9.x compatibility fix in CHANGELOG (#875)

    * Initial plan

    * Update CHANGELOG to document analyzer 9.0.0 compatibility fix

    Co-authored-by: trevorwang <[email protected]>

    * Clarify analyzer 9.x compatibility in CHANGELOG (supports all 9.x versions)

    Co-authored-by: trevorwang <[email protected]>

    ---------

    Co-authored-by: copilot-swe-agent[bot] <[email protected]>
    Co-authored-by: trevorwang <[email protected]>
    Co-authored-by: Trevor Wang <[email protected]>

    Open source →
    Release notes
    • Allow analyzer 10.0.0
    Open source →
  8. 10.2.1 20 Dec 2025
    Release notes
    • Fix analyzer 9.x compatibility: Remove deprecated Element2 API usage that caused build failures with analyzer 9.0+
    • Support analyzer '>=8.0.0 <10.0.0' (supports all 8.x and 9.x versions)
    • Migrate from deprecated analyzer Element2 APIs to stable Element APIs
    Open source →
  9. 10.2.0 20 Nov 2025
    Release notes
    • Extend analyzer dependency range to support analyzer 9.0.0 ('>=7.7.1 <10.0.0')
    • Note: Full analyzer 9.0.0 API migration is pending. For now, the package declares compatibility but may require dependency_overrides to resolve to analyzer 8.x until all dependencies are updated
    • Add Response parameter to logError response data parsing callback
    • Add format_output builder option to control generation of // dart format off/on comments (default: true)
      • Set format_output: false in build.yaml to omit format suppressing comments
      • This allows combining retrofit with other generators (like riverpod) in a more predictable way
    Open source →
  10. 10.1.4 10 Nov 2025

    Nothing published for this version

  11. 10.1.3 07 Nov 2025

    Nothing published for this version

  12. 10.1.2 29 Oct 2025

    Nothing published for this version

  13. 10.1.1 27 Oct 2025

    Nothing published for this version

  14. 10.1.0 26 Oct 2025
    Release notes
    • Add lean_builder as a dependency to support experimental lean_builder integration
    • Fix package validation errors for lean_builder imports
    • Prepare infrastructure for optional lean_builder support
    Open source →
  15. 10.0.6 30 Sep 2025
    Release notes
    • Update protobuf to 5.0.0
    Open source →
  16. 10.0.5 07 Sep 2025
    Release notes
    • Allow build 4.0.0.
    Open source →
  17. 10.0.4 02 Sep 2025

    Nothing published for this version

  18. 10.0.2 07 Aug 2025
    Release notes
    • Format generated code with default DartFormatter
    • Add dart format off and dart format on comments to generated code
    Open source →
  19. 10.0.1 29 Jul 2025
    Release notes
    • Fix dependencies versions
    Open source →
  20. 10.0.0 16 Jul 2025
    Release notes
    • Migrate to Element2
    • Updates minimum supported SDK version to Dart 3.8
    Open source →
  21. 9.7.0 09 Jul 2025
    Release notes
    • Upgrade build_runner to 2.5.4
    Open source →
  22. 9.6.0 09 Jul 2025
    Release notes
    • Updates minimum supported SDK version to Dart 3.6
    Open source →
  23. 9.3.0 30 Jun 2025
    Release notes
    • Added @BodyExtra annotation: Add individual fields to request body without defining complete DTO classes

      • Support for adding dynamic fields to existing request bodies
      • expand parameter (default: false) to control object field flattening behavior

      Example(Combine fields):

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

      Request body result:

      {"id": 123, "value": "some value"}
      

      Example(Combine objects):

      // pseudocode
      class User {
        int userId;
        String userName;
      }
      
      class Settings {
        int a;
        int b;
      }
      
      @http.POST('/path/')
      Future<String> updateValue(
        @BodyExtra('user', expand: true) User user, 
        @BodyExtra('settings', expand: true) Settings settings,
      );
      

      Request body result:

      {"userId": 123, "userName": "hhh", "a": 1, "b": 2}
      
    Open source →
  24. 9.2.0 11 May 2025
    Release notes
    • Update protobuf version to 4.0.0
    Open source →
  25. 9.1.9 09 Feb 2025
    Release notes
    • Fixed issue with @Part annotation with toJson() enum values.

      Example:

      import 'package:json_annotation/json_annotation.dart';
      
      @JsonEnum()
      enum TestEnumWithToJson { 
        @JsonValue('A')
        A('A'), 
        @JsonValue('B')
        B('B'); 
      
        const TestEnumWithToJson(this.json);
        
        final String? json;
      
        String? toJson() => json;
      }
      
      @RestApi()
      abstract class TestModelList {
        @POST('/')
        Future<void> testEnumWithToJsonType(@Part() TestEnumWithToJson enumValue);
      }
      
    Open source →
  26. 9.1.8 09 Feb 2025
    Release notes
    • Fixed bug of callAdapter using yield/return incorrectly

    • Fixed issue which generated invalid code for the same path parameter appears multiple times.

      Example:

      @GET('/image/{imageType}/{id}/{id}_XL.png')
      Future<HttpResponse<dynamic>> getImage(
        @Path('imageType') ImageType imageType,
        @Path('id') String id,
      );
      
    Open source →
  27. 9.1.7 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<Either<ApiError, User>> getTasks();
      }
    
    Open source →
  28. 9.1.6 30 Dec 2024 withdrawn
    Release notes
    • Update analyzer, dart_style and source_gen dependencies to allow upper versions
    Open source →
  29. 9.1.5 14 Nov 2024
    Release notes
    • Add support for nested object of non-primitive types in TypedExtras.

      Example :

      @RestApi()
      abstract class TypedExtrasTest {
        @DummyTypedExtras(
          id: '1234',
          config: Config(
            date: '24-10-2024',
            type: 'analytics',
            shouldReplace: true,
            subConfig: {'date': '24-11-2025'},
          ),
        )
        @GET('path')
        Future<void> list();
      }
      
    Open source →
  30. 9.1.4 28 Oct 2024

    Nothing published for this version

  31. 9.1.3 15 Oct 2024
    Release notes
    • Add support for multiple TypedExtras.

      Example :

      @TypedExtrasSubClass(
        id: 'abcd',
        fileType: FileType.json,
        destinations: [Destination.remote]
      )
      @AnotherTypedExtrasSubClass(
        state: 'Ohio',
        destinations: [Destination.remote]
      )
      @http.POST('/path/')
      Future<String> myMethod();
      
    Open source →
  32. 9.1.2 11 Sep 2024
    Release notes
    • Support passing Enums into TypedExtras.

      Example :

      @TypedExtrasSubClass(
        id: 'abcd',
        fileType: FileType.json,
        destinations: [Destination.remote]
      )
      @http.POST('/path/')
      Future<String> myMethod();
      
    Open source →
  33. 9.1.1 08 Sep 2024

    Nothing published for this version

  34. 9.1.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 →
  35. 9.0.0 03 Sep 2024
    Release notes
    • Require Dart 3.3
    • Fix issue with deprecated getDisplayString(withNullability: true)
    • Update analyzer: ^6.5.0
    • Update lints: ^4.0.0 and fix issues
    • Remove tuple dependency
    Open source →
  36. 8.2.1 29 Aug 2024

    Nothing published for this version

  37. 8.2.0 13 Aug 2024

    Nothing published for this version

  38. 8.1.2 12 Jul 2024

    Nothing published for this version

  39. 8.1.1 03 Jul 2024

    Nothing published for this version

  40. 8.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 →
  41. 8.0.6 16 Dec 2023
    Release notes
    • @useResult
    Open source →
  42. 8.0.5 06 Dec 2023
    Release notes
    • fix #627 where generic argument constructors on any class not directly marked with @JsonSerializable(genericArgumentFactories: true)

    • fix some typos in this changelog.

    Open source →
  43. 8.0.4 10 Nov 2023

    Nothing published for this version

  44. 8.0.3 28 Oct 2023

    Nothing published for this version

  45. 8.0.2 23 Oct 2023
    Release notes
    • fix #630 Null check operator used on a null value
    Open source →
  46. 8.0.1 12 Oct 2023
    Release notes
    • Add option class-name to customize the name of retrofit generator
    Open source →
  47. 8.0.0 02 Oct 2023
    Release notes
    • Add protobuf support
    • Add PreventNullToAbsent annotation to allow null sent to server
    Open source →
  48. 7.0.8 05 Jul 2023
    Release notes
    • Use toJson() instead of .name if enums have toJson().
    Open source →
  49. 7.0.7 29 Jun 2023
    Release notes
    • Enums return types generated iterating over the enum values instead of calling .toJson() method
    • Enums as query parameters generated with .name instead of toJson()
    Open source →
  50. 7.0.6 27 Jun 2023
    Release notes
    • Fix DateTime.toIso8601String() issue #586
    Open source →
  51. 7.0.5 27 Jun 2023

    Nothing published for this version

  52. 7.0.4 27 Jun 2023 withdrawn

    Nothing published for this version

  53. 7.0.3 27 Jun 2023
    Release notes
    • Add support for analyzer 6.0.0
    Open source →
  54. 7.0.2 25 Jun 2023
    Release notes
    • Fixed generation of DateTime used as @Query parameters (now it is converted to String using toIso8601String)
    Open source →
  55. 7.0.1 17 May 2023
    Release notes
    • Rename retrofit to retrofit_generator in build.yaml fix for build_runner ^2.4.4
    • Add topics
    Open source →
  56. 7.0.1+1 20 Jun 2023

    Nothing published for this version

  57. 7.0.0 16 May 2023
    Release notes
    • Fix deprecated warnings with analyzer 5.12.0
    • [BREAKING CHANGE] Require Dart >= 2.19 for new analyzer
    Open source →
  58. 6.0.0 09 Mar 2023
    Release notes
    • [BREAKING CHANGE] Update min Dart sdk to 2.18
    • Update example
    • Fix link in readme
    Open source →
  59. 6.0.0+1 10 Mar 2023

    Nothing published for this version

  60. 6.0.0+2 18 Apr 2023

    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