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
won
2020-12-01 15:51:00 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
e6a12f143a1e21dffc46a3110b984c01c2b9de8b
e6a12f14
2 parents
1a06fad6
fb1f511f
Merge branch 'master' into translate_korean
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
20 deletions
CHANGELOG.md
lib/get_connect/connect.dart
lib/get_connect/http/src/http.dart
lib/get_connect/http/src/multipart/form_data.dart
lib/get_connect/http/src/request/request.dart
lib/get_navigation/src/root/get_cupertino_app.dart
lib/get_navigation/src/root/get_material_app.dart
pubspec.yaml
CHANGELOG.md
View file @
e6a12f1
## [3.21.2]
-
Fix GetConnect.request returning a PUT request
## [3.21.1]
-
Allow null body to POST method on GetConnect
...
...
lib/get_connect/connect.dart
View file @
e6a12f1
...
...
@@ -110,7 +110,7 @@ class GetConnect extends GetConnectInterface {
Decoder
<
T
>
decoder
,
})
{
_checkIfDisposed
();
return
httpClient
.
get
(
return
httpClient
.
get
<
T
>
(
url
,
headers:
headers
,
contentType:
contentType
,
...
...
@@ -149,7 +149,7 @@ class GetConnect extends GetConnectInterface {
Decoder
<
T
>
decoder
,
})
{
_checkIfDisposed
();
return
httpClient
.
put
(
return
httpClient
.
put
<
T
>
(
url
,
body:
body
,
headers:
headers
,
...
...
@@ -170,8 +170,9 @@ class GetConnect extends GetConnectInterface {
Decoder
<
T
>
decoder
,
})
{
_checkIfDisposed
();
return
httpClient
.
put
(
return
httpClient
.
request
<
T
>
(
url
,
method
,
body:
body
,
headers:
headers
,
contentType:
contentType
,
...
...
lib/get_connect/http/src/http.dart
View file @
e6a12f1
...
...
@@ -127,13 +127,14 @@ class GetHttpClient {
final
uri
=
_createUri
(
url
,
query
);
return
Request
(
return
Request
<
T
>
(
method:
method
,
url:
uri
,
headers:
headers
,
bodyBytes:
bodyStream
,
followRedirects:
followRedirects
,
maxRedirects:
maxRedirects
,
decoder:
decoder
,
);
}
...
...
@@ -168,7 +169,7 @@ class GetHttpClient {
if
(
HttpStatus
.
unauthorized
==
response
.
statusCode
&&
_modifier
.
authenticator
!=
null
&&
requestNumber
<=
maxAuthRetries
)
{
return
_performRequest
(
return
_performRequest
<
T
>
(
handler
,
authenticate:
true
,
requestNumber:
requestNumber
+
1
,
...
...
@@ -235,7 +236,7 @@ class GetHttpClient {
body
,
'post'
,
query
,
decoder
,
decoder
??
(
defaultDecoder
as
Decoder
<
T
>)
,
);
}
...
...
@@ -247,7 +248,14 @@ class GetHttpClient {
@required
Map
<
String
,
dynamic
>
query
,
Decoder
<
T
>
decoder
,
})
{
return
_requestWithBody
(
url
,
contentType
,
body
,
method
,
query
,
decoder
);
return
_requestWithBody
<
T
>(
url
,
contentType
,
body
,
method
,
query
,
decoder
??
(
defaultDecoder
as
Decoder
<
T
>),
);
}
Future
<
Request
<
T
>>
_put
<
T
>(
...
...
@@ -257,7 +265,14 @@ class GetHttpClient {
@required
Map
<
String
,
dynamic
>
query
,
Decoder
<
T
>
decoder
,
})
{
return
_requestWithBody
(
url
,
contentType
,
body
,
'put'
,
query
,
decoder
);
return
_requestWithBody
<
T
>(
url
,
contentType
,
body
,
'put'
,
query
,
decoder
??
(
defaultDecoder
as
Decoder
<
T
>),
);
}
Request
<
T
>
_delete
<
T
>(
...
...
@@ -271,7 +286,11 @@ class GetHttpClient {
final
uri
=
_createUri
(
url
,
query
);
return
Request
<
T
>(
method:
'delete'
,
url:
uri
,
headers:
headers
,
decoder:
decoder
);
method:
'delete'
,
url:
uri
,
headers:
headers
,
decoder:
decoder
??
(
defaultDecoder
as
Decoder
<
T
>),
);
}
Future
<
Response
<
T
>>
post
<
T
>(
...
...
@@ -312,15 +331,15 @@ class GetHttpClient {
Future
<
Response
<
T
>>
request
<
T
>(
String
url
,
String
method
,
{
Map
<
String
,
dynamic
>
body
,
dynamic
body
,
String
contentType
,
Map
<
String
,
String
>
headers
,
Map
<
String
,
dynamic
>
query
,
Decoder
<
T
>
decoder
,
})
async
{
try
{
var
response
=
await
_performRequest
(
()
=>
_request
(
var
response
=
await
_performRequest
<
T
>(
()
=>
_request
<
T
>(
url
,
method
,
contentType:
contentType
,
...
...
@@ -353,8 +372,8 @@ class GetHttpClient {
Decoder
<
T
>
decoder
,
})
async
{
try
{
var
response
=
await
_performRequest
(
()
=>
_put
(
var
response
=
await
_performRequest
<
T
>(
()
=>
_put
<
T
>(
url
,
contentType:
contentType
,
query:
query
,
...
...
@@ -411,7 +430,7 @@ class GetHttpClient {
Decoder
<
T
>
decoder
,
})
async
{
try
{
var
response
=
await
_performRequest
(
var
response
=
await
_performRequest
<
T
>
(
()
async
=>
_delete
<
T
>(
url
,
contentType
,
query
,
decoder
),
headers:
headers
,
);
...
...
lib/get_connect/http/src/multipart/form_data.dart
View file @
e6a12f1
...
...
@@ -10,9 +10,13 @@ class FormData {
FormData
(
Map
<
String
,
dynamic
>
map
)
:
boundary
=
_getBoundary
()
{
urlEncode
(
map
,
''
,
false
,
(
key
,
value
)
{
if
(
value
==
null
)
return
;
(
value
is
MultipartFile
)
?
files
.
add
(
MapEntry
(
key
,
value
))
:
fields
.
add
(
MapEntry
(
key
,
value
.
toString
()));
if
(
value
is
MultipartFile
)
{
files
.
add
(
MapEntry
(
key
,
value
));
}
else
if
(
value
is
List
<
MultipartFile
>)
{
files
.
addAll
(
value
.
map
((
e
)
=>
MapEntry
(
key
,
e
)));
}
else
{
fields
.
add
(
MapEntry
(
key
,
value
.
toString
()));
}
return
;
});
}
...
...
lib/get_connect/http/src/request/request.dart
View file @
e6a12f1
...
...
@@ -54,7 +54,7 @@ class Request<T> {
int
maxRedirects
=
4
,
FormData
files
,
bool
persistentConnection
=
true
,
final
Decoder
<
T
>
decoder
,
Decoder
<
T
>
decoder
,
})
{
assert
(
url
!=
null
);
assert
(
method
!=
null
);
...
...
lib/get_navigation/src/root/get_cupertino_app.dart
View file @
e6a12f1
...
...
@@ -204,6 +204,7 @@ class GetCupertinoApp extends StatelessWidget {
settings:
RouteSettings
(
name:
name
,
arguments:
null
),
curve:
unknownRoute
.
curve
,
opaque:
unknownRoute
.
opaque
,
routeName:
unknownRoute
.
name
,
customTransition:
unknownRoute
.
customTransition
,
binding:
unknownRoute
.
binding
,
bindings:
unknownRoute
.
bindings
,
...
...
@@ -223,6 +224,7 @@ class GetCupertinoApp extends StatelessWidget {
settings:
RouteSettings
(
name:
name
,
arguments:
null
),
curve:
match
.
route
.
curve
,
opaque:
match
.
route
.
opaque
,
routeName:
match
.
route
.
name
,
binding:
match
.
route
.
binding
,
bindings:
match
.
route
.
bindings
,
transitionDuration:
...
...
lib/get_navigation/src/root/get_material_app.dart
View file @
e6a12f1
...
...
@@ -215,6 +215,7 @@ class GetMaterialApp extends StatelessWidget {
settings:
RouteSettings
(
name:
name
,
arguments:
null
),
curve:
unknownRoute
.
curve
,
opaque:
unknownRoute
.
opaque
,
routeName:
unknownRoute
.
name
,
customTransition:
unknownRoute
.
customTransition
,
binding:
unknownRoute
.
binding
,
bindings:
unknownRoute
.
bindings
,
...
...
@@ -235,6 +236,7 @@ class GetMaterialApp extends StatelessWidget {
curve:
match
.
route
.
curve
,
opaque:
match
.
route
.
opaque
,
binding:
match
.
route
.
binding
,
routeName:
match
.
route
.
name
,
bindings:
match
.
route
.
bindings
,
transitionDuration:
(
match
.
route
.
transitionDuration
??
Get
.
defaultTransitionDuration
),
...
...
pubspec.yaml
View file @
e6a12f1
name
:
get
description
:
Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with GetX.
version
:
3.21.
1
version
:
3.21.
2
homepage
:
https://github.com/jonataslaw/getx
environment
:
...
...
Please
register
or
login
to post a comment