Jonatas

update to 3.23.0

## [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
... ...
... ... @@ -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,
... ...
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
}
}
... ...
... ... @@ -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 {
... ...
... ... @@ -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);
}
... ...
... ... @@ -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';
}
}
... ...
... ... @@ -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> {
... ...
name: get
description: Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with GetX.
version: 3.22.2
version: 3.23.0
homepage: https://github.com/jonataslaw/getx
environment:
... ...