From a5516c1531a1a1273ee1708a201999173f97c01d Mon Sep 17 00:00:00 2001 From: Samuel Ong Date: Tue, 15 Mar 2022 02:58:44 +0800 Subject: [PATCH 1/2] mdae timeout a parameter --- example/pubspec.lock | 9 ++++++++- lib/google_place.dart | 8 +++----- pubspec.lock | 23 +++++++++++++++-------- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 2215551..9311bd2 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -102,6 +102,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -169,7 +176,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.3" + version: "0.4.8" typed_data: dependency: transitive description: diff --git a/lib/google_place.dart b/lib/google_place.dart index d26814d..77172e7 100644 --- a/lib/google_place.dart +++ b/lib/google_place.dart @@ -72,11 +72,9 @@ class GooglePlace { /// http proxies are supported, but are not recommended for production use. final String? proxyUrl; - GooglePlace( - this.apiKEY, { - this.headers = const {}, - this.proxyUrl, - }) { + GooglePlace(this.apiKEY, + {this.headers = const {}, this.proxyUrl, Duration? duration}) { + if (duration != null) timeout = duration; this.search = Search(apiKEY, headers, proxyUrl); this.details = Details(apiKEY, headers, proxyUrl); this.photos = Photos(apiKEY, headers, proxyUrl); diff --git a/pubspec.lock b/pubspec.lock index 31ab8d0..2292aa5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,14 +21,14 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" clock: dependency: transitive description: @@ -80,14 +80,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.7.0" path: dependency: transitive description: @@ -148,7 +155,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.8" typed_data: dependency: transitive description: @@ -162,6 +169,6 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" From fef2aff3af5c0ff027218029f970aceeb2b23f13 Mon Sep 17 00:00:00 2001 From: Samuel Ong Date: Tue, 15 Mar 2022 03:03:06 +0800 Subject: [PATCH 2/2] exposes timeoutDuration --- lib/google_place.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/google_place.dart b/lib/google_place.dart index 77172e7..5047715 100644 --- a/lib/google_place.dart +++ b/lib/google_place.dart @@ -71,10 +71,10 @@ class GooglePlace { /// Can be formatted as [https:// || http://]host[:][/][?=] /// http proxies are supported, but are not recommended for production use. final String? proxyUrl; - + set setTimeout(Duration duration) => timeout = duration; GooglePlace(this.apiKEY, - {this.headers = const {}, this.proxyUrl, Duration? duration}) { - if (duration != null) timeout = duration; + {this.headers = const {}, this.proxyUrl, Duration? timeoutDuration}) { + if (timeoutDuration != null) timeout = timeoutDuration; this.search = Search(apiKEY, headers, proxyUrl); this.details = Details(apiKEY, headers, proxyUrl); this.photos = Photos(apiKEY, headers, proxyUrl);