Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
shawon1fb
2022-03-12 10:45:23 +0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
756e9bb092fc9a6c55bca1f400bc864b5ea07dab
756e9bb0
1 parent
b5ef10a6
response.copyWith method added
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
lib/get_connect/http/src/response/response.dart
lib/get_connect/http/src/response/response.dart
View file @
756e9bb
import
'dart:collection'
;
import
'dart:convert'
;
import
'../exceptions/exceptions.dart'
;
import
'../request/request.dart'
;
import
'../status/http_status.dart'
;
class
GraphQLResponse
<
T
>
extends
Response
<
T
>
{
final
List
<
GraphQLError
>?
graphQLErrors
;
GraphQLResponse
({
T
?
body
,
this
.
graphQLErrors
})
:
super
(
body:
body
);
GraphQLResponse
.
fromResponse
(
Response
res
)
:
graphQLErrors
=
null
,
super
(
...
...
@@ -30,6 +33,26 @@ class Response<T> {
this
.
body
,
});
Response
<
T
>
copyWith
({
Request
?
request
,
int
?
statusCode
,
Stream
<
List
<
int
>>?
bodyBytes
,
String
?
bodyString
,
String
?
statusText
,
Map
<
String
,
String
>?
headers
,
T
?
body
,
})
{
return
Response
<
T
>(
request:
request
??
this
.
request
,
statusCode:
statusCode
??
this
.
statusCode
,
bodyBytes:
bodyBytes
??
this
.
bodyBytes
,
bodyString:
bodyString
??
this
.
bodyString
,
statusText:
statusText
??
this
.
statusText
,
headers:
headers
??
this
.
headers
,
body:
body
??
this
.
body
,
);
}
/// The Http [Request] linked with this [Response].
final
Request
?
request
;
...
...
Please
register
or
login
to post a comment