From af1f016fd2dd4cc29db8317ae9a93242865db62d Mon Sep 17 00:00:00 2001 From: Jenish MS Date: Sun, 20 Oct 2024 11:12:39 +0530 Subject: [PATCH] update google_maps_flutter_platform_interface version and fix example project bugs --- example/lib/main.dart | 11 ++++++----- example/lib/multiple.dart | 14 ++++++++------ pubspec.yaml | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index c8beb83..57393de 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -5,7 +5,8 @@ import 'package:example/place.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:google_maps_cluster_manager/google_maps_cluster_manager.dart'; +import 'package:google_maps_cluster_manager/google_maps_cluster_manager.dart' + as cluster_manager; import 'package:google_maps_flutter/google_maps_flutter.dart'; void main() => runApp(MyApp()); @@ -29,7 +30,7 @@ class MapSample extends StatefulWidget { } class MapSampleState extends State { - late ClusterManager _manager; + late cluster_manager.ClusterManager _manager; Completer _controller = Completer(); @@ -72,8 +73,8 @@ class MapSampleState extends State { super.initState(); } - ClusterManager _initClusterManager() { - return ClusterManager(items, _updateMarkers, + cluster_manager.ClusterManager _initClusterManager() { + return cluster_manager.ClusterManager(items, _updateMarkers, markerBuilder: _markerBuilder); } @@ -111,7 +112,7 @@ class MapSampleState extends State { ); } - Future Function(Cluster) get _markerBuilder => + Future Function(cluster_manager.Cluster) get _markerBuilder => (cluster) async { return Marker( markerId: MarkerId(cluster.getId()), diff --git a/example/lib/multiple.dart b/example/lib/multiple.dart index db1933a..2a4059d 100644 --- a/example/lib/multiple.dart +++ b/example/lib/multiple.dart @@ -5,7 +5,8 @@ import 'package:example/place.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:google_maps_cluster_manager/google_maps_cluster_manager.dart'; +import 'package:google_maps_cluster_manager/google_maps_cluster_manager.dart' + as cluster_manager; import 'package:google_maps_flutter/google_maps_flutter.dart'; void main() => runApp(MyApp()); @@ -29,8 +30,8 @@ class MapSample extends StatefulWidget { } class MapSampleState extends State { - late ClusterManager _manager; - late ClusterManager _manager2; + late cluster_manager.ClusterManager _manager; + late cluster_manager.ClusterManager _manager2; Completer _controller = Completer(); @@ -73,10 +74,10 @@ class MapSampleState extends State { @override void initState() { - _manager = ClusterManager(items, _updateMarkers, + _manager = cluster_manager.ClusterManager(items, _updateMarkers, markerBuilder: _getMarkerBuilder(Colors.red)); - _manager2 = ClusterManager(items2, _updateMarkers2, + _manager2 = cluster_manager.ClusterManager(items2, _updateMarkers2, markerBuilder: _getMarkerBuilder(Colors.blue)); super.initState(); } @@ -128,7 +129,8 @@ class MapSampleState extends State { ); } - Future Function(Cluster) _getMarkerBuilder(Color color) => + Future Function(cluster_manager.Cluster) _getMarkerBuilder( + Color color) => (cluster) async { return Marker( markerId: MarkerId(cluster.getId()), diff --git a/pubspec.yaml b/pubspec.yaml index 9b960e4..daabbe2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: flutter: sdk: flutter - google_maps_flutter_platform_interface: ^2.4.3 + google_maps_flutter_platform_interface: ^2.9.5 dev_dependencies: flutter_test: