trevorwang / retrofit.dart

retrofit.dart is an dio client generator using source_gen and inspired by Chopper and Retrofit.
https://mings.in/retrofit.dart/
MIT License
1.06k stars 241 forks source link

feat: Add support @Extras() #648

Closed XuanTung95 closed 5 months ago

XuanTung95 commented 6 months ago

Add @Extras() to pass extra options to dio interceptors for each request as parameters. The code is mostly copy-pasted from the @Queries implementation. Fix https://github.com/trevorwang/retrofit.dart/issues/445

Usage is the same as @Queries

   @GET("/get")
   Future<String> foo(@Extras() Map<String, dynamic> extras)
trevorwang commented 6 months ago

Please fix the test issue

XuanTung95 commented 6 months ago

Hi @trevorwang

I updated both retrofit and retrofit_generator. The tests are failed because it could not find retrofit: ^4.1.0 which is not published yet. I changed to retrofit: path: ../retrofit in retrofit_generator so it can run the test.