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
Jonatas
2020-12-15 11:13:13 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d093b139417f8cd77aed3059f71f237c509460aa
d093b139
1 parent
e55b8baa
update to 3.23.0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
72 additions
and
18 deletions
CHANGELOG.md
lib/get_connect/http/src/http/io/http_request_io.dart
lib/get_connect/http/src/http/mock/http_request_mock.dart
lib/get_connect/http/src/http/utils/body_decoder.dart
lib/get_connect/sockets/sockets.dart
lib/get_connect/sockets/src/sockets_stub.dart
lib/get_state_manager/src/simple/get_responsive.dart
pubspec.yaml
CHANGELOG.md
View file @
d093b13
## [3.23.0]
-
Add GetResponsive (@SchabanBo)
-
Update tests, fix predicate for offNamedUntil (@vbuberen)
-
Added Urdu Version for Pakistani Developers (@UsamaSarwar)
-
Handle for List field with native datatype on GetConnect(@jasonlaw)
-
Added WillPopScope to defaultDialog (@rakeshlanjewar)
-
Fix optional query params not attach on createUri from GetConnect (@reinaldowebdev)
-
Effective Get.testMode from navigator on tests (@eduardoflorence)
-
Fix Navigator 2.0 on GetMaterialApp and CupertinoMaterialApp (@SchabanBo)
-
Added Middlewares with initial Routes (@SchabanBo)
-
Improve PT-br Docs (@eduardoflorence)
-
Added the allowSelfSigned parameter to GetSocket(@eduardoflorence)
-
Added Indonesian version to Indonesian Developers (@pratamatama)
## [3.22.2]
-
Fix overlayEntries is null on Master/Dev branch of Flutter
...
...
lib/get_connect/http/src/http/io/http_request_io.dart
View file @
d093b13
...
...
@@ -43,12 +43,6 @@ class HttpRequestImpl extends HttpRequestBase {
..
contentLength
=
requestBody
.
length
??
-
1
;
request
.
headers
.
forEach
(
ioRequest
.
headers
.
set
);
// var response = await stream.map((s) {
// received += s.length;
// print("${(received / total) * 100} %");
// return s;
// }).pipe(ioRequest) as io.HttpClientResponse;
var
response
=
await
stream
.
pipe
(
ioRequest
)
as
io
.
HttpClientResponse
;
var
headers
=
<
String
,
String
>{};
...
...
@@ -59,8 +53,6 @@ class HttpRequestImpl extends HttpRequestBase {
final
bodyBytes
=
BodyBytesStream
(
response
);
final
stringBody
=
await
bodyBytesToString
(
bodyBytes
,
headers
);
// response.headers.contentType.mimeType == 'application/json'
final
body
=
bodyDecoded
<
T
>(
request
,
stringBody
,
...
...
lib/get_connect/http/src/http/mock/http_request_mock.dart
0 → 100644
View file @
d093b13
import
'../../request/request.dart'
;
import
'../../response/response.dart'
;
import
'../interface/request_base.dart'
;
import
'../utils/body_decoder.dart'
;
typedef
MockClientHandler
=
Future
<
Response
>
Function
(
Request
request
);
class
MockClient
extends
HttpRequestBase
{
/// The handler for than transforms request on response
final
MockClientHandler
_handler
;
/// Creates a [MockClient] with a handler that receives [Request]s and sends
/// [Response]s.
MockClient
(
this
.
_handler
);
@override
Future
<
Response
<
T
>>
send
<
T
>(
Request
<
T
>
request
)
async
{
var
requestBody
=
await
request
.
bodyBytes
.
toBytes
();
var
bodyBytes
=
BodyBytesStream
.
fromBytes
(
requestBody
??
const
[]);
var
response
=
await
_handler
(
request
);
final
stringBody
=
await
bodyBytesToString
(
bodyBytes
,
response
.
headers
);
var
mimeType
=
response
.
headers
.
containsKey
(
'content-type'
)
?
response
.
headers
[
'content-type'
]
:
''
;
final
body
=
bodyDecoded
<
T
>(
request
,
stringBody
,
mimeType
,
);
return
Response
(
headers:
response
.
headers
,
request:
request
,
statusCode:
response
.
statusCode
,
statusText:
response
.
statusText
,
bodyBytes:
bodyBytes
,
body:
body
,
bodyString:
stringBody
,
);
}
@override
void
close
()
{
// TODO: implement close
}
}
...
...
lib/get_connect/http/src/http/utils/body_decoder.dart
View file @
d093b13
...
...
@@ -8,13 +8,15 @@ T bodyDecoded<T>(Request<T> request, String stringBody, String mimeType) {
T
body
;
var
bodyToDecode
;
if
(
mimeType
.
contains
(
'application/json'
))
{
if
(
mimeType
!=
null
&&
mimeType
.
contains
(
'application/json'
))
{
try
{
bodyToDecode
=
jsonDecode
(
stringBody
);
}
on
FormatException
catch
(
_
)
{
Get
.
log
(
'Cannot decode server response to json'
);
bodyToDecode
=
stringBody
;
}
}
else
{
bodyToDecode
=
stringBody
;
}
try
{
...
...
lib/get_connect/sockets/sockets.dart
View file @
d093b13
...
...
@@ -3,9 +3,7 @@ import 'src/sockets_stub.dart'
if
(
dart
.
library
.
io
)
'src/sockets_io.dart'
;
class
GetSocket
extends
BaseWebSocket
{
GetSocket
(
String
url
,
{
Duration
ping
=
const
Duration
(
seconds:
5
),
bool
allowSelfSigned
=
true
})
:
super
(
url
,
ping:
ping
,
allowSelfSigned:
allowSelfSigned
);
GetSocket
(
String
url
,
{
Duration
ping
=
const
Duration
(
seconds:
5
),
bool
allowSelfSigned
=
true
})
:
super
(
url
,
ping:
ping
,
allowSelfSigned:
allowSelfSigned
);
}
...
...
lib/get_connect/sockets/src/sockets_stub.dart
View file @
d093b13
...
...
@@ -31,7 +31,7 @@ class BaseWebSocket {
void
onMessage
(
MessageSocket
fn
)
{
throw
'To use sockets you need dart:io or dart:html'
;
}
void
on
(
String
event
,
MessageSocket
message
)
{
throw
'To use sockets you need dart:io or dart:html'
;
}
...
...
@@ -51,5 +51,4 @@ class BaseWebSocket {
void
emit
(
String
event
,
dynamic
data
)
{
throw
'To use sockets you need dart:io or dart:html'
;
}
}
...
...
lib/get_state_manager/src/simple/get_responsive.dart
View file @
d093b13
...
...
@@ -25,7 +25,7 @@ abstract class _GetResponsive<T> extends GetView<T> {
/// method will be built when the screen type matches the method
/// when the screen is [ScreenType.Tablet] the `tablet` method
/// will be exuded and so on.
/// Note if you use this method please set the
/// Note if you use this method please set the
/// property `alwaysUseBuilder` to false
/// With `settings` property you can set the width limit for the screen types.
class
GetResponsiveView
<
T
>
extends
_GetResponsive
<
T
>
{
...
...
pubspec.yaml
View file @
d093b13
name
:
get
description
:
Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with GetX.
version
:
3.2
2.2
version
:
3.2
3.0
homepage
:
https://github.com/jonataslaw/getx
environment
:
...
...
Please
register
or
login
to post a comment