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.08k stars 246 forks source link

Future<Either<L,R>> Response type using dartz packages #518

Open basnetjiten opened 1 year ago

basnetjiten commented 1 year ago

is it possible to use Response type using a dartz package to return response type of following:

GET("/tasks") Future<Either<Left,Task>> getTasks(@Header("Content-Type") String contentType );

If there is anything documented on how to use it, would be very helpful. Thanks 🙏

BWhiteApps commented 1 year ago

@basnetjiten did you ever find a solution to this?

trevorwang commented 1 year ago

retrofit.dart depends on json_serializable to handle the serialization

Please refer https://github.com/google/json_serializable.dart/blob/master/example/lib/json_converter_example.dart

it would be helpful