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

[ How to cancel resquests that are waiting into an (Queued)Interceptor ? ] #668

Open Gobmichet opened 3 months ago

Gobmichet commented 3 months ago

Hi, Thanks for the work !

Expected behavior I'd want to cancel requests that are waiting in a QueuedInterceptor (Dio) on a certain error response. Like we see in the screenshot below, Dio allows that via a CancelToken() that we have to give into the .get() .post() .put()... requests. And then we can cancel those requests just calling : cancelToken.cancel('')

Screenshots Cancel

My problem is that i can't figure out how to achieve that with Retrofit over Dio ?

Any help would be much appreciated, Thanks in advance ;)