NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev
pub.dev, #579 most downloaded on pub.dev
retrofit generator is an dio client generator using source_gen and inspired by Chopper and Retrofit.
Latest stable
10.3.3
Last release 21 days ago
01 Nov 2026
Ships fairly regularly
a new release about every 4 weeks
Most releases are documented
notes for 50 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
8 years old
171 releases · first in 2019
Drag across the ruler to compare, or tap a release to open it.
Update built_collection to support 6 version
Update built_collection to support 6 version (#941)
* Update built_collection to support 6 version
* Update changelog
Support build 5 version by @Carapacik in https://github.com/trevorwang/retrofit.dart/pull/940
build 5 version by @Carapacik in https://github.com/trevorwang/retrofit.dart/pull/940Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.2.12...v10.3.2
build versions >=4.0.2 <6.0.0.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
fix(generator): prepend ignore_for_file: type=lint
fix(generator): prepend ignore_for_file: type=lint (#937)
* fix(generator): prepend ignore_for_file: type=lint
* Update generator_test_src.dart
[retrofit_generator] Support analyzer 14
[retrofit_generator] Support analyzer 14 (#935)
Co-authored-by: Roman Laptev <laptev.roman6@rwb.ru>
fix(generator): use utf8.decoder.bind for string streams to prevent m…
fix(generator): use utf8.decoder.bind for string streams to prevent m…
…alformed chunk exceptions (#931)
fix: keep the request future in the stream pipeline for ResponseType.…
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.
Fix map value deserialization for generic type-parameter models in ge…
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 <121966+trevorwang@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trevorwang <121966+trevorwang@users.noreply.github.com>
chore: add avoid_redundant_argument_values to analyzer ignores by @gktirkha in https://github.com/trevorwang/retrofit.dart/pull/913
analyzer 13.0.0 by @Carapacik in https://github.com/trevorwang/retrofit.dart/pull/912Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.2.5...v10.2.6
Nothing published for this version
Allow new analyzer and temp delete lean_builder form dependencies by @Carapacik in https://github.com/trevorwang/retrofit.dart/pull/897
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.2.3...v10.2.4
Document analyzer 9.x compatibility fix in CHANGELOG
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 <121966+trevorwang@users.noreply.github.com>
* Clarify analyzer 9.x compatibility in CHANGELOG (supports all 9.x versions)
Co-authored-by: trevorwang <121966+trevorwang@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trevorwang <121966+trevorwang@users.noreply.github.com>
Co-authored-by: Trevor Wang <trevor.wang@qq.com>
Fix analyzer 9.x compatibility: Remove deprecated Element2 API usage that caused build failures with analyzer 9.0+
'>=8.0.0 <10.0.0' (supports all 8.x and 9.x versions)Add Response parameter to ParseErrorLogger callback by @DPohorielov in https://github.com/trevorwang/retrofit.dart/pull/859
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.1.4...v10.2.0
format_output builder option to control generation of // dart format off/on comments (default: true)
format_output: false in build.yaml to omit format suppressing commentsFix Map cast to preserve nullable value types by @Copilot in https://github.com/trevorwang/retrofit.dart/pull/850
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.1.3...v10.1.4
Add support for Map in @Part annotation for dynamic multipart field names by @Copilot in https://github.com/trevorwang/retrofit.dart/pull/848
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.1.2...v10.1.3
Add @PartMap annotation for runtime contentType in multipart uploads by @Copilot in https://github.com/trevorwang/retrofit.dart/pull/831
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.1.1...v10.1.2
Fix: Support extension types in query parameters by @Copilot in https://github.com/trevorwang/retrofit.dart/pull/829
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.1.0...v10.1.1
Update protobuf to 5.0.0 by @Carapacik in https://github.com/trevorwang/retrofit.dart/pull/798
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.0.6...v10.1.0
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.0.6...v10.1.0
fix: Fix CallAdapter with nullable types generation issue by @Hinageshi in https://github.com/trevorwang/retrofit.dart/pull/793
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v10.0.5...v10.0.6
- Allow build 4.0.0.
Add code coverage support and Coveralls integration by @Copilot in https://github.com/trevorwang/retrofit.dart/pull/788
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/v.10.0.3...v10.0.4
update tag format by @trevorwang in https://github.com/trevorwang/retrofit.dart/pull/778
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/10.0.1...v10.0.2
dart format off and dart format on comments to generated code- Fix dependencies versions
Add CodeQL workflow for GitHub code scanning by @lgtm-com[bot] in https://github.com/trevorwang/retrofit.dart/pull/519
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/9.7.0...10.0.0
Element2Update pubspec.yaml by @trevorwang in https://github.com/trevorwang/retrofit.dart/pull/772
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/9.6.0...9.7.0
move enum value resolve from .name to .toString by @vasilich6107 in https://github.com/trevorwang/retrofit.dart/pull/768
build by @Carapacik in https://github.com/trevorwang/retrofit.dart/pull/769Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/9.3.0...9.6.0
Added @BodyExtra annotation: Add individual fields to request body without defining complete DTO classes
Added @BodyExtra annotation: Add individual fields to request body without defining complete DTO classes
expand parameter (default: false) to control object field flattening behaviorExample(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}
Support toJsonable Enum in Multipart by @dfdgsdfg in https://github.com/trevorwang/retrofit.dart/pull/744
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/9.1.9...9.2.0
Fixed issue with @Part annotation with toJson() enum values.
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);
}
Fixed bug of callAdapter using yield/return incorrectly
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,
);
Introduced CallAdapters, This feature allows adaptation of a Call with return type R into the type of T. e.g. Future to Future >
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();
}
Update analyzer, dart_style and source_gen dependencies to allow upper versions
analyzer, dart_style and source_gen dependencies to allow upper versionsAdd support for nested object of non-primitive types in TypedExtras.
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();
}
Nothing published for this version
Add Support for multiple TypedExtra subclasses. by @devRaphe in https://github.com/trevorwang/retrofit.dart/pull/714
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/9.1.2...9.1.3
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();
Feat: Support passing in enums into TypedExtras by @farmery in https://github.com/trevorwang/retrofit.dart/pull/708
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/9.1.1...9.1.2
Support passing Enums into TypedExtras.
Example :
@TypedExtrasSubClass(
id: 'abcd',
fileType: FileType.json,
destinations: [Destination.remote]
)
@http.POST('/path/')
Future<String> myMethod();
Format code, update examples, remove tuple by @Carapacik in https://github.com/trevorwang/retrofit.dart/pull/707
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/9.1.0...9.1.1
Feat: Enable passing in Extras using Custom Annotations by @farmery in https://github.com/trevorwang/retrofit.dart/pull/706
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/9.0.0...9.1.0
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);
Fix issue with deprecated getDisplayString(withNullability: true)
getDisplayString(withNullability: true)analyzer: ^6.5.0lints: ^4.0.0 and fix issuestuple dependencyNothing published for this version
feat(generator): Add ParseErrorLogger by @Sadhorsephile in https://github.com/trevorwang/retrofit.dart/pull/694
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/8.1.2...8.2.0
Nothing published for this version
Nothing published for this version
For constant null, declareFinal is replaced by declareConst by @emintolgahanpolat in https://github.com/trevorwang/retrofit.dart/pull/654
Full Changelog: https://github.com/trevorwang/retrofit.dart/compare/8.0.6...8.1.0
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);
- @useResult
fix #627 where generic argument constructors on any class not directly marked with @JsonSerializable(genericArgumentFactories: true)
fix #627 where generic argument constructors on any class not directly marked with @JsonSerializable(genericArgumentFactories: true)
fix some typos in this changelog.
Nothing published for this version
Nothing published for this version
fix #630 Null check operator used on a null value
Add option class-name to customize the name of retrofit generator
Add PreventNullToAbsent annotation to allow null sent to server
Use toJson() instead of .name if enums have toJson().
toJson() instead of .name if enums have toJson().Enums return types generated iterating over the enum values instead of calling .toJson() method
.toJson() method.name instead of toJson()Fix DateTime.toIso8601String() issue #586
Nothing published for this version
Nothing published for this version
- Add support for analyzer 6.0.0
Fixed generation of DateTime used as @Query parameters (now it is converted to String using toIso8601String)
DateTime used as @Query parameters (now it is converted to String using toIso8601String)Nothing published for this version
One column per quarter.