Skip to content

Commit

Permalink
feat: _httpClient timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloLeal committed Jul 14, 2023
1 parent aee2dd2 commit dc074a3
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Generated file.
//
// If you wish to remove Flutter's multidex support, delete this entire file.
//
// Modifications to this file should be done in a copy under a different name
// as this file may be regenerated.

package io.flutter.app;

import android.app.Application;
import android.content.Context;
import androidx.annotation.CallSuper;
import androidx.multidex.MultiDex;

/**
* Extension of {@link android.app.Application}, adding multidex support.
*/
public class FlutterMultiDexApplication extends Application {
@Override
@CallSuper
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
84 changes: 50 additions & 34 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ packages:
dependency: transitive
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
url: "https://pub.dev"
source: hosted
version: "2.11.0"
version: "2.10.0"
boolean_selector:
dependency: transitive
description:
Expand All @@ -45,10 +45,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.2.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -109,10 +109,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
url: "https://pub.dev"
source: hosted
version: "1.17.1"
version: "1.17.0"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -366,7 +366,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.7.1"
version: "1.7.2"
geolocator:
dependency: transitive
description:
Expand Down Expand Up @@ -443,42 +443,42 @@ packages:
dependency: transitive
description:
name: js
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.dev"
source: hosted
version: "0.6.7"
version: "0.6.5"
json_class:
dependency: transitive
description:
name: json_class
sha256: "26dc861af85f6894da6346b65875ca9b147a899094dc952a0502f2eb38a2c25d"
sha256: c40fa382860f472e79b18f603e9fe1159c7ed3bfc6998a4bbd331825b42ae17a
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.2.1+3"
json_schema2:
dependency: transitive
description:
name: json_schema2
sha256: d5434c96573089e58986f7e32348ecb7e44b7a72b16fe5fce334abe15bab7a70
sha256: "5ee57d67dc7c119d9ec6c59331aedf80e0c9aa8b6c0549be9408a80d35e639d4"
url: "https://pub.dev"
source: hosted
version: "5.1.2+2"
version: "2.0.4+5"
json_theme:
dependency: transitive
description:
name: json_theme
sha256: "253504864190245b8432def8422d5d176124c8c93ae2c8a4552baea59132998c"
sha256: c78d9b4985dbb1e24b345498ef786d12df91b17feebf8008beed72143d2fb88f
url: "https://pub.dev"
source: hosted
version: "6.0.1"
version: "5.0.2+6"
lints:
dependency: transitive
description:
name: lints
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.0.1"
localstorage:
dependency: transitive
description:
Expand All @@ -499,10 +499,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
url: "https://pub.dev"
source: hosted
version: "0.12.15"
version: "0.12.13"
material_color_utilities:
dependency: transitive
description:
Expand All @@ -515,10 +515,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.8.0"
mime:
dependency: transitive
description:
Expand All @@ -531,10 +531,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.8.2"
path_provider:
dependency: transitive
description:
Expand Down Expand Up @@ -587,10 +587,10 @@ packages:
dependency: transitive
description:
name: petitparser
sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750
sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4"
url: "https://pub.dev"
source: hosted
version: "5.4.0"
version: "5.1.0"
platform:
dependency: transitive
description:
Expand Down Expand Up @@ -631,14 +631,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.1"
rfc_6901:
rest_client:
dependency: transitive
description:
name: rfc_6901
sha256: "8d97680dada633146cf75ab9382f2ce2b7e4bd63ceecd867416cf43b5832b988"
name: rest_client
sha256: f788d489471b3c18641cc7ae32cde76ca9806075dda8b98e36bc479f118e6585
url: "https://pub.dev"
source: hosted
version: "0.1.1"
version: "2.2.1+11"
shared_preferences:
dependency: transitive
description:
Expand Down Expand Up @@ -744,10 +744,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
url: "https://pub.dev"
source: hosted
version: "0.5.1"
version: "0.4.16"
timezone:
dependency: transitive
description:
Expand Down Expand Up @@ -848,10 +848,26 @@ packages:
dependency: transitive
description:
name: xml
sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84"
sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5"
url: "https://pub.dev"
source: hosted
version: "6.3.0"
version: "6.2.2"
yaml:
dependency: transitive
description:
name: yaml
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
yaon:
dependency: transitive
description:
name: yaon
sha256: "01ca95714b241aa40853f4119fffd60b56e21cb247d964ed2e9890d23fa1d3e0"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
sdks:
dart: ">=3.0.0 <4.0.0"
dart: ">=2.19.0 <3.0.0"
flutter: ">=3.3.0"
3 changes: 2 additions & 1 deletion lib/services/firebase_login_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class FirebaseLoginService {
return _currentUser?.providerData.isEmpty == true;
}

Future<LoginResponse> sendPhoneToken(String phoneNumber, Duration timeout, void Function() onVerificationTimeout) async {
Future<LoginResponse> sendPhoneToken(
String phoneNumber, Duration timeout, void Function() onVerificationTimeout) async {
Completer<LoginResponse> c = Completer();

_verifiedCredential = null;
Expand Down
1 change: 1 addition & 0 deletions lib/services/theme_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:ftbase/services/shared_preferences_service.dart';
import 'package:json_theme/json_theme.dart';
import 'package:json_theme/json_theme_schemas.dart';

enum ThemeType { DARK, LIGHT }

Expand Down
13 changes: 6 additions & 7 deletions lib/utils/http_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ class HttpResponse {
}

class HttpUtils {
static final HttpWithMiddleware _httpClient = HttpWithMiddleware.build(middlewares: [
HttpLogger(logLevel: LogLevel.BODY),
]);

// static final HttpClientWithMiddleware _streamedHttpClient = HttpClientWithMiddleware.build(middlewares: [
// HttpLogger(logLevel: LogLevel.BODY),
// ]);
static final HttpWithMiddleware _httpClient = HttpWithMiddleware.build(
requestTimeout: const Duration(seconds: 25),
middlewares: [
HttpLogger(logLevel: LogLevel.BODY),
],
);

static Future<HttpResponse> getJson(
String url, {
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: ftbase
description: A new Flutter plugin project.
version: 1.7.1
version: 1.7.2

environment:
sdk: '>=3.0.0'
sdk: ">=2.12.0 <3.0.0"
flutter: ">=2.5.0"

dependencies:
Expand All @@ -20,7 +20,7 @@ dependencies:
flutter_local_notifications: ^14.1.1
firebase_crashlytics: ^3.3.1
http: ^0.13.5
json_theme: ^6.0.1
json_theme: ^5.0.1
mime: ^1.0.2
plugin_platform_interface: ^2.1.4
shared_preferences: ^2.1.2
Expand Down

0 comments on commit dc074a3

Please sign in to comment.