NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #597 most downloaded on pub.dev
retrofit generator is an dio client generator using source_gen and inspired by Chopper and Retrofit.
Last release 1 months ago
04 Sep 2026
Ships fairly regularly
a new release about every 4 weeks
Most releases are documented
notes for 41 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
8 years old
168 releases · first in 2019
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>
One column per quarter.
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 #913
analyzer 13.0.0 by @Carapacik in #912Full Changelog: v10.2.5...v10.2.6
Nothing published for this version
Allow new analyzer and temp delete lean_builder form dependencies by @Carapacik in #897
Full Changelog: 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)Extend analyzer dependency range to support analyzer 9.0.0 ('>=7.7.1 <10.0.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 commentsNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add lean_builder as a dependency to support experimental lean_builder integration
- Update protobuf to 5.0.0
protobuf to 5.0.0- Allow build 4.0.0.
Nothing published for this version
Format generated code with default DartFormatter
dart format off and dart format on comments to generated code- Fix dependencies versions
Updates minimum supported SDK version to Dart 3.8
Element2- Upgrade build_runner to 2.5.4
Updates minimum supported SDK version to Dart 3.6
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}
Update protobuf version to 4.0.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 TypedExtras.
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();
Support passing Enums into TypedExtras.
Support passing Enums into TypedExtras.
Example :
@TypedExtrasSubClass(
id: 'abcd',
fileType: FileType.json,
destinations: [Destination.remote]
)
@http.POST('/path/')
Future<String> myMethod();
Nothing published for this version
Added @TypedExtras to pass extra options to dio requests using custom annotations.
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
Nothing published for this version
Nothing published for this version
Nothing published for this version
Added @Extras to pass extra options to dio requests, response, transformer and interceptors.
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
Rename retrofit to retrofit_generator in build.yaml fix for build_runner ^2.4.4
retrofit to retrofit_generator in build.yaml fix for build_runner ^2.4.4[BREAKING CHANGE] Require Dart >= 2.19 for new analyzer
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →