From 3c33b7520ee5a818b9bda8b0b61b2ec2f56034e4 Mon Sep 17 00:00:00 2001 From: GrbavaCigla Date: Sun, 18 Apr 2021 18:13:15 +0200 Subject: [PATCH 1/4] replace http with https, replace .io with .dev, remove files that shouldn't be checked with git --- .flutter-plugins | 2 -- .flutter-plugins-dependencies | 1 - README.md | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 .flutter-plugins delete mode 100644 .flutter-plugins-dependencies diff --git a/.flutter-plugins b/.flutter-plugins deleted file mode 100644 index 6dfde32..0000000 --- a/.flutter-plugins +++ /dev/null @@ -1,2 +0,0 @@ -# This is a generated file; do not edit or check into version control. -geocoder=C:\\temp\\flutter_geocoder\\ diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies deleted file mode 100644 index 7473b85..0000000 --- a/.flutter-plugins-dependencies +++ /dev/null @@ -1 +0,0 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[],"android":[{"name":"geocoder","path":"C:\\\\temp\\\\flutter_geocoder\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"geocoder","dependencies":[]}],"date_created":"2021-03-09 22:06:22.342462","version":"2.0.1"} \ No newline at end of file diff --git a/README.md b/README.md index 809efad..4c62319 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,6 @@ You will find links to the API docs on the [pub page](https://pub.dartlang.org/p ## Getting Started For help getting started with Flutter, view our online -[documentation](http://flutter.io/). +[documentation](https://flutter.dev/). -For help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code). +For help on editing plugin code, view the [documentation](https://flutter.dev/platform-plugins/#edit-code). From d8ccd56b9588de6454e7a82a467e0baa9fd99aa5 Mon Sep 17 00:00:00 2001 From: GrbavaCigla Date: Sun, 18 Apr 2021 18:13:39 +0200 Subject: [PATCH 2/4] .gitignore .flutter-plugins and .flutter-plugins-dependencies --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 41c1683..02c7c2a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ build/ ios/.generated/ packages pubspec.lock + +.flutter-plugins +.flutter-plugins-dependencies \ No newline at end of file From 3ec0a209498c9c2fb58492580515c7eb594c0cef Mon Sep 17 00:00:00 2001 From: GrbavaCigla Date: Sun, 18 Apr 2021 18:17:47 +0200 Subject: [PATCH 3/4] Fix linting warning --- lib/geocoder.dart | 3 ++- lib/services/distant_google.dart | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/geocoder.dart b/lib/geocoder.dart index 834db73..8e6268e 100644 --- a/lib/geocoder.dart +++ b/lib/geocoder.dart @@ -6,5 +6,6 @@ export 'model.dart'; class Geocoder { static final Geocoding local = LocalGeocoding(); - static Geocoding google(String apiKey, {String? language}) => GoogleGeocoding(apiKey, language: language); + static Geocoding google(String apiKey, {String? language}) => + GoogleGeocoding(apiKey, language: language); } diff --git a/lib/services/distant_google.dart b/lib/services/distant_google.dart index 8a7bdad..5e5a903 100644 --- a/lib/services/distant_google.dart +++ b/lib/services/distant_google.dart @@ -17,8 +17,12 @@ class GoogleGeocoding implements Geocoding { GoogleGeocoding(this.apiKey, {this.language}) : _httpClient = HttpClient(); - Future> findAddressesFromCoordinates(Coordinates coordinates) async { - final url = '$_host?key=$apiKey${language != null ? '&language=' + language! : ''}&latlng=${coordinates.latitude},${coordinates.longitude}'; + Future> findAddressesFromCoordinates( + Coordinates coordinates) async { + String languageArgument = language == null ? '' : '&language=' + language!; + + final url = + '$_host?key=$apiKey$languageArgument&latlng=${coordinates.latitude},${coordinates.longitude}'; return _send(url); } @@ -41,7 +45,10 @@ class GoogleGeocoding implements Geocoding { if (results == null) return []; - return results.map(_convertAddress).map
((map) => Address.fromMap(map)).toList(); + return results + .map(_convertAddress) + .map
((map) => Address.fromMap(map)) + .toList(); } Map? _convertCoordinates(dynamic geometry) { @@ -84,7 +91,8 @@ class GoogleGeocoding implements Geocoding { result["adminArea"] = item["long_name"]; } else if (types.contains("administrative_area_level_2")) { result["subAdminArea"] = item["long_name"]; - } else if (types.contains("sublocality") || types.contains("sublocality_level_1")) { + } else if (types.contains("sublocality") || + types.contains("sublocality_level_1")) { result["subLocality"] = item["long_name"]; } else if (types.contains("premise")) { result["featureName"] = item["long_name"]; From 3058d40b484c1024be290e4462277268a75ee8db Mon Sep 17 00:00:00 2001 From: GrbavaCigla Date: Sun, 18 Apr 2021 18:21:40 +0200 Subject: [PATCH 4/4] Remove .vscode --- .vscode/launch.json | 14 -------------- .vscode/settings.json | 12 ------------ 2 files changed, 26 deletions(-) delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/settings.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 1143dc0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Flutter", - "request": "launch", - "program": "example/lib/main.dart", - "type": "dart" - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index eb4ff28..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "workbench.colorCustomizations": { - "editor.selectionBackground": "#2979FF", - "editor.selectionHighlightBackground": "#0096887f", - "separators.constructors.borderColor": "#666", - "separators.methods.borderColor": "#666", - "separators.functions.borderColor": "#666", - "activityBar.background": "#500562", - "titleBar.activeBackground": "#6F0789", - "titleBar.activeForeground": "#FEFBFF" - } -} \ No newline at end of file