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 2026Releases
latest 60 of 63-
4.10.013 Aug 2026Release notes
Open source →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
-
4.9.228 Dec 2025Release notes
Open source →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
- @kryptonpust made their first contribution in #874
Full Changelog: retrofit-v4.9.1...retrofit-v4.9.2
-
4.9.120 Nov 2025Release notes
Open source →- Make Response parameter in ParseErrorLogger callback optional for backward compatibility
- The
responseparameter inlogErroris now a named optional parameter{Response? response} - This allows existing implementations without the response parameter to continue working
- The
- Make Response parameter in ParseErrorLogger callback optional for backward compatibility
-
4.9.003 Nov 2025 -
4.8.027 Oct 2025Release notes
Open source →- Add global headers support to @RestApi annotation
- This version is required for retrofit_generator 10.1.0+
-
4.7.330 Sep 2025Nothing published for this version
-
4.7.221 Aug 2025Release notes
Open source →- Add comments for each public methods
- Enable linter rules for public api docs
-
4.7.107 Aug 2025 -
4.7.029 Jul 2025 -
4.6.009 Jul 2025Nothing published for this version
-
4.5.030 Jun 2025Release notes
Open source →-
Added
@BodyExtraannotation 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"}
-
-
4.4.230 Dec 2024Release notes
Open source →-
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(); } -
-
4.4.108 Sep 2024Nothing published for this version
-
4.4.006 Sep 2024Release notes
Open source →-
Added
@TypedExtrasto 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);
-
-
4.3.003 Sep 2024 -
4.2.013 Aug 2024Nothing published for this version
-
4.1.003 Feb 2024Release notes
Open source →-
Added
@Extrasto pass extra options to dio requests, response, transformer and interceptors.Example :
@http.POST('/path/') Future<String> myMethod(@Extras() Map<String, dynamic> extras);
-
-
4.0.312 Oct 2023Nothing published for this version
-
4.0.202 Oct 2023Nothing published for this version
-
4.0.113 Feb 2023Nothing published for this version
-
4.0.013 Feb 2023 withdrawn -
3.3.106 Oct 2022Nothing published for this version
-
3.3.006 Oct 2022 withdrawn -
3.0.203 Oct 2022 withdrawn -
3.0.2+106 Oct 2022Nothing published for this version
-
3.0.124 Dec 2021 -
3.0.1+107 Feb 2022 -
3.0.010 Nov 2021 -
2.2.009 Nov 2021 -
2.1.002 Nov 2021Nothing published for this version
-
2.0.117 Jul 2021 -
2.0.016 May 2021Nothing published for this version
-
2.0.0-beta118 Mar 2021 pre-release -
1.3.420 Apr 2020 -
1.3.4+104 Oct 2020Nothing published for this version
-
1.3.314 Apr 2020Release notes
Open source →- [BREAKING CHANGE] Change
Part's params to named parameters from optional ones.
- [BREAKING CHANGE] Change
-
1.3.214 Apr 2020 -
1.3.124 Feb 2020 -
1.3.1+124 Feb 2020Nothing published for this version
-
1.3.1-dev23 Feb 2020 pre-releaseNothing published for this version
-
1.3.015 Feb 2020 -
1.2.005 Feb 2020 -
1.1.002 Feb 2020Release notes
Open source →- [BREAKING CHANGE] Add new
Partannotation to sendmultipart/form-datarequest.Fieldwill not be used in the future, please usePartinstead.
- [BREAKING CHANGE] Add new
-
1.1.0+102 Feb 2020Nothing published for this version
-
1.0.130 Sep 2019 -
1.0.1+101 Nov 2019Nothing published for this version
-
1.0.023 Sep 2019 -
0.6.317 Sep 2019Release notes
Open source →-
Added
autoCastResponseoption toRestApiand allMethodannotations (default :true) -
Added
auto_cast_responseto builder options.-
Users can specify this in
build.yamlas global defaulttargets: $default: sources: ["lib/**"] builders: retrofit_generator|retrofit: enabled: true options: auto_cast_response: true
-
-
-
0.6.227 Aug 2019Release notes
Open source →- fix: fix bad cast exception (#47)
- add CancelToken, SendProgress, and ReceiveProgress (#46)
-
0.6.2+105 Sep 2019Nothing published for this version
-
0.6.015 Aug 2019Release notes
Open source →- [BREAKING CHANGE] only works dart 2.2.2 and above
- Added support to multiple clients with different base urls.
-
0.5.012 Aug 2019Release notes
Open source →- Fixed analysis report
use
retrofit.dartinstead ofhttp.dartanddio.dartto import classes
- Fixed analysis report
use
-
0.4.312 Aug 2019 -
0.3.109 Aug 2019Nothing published for this version
-
0.3.011 Jul 2019Nothing published for this version
-
0.2.308 Jul 2019Release notes
Open source →- Added optional parameter
fileNamein@Fieldannotation for custom file name
- Added optional parameter
-
0.2.219 Jun 2019 -
0.2.027 May 2019Release notes
Open source →-
Added
@Extrato 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
nullcheck withArgumentError.checkNotNullfor required parameters -
Now SuperClasses can use forwarding/redirecting constructors instead of static
instance()methodExample :
@RestApi(baseUrl: "https://httpbin.org/") abstract class RestClient { /// Forwarding constructor factory RestClient([Dio dio]) = _RestClient; }
-
-
0.1.205 May 2019Nothing published for this version
-
0.1.123 Apr 2019Nothing published for this version