From dcc906a179f8f502f43561cd9c489c7b8eed4236 Mon Sep 17 00:00:00 2001 From: Seth Moeckel Date: Thu, 15 Jul 2021 13:02:52 -0400 Subject: [PATCH 1/6] updated deps --- example/ios/Flutter/Debug.xcconfig | 1 + example/ios/Flutter/Release.xcconfig | 1 + example/ios/Podfile | 41 ++++++++++++++++++++++++++++ pubspec.yaml | 12 ++++---- 4 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 example/ios/Podfile diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/example/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Podfile b/example/ios/Podfile new file mode 100644 index 0000000..1e8c3c9 --- /dev/null +++ b/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/pubspec.yaml b/pubspec.yaml index 5014564..2006605 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_google_maps version: 4.0.0 -homepage: https://github.com/marchdev-tk/flutter_google_maps +homepage: https://github.com/taskhunt/flutter_google_maps description: A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web. environment: @@ -10,13 +10,13 @@ dependencies: flutter: sdk: flutter - google_polyline_algorithm: ^2.0.0 + google_polyline_algorithm: ^3.1.0 google_maps_flutter: ^0.5.28+1 - google_directions_api: ^0.5.0 + google_directions_api: ^0.9.0 google_maps: ^3.4.3 - http: ^0.12.1 - flinq: ^1.1.0 - uuid: ^2.1.0 + http: ^0.13.3 + flinq: ^2.0.2 + uuid: ^3.0.4 dev_dependencies: flutter_test: From e906016ad1982d9f328c3055009cc2754fa1a927 Mon Sep 17 00:00:00 2001 From: Seth Moeckel Date: Thu, 15 Jul 2021 13:03:12 -0400 Subject: [PATCH 2/6] version bump --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 2006605..d3af164 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: flutter_google_maps -version: 4.0.0 +version: 4.0.1 homepage: https://github.com/taskhunt/flutter_google_maps description: A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web. From d0733ad2c52836bb1a6c0af9d9bac3401cf69b82 Mon Sep 17 00:00:00 2001 From: Seth Moeckel Date: Thu, 15 Jul 2021 13:25:47 -0400 Subject: [PATCH 3/6] updated google maps deps --- pubspec.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index d3af164..3982a32 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: flutter_google_maps +name: crossplatform_google_maps version: 4.0.1 homepage: https://github.com/taskhunt/flutter_google_maps description: A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web. @@ -11,9 +11,9 @@ dependencies: sdk: flutter google_polyline_algorithm: ^3.1.0 - google_maps_flutter: ^0.5.28+1 + google_maps_flutter: ^2.0.6 google_directions_api: ^0.9.0 - google_maps: ^3.4.3 + google_maps: ^5.1.0 http: ^0.13.3 flinq: ^2.0.2 uuid: ^3.0.4 From db738dbcfff68eaf4d8ba0b66a8d05f4bcfac8e3 Mon Sep 17 00:00:00 2001 From: Seth Moeckel Date: Thu, 15 Jul 2021 14:14:31 -0400 Subject: [PATCH 4/6] added makefile --- Makefile | 4 ++++ pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c0d7503 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +publish: + dart pub publish + +.PHONY: publish \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 3982a32..4bcaefc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: crossplatform_google_maps -version: 4.0.1 +version: 4.0.2 homepage: https://github.com/taskhunt/flutter_google_maps description: A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web. From 8225c1dd5a5d91cc521f8e5b3ea79472b5d8d6b3 Mon Sep 17 00:00:00 2001 From: Seth Moeckel Date: Fri, 30 Jul 2021 17:06:20 -0400 Subject: [PATCH 5/6] fixed bug with marker rendering, added polygons to widget --- lib/src/core/google_map.dart | 4 ++++ lib/src/core/map_items.dart | 15 +++++++++++++++ lib/src/mobile/google_map.state.dart | 21 ++++++++++++++------- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/lib/src/core/google_map.dart b/lib/src/core/google_map.dart index d944166..87b5f01 100644 --- a/lib/src/core/google_map.dart +++ b/lib/src/core/google_map.dart @@ -25,6 +25,7 @@ class GoogleMap extends StatefulWidget { this.maxZoom, this.mapStyle, this.markers = const {}, + this.polygons = const{}, this.onTap, this.onLongPress, this.interactive = true, @@ -80,6 +81,9 @@ class GoogleMap extends StatefulWidget { /// Markers to be placed on the map. final Set markers; + // Polygons to placed on the map. + final Set polygons; + /// Called every time a [GoogleMap] is long pressed. /// /// For `web` this will be called when `right mouse clicked`. diff --git a/lib/src/core/map_items.dart b/lib/src/core/map_items.dart index b57b1c4..c8d124e 100644 --- a/lib/src/core/map_items.dart +++ b/lib/src/core/map_items.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:flutter/foundation.dart' show ValueChanged, VoidCallback; +import 'package:flutter/material.dart'; import 'package:google_directions_api/google_directions_api.dart' show GeoCoord; @@ -48,3 +49,17 @@ class Marker { /// if [onInfoWindowTap] is set, it will be called once InfoWindow will be tapped. final VoidCallback onInfoWindowTap; } + +class Polygon { + final List points; + final Color strokeColor; + final double strokeWidth; + final Color fillColor; + + const Polygon({ + this.points, + this.strokeColor = Colors.lightBlue, + this.strokeWidth = 1, + this.fillColor = Colors.lightBlue, + }); +} \ No newline at end of file diff --git a/lib/src/mobile/google_map.state.dart b/lib/src/mobile/google_map.state.dart index 40afc56..c9f4045 100644 --- a/lib/src/mobile/google_map.state.dart +++ b/lib/src/mobile/google_map.state.dart @@ -3,7 +3,9 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; +import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flinq/flinq.dart'; @@ -191,13 +193,6 @@ class GoogleMapState extends gmap.GoogleMapStateBase { icon: icon == null ? BitmapDescriptor.defaultMarker : await _getBmpDesc('${fixAssetPath(icon)}$icon'), - infoWindow: info != null - ? InfoWindow( - title: info, - snippet: infoSnippet, - onTap: onInfoWindowTap, - ) - : null, ); _setState(() => _markers[key] = marker); @@ -571,6 +566,18 @@ class GoogleMapState extends gmap.GoogleMapStateBase { addMarker(marker); } } + + if (widget.polygons != null) { + for (var polygon in widget.polygons) { + addPolygon( + polygon.points.toString(), + polygon.points, + fillColor: polygon.fillColor, + strokeColor: polygon.strokeColor, + strokeWidth: polygon.strokeWidth, + ); + } + } } @override From eb3611be6245a9d94ccad7777286cdf83ede1c47 Mon Sep 17 00:00:00 2001 From: Seth Moeckel Date: Fri, 30 Jul 2021 17:06:42 -0400 Subject: [PATCH 6/6] version bump --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 4bcaefc..ab809de 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: crossplatform_google_maps -version: 4.0.2 +version: 4.1.0 homepage: https://github.com/taskhunt/flutter_google_maps description: A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web.