Comments (3)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from retrofit.dart.
This should really be added. We should be able to parse the headers as well
Future<Response<List<Task>>> getTasks()
Response could have a data
field and dioResponse
field
from retrofit.dart.
This could be used to just parse the response as well without extra json parsing
An extra model:
class RetrofitResponse<T> {
final Response dioResponse;
final T data;
const RetrofitResponse(this.dioResponse, this.data);
}
The code for generator.dart
if(returnType.toString() == "RetrofitResponse<void>") {
blocks.add(
refer("await $_dioVar.request")
.call([path], namedArguments, [refer("void")])
.assignFinal(_resultVar, refer("Response<dynamic>"))
.statement,
);
blocks.add(Code("""
final value = RetrofitResponse<void>($_resultVar, null);
return Future.value(value);
"""));
}
The example
@GET("/single-task")
Future<RetrofitResponse<void>> getTasksWithResponse2();
from retrofit.dart.
Related Issues (20)
- please use analyzer 6.0 HOT 2
- Does retrofitGenerator not support multipartFile? HOT 2
- Migrate to the official package "logging" for logging
- how do we send PartMap as in Android lib? Or how can I set dynamic name for each file in the list of files? HOT 1
- to GET a List of objects, do i really have to create an extra dummy class and convert later to a List again? HOT 4
- Extend Retrofit & Freezed Serialization with Custom fromJson for Generic Types HOT 26
- [ Change some URLs at execution ] HOT 5
- [retrofit_generator] Null check operator used on a null value HOT 1
- [retrofit_generator] Null check operator used on a null value again HOT 3
- please fix returning http code 302 HOT 1
- [Question] How to get various models from one retrofit client? HOT 2
- Support record returns HOT 3
- Add methods to the API class HOT 2
- Wrong generated code with generic type as argument HOT 4
- only debug mode occur error HOT 1
- Error: Couldn't find constructor 'List.fromJson'. HOT 1
- Object not converted to Json HOT 4
- Add nested url's support
- Use 'const' for final variables initialized to a constant value. Try replacing 'final' with 'const'. HOT 5
- Generate Deserilazeble code with Parser.FlutterCombine
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retrofit.dart.