From 960395fc6be3a7f14107f8ef65d03162474aae82 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Tue, 6 Aug 2024 14:35:52 -0400 Subject: [PATCH 01/35] Specify circle and marker in pigeon --- .../pigeons/messages.dart | 58 ++++++++++++++----- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart index 7cf0afbea28..33ca3931011 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart @@ -46,14 +46,27 @@ class PlatformCameraUpdate { /// Pigeon equivalent of the Circle class. class PlatformCircle { - PlatformCircle(this.json); + PlatformCircle({ + required this.consumeTapEvents, + required this.fillColor, + required this.strokeColor, + required this.visible, + required this.strokeWidth, + required this.zIndex, + required this.center, + required this.radius, + required this.circleId, + }); - /// The circle data, as JSON. This should only be set from - /// Circle.toJson, and the native code must interpret it according to the - /// internal implementation details of that method. - // TODO(stuartmorgan): Replace this with structured data. This exists only to - // allow incremental migration to Pigeon. - final Map json; + final bool consumeTapEvents; + final int fillColor; + final int strokeColor; + final bool visible; + final int strokeWidth; + final double zIndex; + final PlatformLatLng center; + final double radius; + final String circleId; } /// Pigeon equivalent of the Heatmap class. @@ -77,14 +90,31 @@ class PlatformClusterManager { /// Pigeon equivalent of the Marker class. class PlatformMarker { - PlatformMarker(this.json); + PlatformMarker({ + required this.alpha, + required this.anchor, + required this.consumeTapEvents, + required this.draggable, + required this.flat, + required this.icon, + required this.infoWindow, + required this.position, + required this.rotation, + required this.visible, + required this.zIndex, + }); - /// The marker data, as JSON. This should only be set from - /// Marker.toJson, and the native code must interpret it according to the - /// internal implementation details of that method. - // TODO(stuartmorgan): Replace this with structured data. This exists only to - // allow incremental migration to Pigeon. - final Map json; + final double alpha; + final List anchor; + final bool consumeTapEvents; + final bool draggable; + final bool flat; + final Object icon; + final Map infoWindow; + final PlatformLatLng position; + final double rotation; + final bool visible; + final double zIndex; } /// Pigeon equivalent of the Polygon class. From 2de03da81b77603a718b5cba7348021bd3592d94 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Tue, 6 Aug 2024 15:05:37 -0400 Subject: [PATCH 02/35] Update from json to pigeon --- .../plugins/googlemaps/CirclesController.java | 22 +- .../flutter/plugins/googlemaps/Convert.java | 11 + .../flutter/plugins/googlemaps/Messages.java | 1490 +++++++++-------- .../lib/src/google_maps_flutter_android.dart | 26 +- .../lib/src/messages.g.dart | 700 ++++---- .../pigeons/messages.dart | 4 +- 6 files changed, 1206 insertions(+), 1047 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java index 734e36c809e..363e8f978b4 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java @@ -44,13 +44,13 @@ void addJsonCircles(List circlesToAdd) { void addCircles(@NonNull List circlesToAdd) { for (Messages.PlatformCircle circleToAdd : circlesToAdd) { - addJsonCircle(circleToAdd.getJson()); + addCircle(circleToAdd); } } void changeCircles(@NonNull List circlesToChange) { for (Messages.PlatformCircle circleToChange : circlesToChange) { - changeJsonCircle(circleToChange.getJson()); + changeCircle(circleToChange); } } @@ -87,6 +87,13 @@ private void addJsonCircle(Map circle) { addCircle(circleId, options, circleBuilder.consumeTapEvents()); } + void addCircle(Messages.PlatformCircle circle) { + CircleBuilder circleBuilder = new CircleBuilder(density); + String circleId = Convert.interpretCircleOptions(circle, circleBuilder); + CircleOptions options = circleBuilder.build(); + addCircle(circleId, options, circleBuilder.consumeTapEvents()); + } + private void addCircle(String circleId, CircleOptions circleOptions, boolean consumeTapEvents) { final Circle circle = googleMap.addCircle(circleOptions); CircleController controller = new CircleController(circle, consumeTapEvents, density); @@ -105,6 +112,17 @@ private void changeJsonCircle(Map circle) { } } + private void changeCircle(Messages.PlatformCircle circle) { + if (circle == null) { + return; + } + String circleId = circle.getCircleId(); + CircleController circleController = circleIdToController.get(circleId); + if (circleController != null) { + Convert.interpretCircleOptions(circle, circleController); + } + } + private static String getCircleId(Map circle) { return (String) circle.get("circleId"); } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index 825bb504abb..14a4872cd8d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -825,6 +825,17 @@ static String interpretPolylineOptions( } } + static String interpretCircleOptions(Messages.PlatformCircle circle, CircleOptionsSink sink) { + sink.setConsumeTapEvents(circle.getConsumeTapEvents()); + sink.setFillColor(circle.getFillColor().intValue()); + sink.setStrokeColor(circle.getStrokeColor().intValue()); + sink.setStrokeWidth(circle.getStrokeWidth()); + sink.setZIndex(circle.getZIndex().floatValue()); + sink.setCenter(toLatLng(circle.getCenter().toList())); + sink.setRadius(circle.getRadius()); + return circle.getCircleId(); + } + static String interpretCircleOptions(Map data, CircleOptionsSink sink) { final Object consumeTapEvents = data.get("consumeTapEvents"); if (consumeTapEvents != null) { diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java index 32fc6eaf6cb..9b391d2b33c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java @@ -23,6 +23,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -40,7 +41,8 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) + { super(message); this.code = code; this.details = details; @@ -59,15 +61,14 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @NonNull protected static FlutterError createConnectionError(@NonNull String channelName) { - return new FlutterError( - "channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); + return new FlutterError("channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); } @Target(METHOD) @@ -88,7 +89,7 @@ private PlatformRendererType(final int index) { /** * Pigeon representatation of a CameraPosition. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraPosition { private @NonNull Double bearing; @@ -148,17 +149,10 @@ public void setZoom(@NonNull Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformCameraPosition that = (PlatformCameraPosition) o; - return bearing.equals(that.bearing) - && target.equals(that.target) - && tilt.equals(that.tilt) - && zoom.equals(that.zoom); + return bearing.equals(that.bearing) && target.equals(that.target) && tilt.equals(that.tilt) && zoom.equals(that.zoom); } @Override @@ -237,13 +231,13 @@ ArrayList toList() { /** * Pigeon representation of a CameraUpdate. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdate { /** - * The update data, as JSON. This should only be set from CameraUpdate.toJson, and the native - * code must interpret it according to the internal implementation details of the CameraUpdate - * class. + * The update data, as JSON. This should only be set from + * CameraUpdate.toJson, and the native code must interpret it according to the + * internal implementation details of the CameraUpdate class. */ private @NonNull Object json; @@ -263,12 +257,8 @@ public void setJson(@NonNull Object setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformCameraUpdate that = (PlatformCameraUpdate) o; return json.equals(that.json); } @@ -313,24 +303,124 @@ ArrayList toList() { /** * Pigeon equivalent of the Circle class. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCircle { - /** - * The circle data, as JSON. This should only be set from Circle.toJson, and the native code - * must interpret it according to the internal implementation details of that method. - */ - private @NonNull Map json; + private @NonNull Boolean consumeTapEvents; - public @NonNull Map getJson() { - return json; + public @NonNull Boolean getConsumeTapEvents() { + return consumeTapEvents; } - public void setJson(@NonNull Map setterArg) { + public void setConsumeTapEvents(@NonNull Boolean setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"json\" is null."); + throw new IllegalStateException("Nonnull field \"consumeTapEvents\" is null."); } - this.json = setterArg; + this.consumeTapEvents = setterArg; + } + + private @NonNull Long fillColor; + + public @NonNull Long getFillColor() { + return fillColor; + } + + public void setFillColor(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"fillColor\" is null."); + } + this.fillColor = setterArg; + } + + private @NonNull Long strokeColor; + + public @NonNull Long getStrokeColor() { + return strokeColor; + } + + public void setStrokeColor(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"strokeColor\" is null."); + } + this.strokeColor = setterArg; + } + + private @NonNull Boolean visible; + + public @NonNull Boolean getVisible() { + return visible; + } + + public void setVisible(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"visible\" is null."); + } + this.visible = setterArg; + } + + private @NonNull Long strokeWidth; + + public @NonNull Long getStrokeWidth() { + return strokeWidth; + } + + public void setStrokeWidth(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"strokeWidth\" is null."); + } + this.strokeWidth = setterArg; + } + + private @NonNull Double zIndex; + + public @NonNull Double getZIndex() { + return zIndex; + } + + public void setZIndex(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"zIndex\" is null."); + } + this.zIndex = setterArg; + } + + private @NonNull PlatformLatLng center; + + public @NonNull PlatformLatLng getCenter() { + return center; + } + + public void setCenter(@NonNull PlatformLatLng setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"center\" is null."); + } + this.center = setterArg; + } + + private @NonNull Double radius; + + public @NonNull Double getRadius() { + return radius; + } + + public void setRadius(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"radius\" is null."); + } + this.radius = setterArg; + } + + private @NonNull String circleId; + + public @NonNull String getCircleId() { + return circleId; + } + + public void setCircleId(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"circleId\" is null."); + } + this.circleId = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ @@ -338,49 +428,141 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformCircle that = (PlatformCircle) o; - return json.equals(that.json); + return consumeTapEvents.equals(that.consumeTapEvents) && fillColor.equals(that.fillColor) && strokeColor.equals(that.strokeColor) && visible.equals(that.visible) && strokeWidth.equals(that.strokeWidth) && zIndex.equals(that.zIndex) && center.equals(that.center) && radius.equals(that.radius) && circleId.equals(that.circleId); } @Override public int hashCode() { - return Objects.hash(json); + return Objects.hash(consumeTapEvents, fillColor, strokeColor, visible, strokeWidth, zIndex, center, radius, circleId); } public static final class Builder { - private @Nullable Map json; + private @Nullable Boolean consumeTapEvents; @CanIgnoreReturnValue - public @NonNull Builder setJson(@NonNull Map setterArg) { - this.json = setterArg; + public @NonNull Builder setConsumeTapEvents(@NonNull Boolean setterArg) { + this.consumeTapEvents = setterArg; + return this; + } + + private @Nullable Long fillColor; + + @CanIgnoreReturnValue + public @NonNull Builder setFillColor(@NonNull Long setterArg) { + this.fillColor = setterArg; + return this; + } + + private @Nullable Long strokeColor; + + @CanIgnoreReturnValue + public @NonNull Builder setStrokeColor(@NonNull Long setterArg) { + this.strokeColor = setterArg; + return this; + } + + private @Nullable Boolean visible; + + @CanIgnoreReturnValue + public @NonNull Builder setVisible(@NonNull Boolean setterArg) { + this.visible = setterArg; + return this; + } + + private @Nullable Long strokeWidth; + + @CanIgnoreReturnValue + public @NonNull Builder setStrokeWidth(@NonNull Long setterArg) { + this.strokeWidth = setterArg; + return this; + } + + private @Nullable Double zIndex; + + @CanIgnoreReturnValue + public @NonNull Builder setZIndex(@NonNull Double setterArg) { + this.zIndex = setterArg; + return this; + } + + private @Nullable PlatformLatLng center; + + @CanIgnoreReturnValue + public @NonNull Builder setCenter(@NonNull PlatformLatLng setterArg) { + this.center = setterArg; + return this; + } + + private @Nullable Double radius; + + @CanIgnoreReturnValue + public @NonNull Builder setRadius(@NonNull Double setterArg) { + this.radius = setterArg; + return this; + } + + private @Nullable String circleId; + + @CanIgnoreReturnValue + public @NonNull Builder setCircleId(@NonNull String setterArg) { + this.circleId = setterArg; return this; } public @NonNull PlatformCircle build() { PlatformCircle pigeonReturn = new PlatformCircle(); - pigeonReturn.setJson(json); + pigeonReturn.setConsumeTapEvents(consumeTapEvents); + pigeonReturn.setFillColor(fillColor); + pigeonReturn.setStrokeColor(strokeColor); + pigeonReturn.setVisible(visible); + pigeonReturn.setStrokeWidth(strokeWidth); + pigeonReturn.setZIndex(zIndex); + pigeonReturn.setCenter(center); + pigeonReturn.setRadius(radius); + pigeonReturn.setCircleId(circleId); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add(json); + ArrayList toListResult = new ArrayList(9); + toListResult.add(consumeTapEvents); + toListResult.add(fillColor); + toListResult.add(strokeColor); + toListResult.add(visible); + toListResult.add(strokeWidth); + toListResult.add(zIndex); + toListResult.add(center); + toListResult.add(radius); + toListResult.add(circleId); return toListResult; } static @NonNull PlatformCircle fromList(@NonNull ArrayList __pigeon_list) { PlatformCircle pigeonResult = new PlatformCircle(); - Object json = __pigeon_list.get(0); - pigeonResult.setJson((Map) json); + Object consumeTapEvents = __pigeon_list.get(0); + pigeonResult.setConsumeTapEvents((Boolean) consumeTapEvents); + Object fillColor = __pigeon_list.get(1); + pigeonResult.setFillColor((fillColor == null) ? null : ((fillColor instanceof Integer) ? (Integer) fillColor : (Long) fillColor)); + Object strokeColor = __pigeon_list.get(2); + pigeonResult.setStrokeColor((strokeColor == null) ? null : ((strokeColor instanceof Integer) ? (Integer) strokeColor : (Long) strokeColor)); + Object visible = __pigeon_list.get(3); + pigeonResult.setVisible((Boolean) visible); + Object strokeWidth = __pigeon_list.get(4); + pigeonResult.setStrokeWidth((strokeWidth == null) ? null : ((strokeWidth instanceof Integer) ? (Integer) strokeWidth : (Long) strokeWidth)); + Object zIndex = __pigeon_list.get(5); + pigeonResult.setZIndex((Double) zIndex); + Object center = __pigeon_list.get(6); + pigeonResult.setCenter((PlatformLatLng) center); + Object radius = __pigeon_list.get(7); + pigeonResult.setRadius((Double) radius); + Object circleId = __pigeon_list.get(8); + pigeonResult.setCircleId((String) circleId); return pigeonResult; } } @@ -388,12 +570,13 @@ ArrayList toList() { /** * Pigeon equivalent of the Heatmap class. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformHeatmap { /** - * The heatmap data, as JSON. This should only be set from Heatmap.toJson, and the native code - * must interpret it according to the internal implementation details of that method. + * The heatmap data, as JSON. This should only be set from + * Heatmap.toJson, and the native code must interpret it according to the + * internal implementation details of that method. */ private @NonNull Map json; @@ -413,12 +596,8 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformHeatmap that = (PlatformHeatmap) o; return json.equals(that.json); } @@ -463,7 +642,7 @@ ArrayList toList() { /** * Pigeon equivalent of the ClusterManager class. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformClusterManager { private @NonNull String identifier; @@ -484,12 +663,8 @@ public void setIdentifier(@NonNull String setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformClusterManager that = (PlatformClusterManager) o; return identifier.equals(that.identifier); } @@ -534,24 +709,150 @@ ArrayList toList() { /** * Pigeon equivalent of the Marker class. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformMarker { - /** - * The marker data, as JSON. This should only be set from Marker.toJson, and the native code - * must interpret it according to the internal implementation details of that method. - */ - private @NonNull Map json; + private @NonNull Double alpha; - public @NonNull Map getJson() { - return json; + public @NonNull Double getAlpha() { + return alpha; } - public void setJson(@NonNull Map setterArg) { + public void setAlpha(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"json\" is null."); + throw new IllegalStateException("Nonnull field \"alpha\" is null."); } - this.json = setterArg; + this.alpha = setterArg; + } + + private @NonNull double[] anchor; + + public @NonNull double[] getAnchor() { + return anchor; + } + + public void setAnchor(@NonNull double[] setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"anchor\" is null."); + } + this.anchor = setterArg; + } + + private @NonNull Boolean consumeTapEvents; + + public @NonNull Boolean getConsumeTapEvents() { + return consumeTapEvents; + } + + public void setConsumeTapEvents(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"consumeTapEvents\" is null."); + } + this.consumeTapEvents = setterArg; + } + + private @NonNull Boolean draggable; + + public @NonNull Boolean getDraggable() { + return draggable; + } + + public void setDraggable(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"draggable\" is null."); + } + this.draggable = setterArg; + } + + private @NonNull Boolean flat; + + public @NonNull Boolean getFlat() { + return flat; + } + + public void setFlat(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"flat\" is null."); + } + this.flat = setterArg; + } + + private @NonNull Object icon; + + public @NonNull Object getIcon() { + return icon; + } + + public void setIcon(@NonNull Object setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"icon\" is null."); + } + this.icon = setterArg; + } + + private @NonNull Map infoWindow; + + public @NonNull Map getInfoWindow() { + return infoWindow; + } + + public void setInfoWindow(@NonNull Map setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"infoWindow\" is null."); + } + this.infoWindow = setterArg; + } + + private @NonNull PlatformLatLng position; + + public @NonNull PlatformLatLng getPosition() { + return position; + } + + public void setPosition(@NonNull PlatformLatLng setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"position\" is null."); + } + this.position = setterArg; + } + + private @NonNull Double rotation; + + public @NonNull Double getRotation() { + return rotation; + } + + public void setRotation(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"rotation\" is null."); + } + this.rotation = setterArg; + } + + private @NonNull Boolean visible; + + public @NonNull Boolean getVisible() { + return visible; + } + + public void setVisible(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"visible\" is null."); + } + this.visible = setterArg; + } + + private @NonNull Double zIndex; + + public @NonNull Double getZIndex() { + return zIndex; + } + + public void setZIndex(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"zIndex\" is null."); + } + this.zIndex = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ @@ -559,49 +860,167 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformMarker that = (PlatformMarker) o; - return json.equals(that.json); + return alpha.equals(that.alpha) && Arrays.equals(anchor, that.anchor) && consumeTapEvents.equals(that.consumeTapEvents) && draggable.equals(that.draggable) && flat.equals(that.flat) && icon.equals(that.icon) && infoWindow.equals(that.infoWindow) && position.equals(that.position) && rotation.equals(that.rotation) && visible.equals(that.visible) && zIndex.equals(that.zIndex); } @Override public int hashCode() { - return Objects.hash(json); + int __pigeon_result = Objects.hash(alpha, consumeTapEvents, draggable, flat, icon, infoWindow, position, rotation, visible, zIndex); + __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(anchor); + return __pigeon_result; } public static final class Builder { - private @Nullable Map json; + private @Nullable Double alpha; @CanIgnoreReturnValue - public @NonNull Builder setJson(@NonNull Map setterArg) { - this.json = setterArg; + public @NonNull Builder setAlpha(@NonNull Double setterArg) { + this.alpha = setterArg; + return this; + } + + private @Nullable double[] anchor; + + @CanIgnoreReturnValue + public @NonNull Builder setAnchor(@NonNull double[] setterArg) { + this.anchor = setterArg; + return this; + } + + private @Nullable Boolean consumeTapEvents; + + @CanIgnoreReturnValue + public @NonNull Builder setConsumeTapEvents(@NonNull Boolean setterArg) { + this.consumeTapEvents = setterArg; + return this; + } + + private @Nullable Boolean draggable; + + @CanIgnoreReturnValue + public @NonNull Builder setDraggable(@NonNull Boolean setterArg) { + this.draggable = setterArg; + return this; + } + + private @Nullable Boolean flat; + + @CanIgnoreReturnValue + public @NonNull Builder setFlat(@NonNull Boolean setterArg) { + this.flat = setterArg; + return this; + } + + private @Nullable Object icon; + + @CanIgnoreReturnValue + public @NonNull Builder setIcon(@NonNull Object setterArg) { + this.icon = setterArg; + return this; + } + + private @Nullable Map infoWindow; + + @CanIgnoreReturnValue + public @NonNull Builder setInfoWindow(@NonNull Map setterArg) { + this.infoWindow = setterArg; + return this; + } + + private @Nullable PlatformLatLng position; + + @CanIgnoreReturnValue + public @NonNull Builder setPosition(@NonNull PlatformLatLng setterArg) { + this.position = setterArg; + return this; + } + + private @Nullable Double rotation; + + @CanIgnoreReturnValue + public @NonNull Builder setRotation(@NonNull Double setterArg) { + this.rotation = setterArg; + return this; + } + + private @Nullable Boolean visible; + + @CanIgnoreReturnValue + public @NonNull Builder setVisible(@NonNull Boolean setterArg) { + this.visible = setterArg; + return this; + } + + private @Nullable Double zIndex; + + @CanIgnoreReturnValue + public @NonNull Builder setZIndex(@NonNull Double setterArg) { + this.zIndex = setterArg; return this; } public @NonNull PlatformMarker build() { PlatformMarker pigeonReturn = new PlatformMarker(); - pigeonReturn.setJson(json); + pigeonReturn.setAlpha(alpha); + pigeonReturn.setAnchor(anchor); + pigeonReturn.setConsumeTapEvents(consumeTapEvents); + pigeonReturn.setDraggable(draggable); + pigeonReturn.setFlat(flat); + pigeonReturn.setIcon(icon); + pigeonReturn.setInfoWindow(infoWindow); + pigeonReturn.setPosition(position); + pigeonReturn.setRotation(rotation); + pigeonReturn.setVisible(visible); + pigeonReturn.setZIndex(zIndex); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add(json); + ArrayList toListResult = new ArrayList(11); + toListResult.add(alpha); + toListResult.add(anchor); + toListResult.add(consumeTapEvents); + toListResult.add(draggable); + toListResult.add(flat); + toListResult.add(icon); + toListResult.add(infoWindow); + toListResult.add(position); + toListResult.add(rotation); + toListResult.add(visible); + toListResult.add(zIndex); return toListResult; } static @NonNull PlatformMarker fromList(@NonNull ArrayList __pigeon_list) { PlatformMarker pigeonResult = new PlatformMarker(); - Object json = __pigeon_list.get(0); - pigeonResult.setJson((Map) json); + Object alpha = __pigeon_list.get(0); + pigeonResult.setAlpha((Double) alpha); + Object anchor = __pigeon_list.get(1); + pigeonResult.setAnchor((double[]) anchor); + Object consumeTapEvents = __pigeon_list.get(2); + pigeonResult.setConsumeTapEvents((Boolean) consumeTapEvents); + Object draggable = __pigeon_list.get(3); + pigeonResult.setDraggable((Boolean) draggable); + Object flat = __pigeon_list.get(4); + pigeonResult.setFlat((Boolean) flat); + Object icon = __pigeon_list.get(5); + pigeonResult.setIcon(icon); + Object infoWindow = __pigeon_list.get(6); + pigeonResult.setInfoWindow((Map) infoWindow); + Object position = __pigeon_list.get(7); + pigeonResult.setPosition((PlatformLatLng) position); + Object rotation = __pigeon_list.get(8); + pigeonResult.setRotation((Double) rotation); + Object visible = __pigeon_list.get(9); + pigeonResult.setVisible((Boolean) visible); + Object zIndex = __pigeon_list.get(10); + pigeonResult.setZIndex((Double) zIndex); return pigeonResult; } } @@ -609,12 +1028,13 @@ ArrayList toList() { /** * Pigeon equivalent of the Polygon class. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformPolygon { /** - * The polygon data, as JSON. This should only be set from Polygon.toJson, and the native code - * must interpret it according to the internal implementation details of that method. + * The polygon data, as JSON. This should only be set from + * Polygon.toJson, and the native code must interpret it according to the + * internal implementation details of that method. */ private @NonNull Map json; @@ -634,12 +1054,8 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformPolygon that = (PlatformPolygon) o; return json.equals(that.json); } @@ -684,12 +1100,13 @@ ArrayList toList() { /** * Pigeon equivalent of the Polyline class. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformPolyline { /** - * The polyline data, as JSON. This should only be set from Polyline.toJson, and the native code - * must interpret it according to the internal implementation details of that method. + * The polyline data, as JSON. This should only be set from + * Polyline.toJson, and the native code must interpret it according to the + * internal implementation details of that method. */ private @NonNull Map json; @@ -709,12 +1126,8 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformPolyline that = (PlatformPolyline) o; return json.equals(that.json); } @@ -759,7 +1172,7 @@ ArrayList toList() { /** * Pigeon equivalent of the Tile class. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformTile { private @NonNull Long width; @@ -803,16 +1216,10 @@ public void setData(@Nullable byte[] setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformTile that = (PlatformTile) o; - return width.equals(that.width) - && height.equals(that.height) - && Arrays.equals(data, that.data); + return width.equals(that.width) && height.equals(that.height) && Arrays.equals(data, that.data); } @Override @@ -869,13 +1276,9 @@ ArrayList toList() { static @NonNull PlatformTile fromList(@NonNull ArrayList __pigeon_list) { PlatformTile pigeonResult = new PlatformTile(); Object width = __pigeon_list.get(0); - pigeonResult.setWidth( - (width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); + pigeonResult.setWidth((width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); Object height = __pigeon_list.get(1); - pigeonResult.setHeight( - (height == null) - ? null - : ((height instanceof Integer) ? (Integer) height : (Long) height)); + pigeonResult.setHeight((height == null) ? null : ((height instanceof Integer) ? (Integer) height : (Long) height)); Object data = __pigeon_list.get(2); pigeonResult.setData((byte[]) data); return pigeonResult; @@ -885,13 +1288,13 @@ ArrayList toList() { /** * Pigeon equivalent of the TileOverlay class. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformTileOverlay { /** - * The tile overlay data, as JSON. This should only be set from TileOverlay.toJson, and the - * native code must interpret it according to the internal implementation details of that - * method. + * The tile overlay data, as JSON. This should only be set from + * TileOverlay.toJson, and the native code must interpret it according to the + * internal implementation details of that method. */ private @NonNull Map json; @@ -911,12 +1314,8 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformTileOverlay that = (PlatformTileOverlay) o; return json.equals(that.json); } @@ -961,7 +1360,7 @@ ArrayList toList() { /** * Pigeon equivalent of LatLng. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformLatLng { private @NonNull Double latitude; @@ -995,12 +1394,8 @@ public void setLongitude(@NonNull Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformLatLng that = (PlatformLatLng) o; return latitude.equals(that.latitude) && longitude.equals(that.longitude); } @@ -1057,7 +1452,7 @@ ArrayList toList() { /** * Pigeon equivalent of LatLngBounds. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformLatLngBounds { private @NonNull PlatformLatLng northeast; @@ -1091,12 +1486,8 @@ public void setSouthwest(@NonNull PlatformLatLng setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformLatLngBounds that = (PlatformLatLngBounds) o; return northeast.equals(that.northeast) && southwest.equals(that.southwest); } @@ -1153,7 +1544,7 @@ ArrayList toList() { /** * Pigeon equivalent of Cluster. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCluster { private @NonNull String clusterManagerId; @@ -1213,17 +1604,10 @@ public void setMarkerIds(@NonNull List setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformCluster that = (PlatformCluster) o; - return clusterManagerId.equals(that.clusterManagerId) - && position.equals(that.position) - && bounds.equals(that.bounds) - && markerIds.equals(that.markerIds); + return clusterManagerId.equals(that.clusterManagerId) && position.equals(that.position) && bounds.equals(that.bounds) && markerIds.equals(that.markerIds); } @Override @@ -1302,13 +1686,13 @@ ArrayList toList() { /** * Pigeon equivalent of MapConfiguration. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformMapConfiguration { /** - * The configuration options, as JSON. This should only be set from _jsonForMapConfiguration, - * and the native code must interpret it according to the internal implementation details of - * that method. + * The configuration options, as JSON. This should only be set from + * _jsonForMapConfiguration, and the native code must interpret it according + * to the internal implementation details of that method. */ private @NonNull Map json; @@ -1328,12 +1712,8 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformMapConfiguration that = (PlatformMapConfiguration) o; return json.equals(that.json); } @@ -1378,7 +1758,7 @@ ArrayList toList() { /** * Pigeon representation of an x,y coordinate. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformPoint { private @NonNull Long x; @@ -1412,12 +1792,8 @@ public void setY(@NonNull Long setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformPoint that = (PlatformPoint) o; return x.equals(that.x) && y.equals(that.y); } @@ -1474,7 +1850,7 @@ ArrayList toList() { /** * Pigeon equivalent of native TileOverlay properties. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformTileLayer { private @NonNull Boolean visible; @@ -1534,17 +1910,10 @@ public void setZIndex(@NonNull Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformTileLayer that = (PlatformTileLayer) o; - return visible.equals(that.visible) - && fadeIn.equals(that.fadeIn) - && transparency.equals(that.transparency) - && zIndex.equals(that.zIndex); + return visible.equals(that.visible) && fadeIn.equals(that.fadeIn) && transparency.equals(that.transparency) && zIndex.equals(that.zIndex); } @Override @@ -1623,7 +1992,7 @@ ArrayList toList() { /** * Possible outcomes of launching a URL. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformZoomRange { private @NonNull Double min; @@ -1657,12 +2026,8 @@ public void setMax(@NonNull Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformZoomRange that = (PlatformZoomRange) o; return min.equals(that.min) && max.equals(that.max); } @@ -1828,6 +2193,7 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } } + /** Asynchronous error handling return type for non-nullable API method returns. */ public interface Result { /** Success case callback method for handling returns. */ @@ -1855,9 +2221,9 @@ public interface VoidResult { /** * Interface for non-test interactions with the native SDK. * - *

For test-only state queries, see [MapsInspectorApi]. + * For test-only state queries, see [MapsInspectorApi]. * - *

Generated interface from Pigeon that represents a handler of messages from Flutter. + * Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MapsApi { /** Returns once the map instance is available. */ @@ -1865,82 +2231,70 @@ public interface MapsApi { /** * Updates the map's configuration options. * - *

Only non-null configuration values will result in updates; options with null values will - * remain unchanged. + * Only non-null configuration values will result in updates; options with + * null values will remain unchanged. */ void updateMapConfiguration(@NonNull PlatformMapConfiguration configuration); /** Updates the set of circles on the map. */ - void updateCircles( - @NonNull List toAdd, - @NonNull List toChange, - @NonNull List idsToRemove); + void updateCircles(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); /** Updates the set of heatmaps on the map. */ - void updateHeatmaps( - @NonNull List toAdd, - @NonNull List toChange, - @NonNull List idsToRemove); + void updateHeatmaps(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); /** Updates the set of custer managers for clusters on the map. */ - void updateClusterManagers( - @NonNull List toAdd, @NonNull List idsToRemove); + void updateClusterManagers(@NonNull List toAdd, @NonNull List idsToRemove); /** Updates the set of markers on the map. */ - void updateMarkers( - @NonNull List toAdd, - @NonNull List toChange, - @NonNull List idsToRemove); + void updateMarkers(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); /** Updates the set of polygonss on the map. */ - void updatePolygons( - @NonNull List toAdd, - @NonNull List toChange, - @NonNull List idsToRemove); + void updatePolygons(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); /** Updates the set of polylines on the map. */ - void updatePolylines( - @NonNull List toAdd, - @NonNull List toChange, - @NonNull List idsToRemove); + void updatePolylines(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); /** Updates the set of tile overlays on the map. */ - void updateTileOverlays( - @NonNull List toAdd, - @NonNull List toChange, - @NonNull List idsToRemove); + void updateTileOverlays(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); /** Gets the screen coordinate for the given map location. */ - @NonNull + @NonNull PlatformPoint getScreenCoordinate(@NonNull PlatformLatLng latLng); /** Gets the map location for the given screen coordinate. */ - @NonNull + @NonNull PlatformLatLng getLatLng(@NonNull PlatformPoint screenCoordinate); /** Gets the map region currently displayed on the map. */ - @NonNull + @NonNull PlatformLatLngBounds getVisibleRegion(); - /** Moves the camera according to [cameraUpdate] immediately, with no animation. */ + /** + * Moves the camera according to [cameraUpdate] immediately, with no + * animation. + */ void moveCamera(@NonNull PlatformCameraUpdate cameraUpdate); /** Moves the camera according to [cameraUpdate], animating the update. */ void animateCamera(@NonNull PlatformCameraUpdate cameraUpdate); /** Gets the current map zoom level. */ - @NonNull + @NonNull Double getZoomLevel(); /** Show the info window for the marker with the given ID. */ void showInfoWindow(@NonNull String markerId); /** Hide the info window for the marker with the given ID. */ void hideInfoWindow(@NonNull String markerId); - /** Returns true if the marker with the given ID is currently displaying its info window. */ - @NonNull + /** + * Returns true if the marker with the given ID is currently displaying its + * info window. + */ + @NonNull Boolean isInfoWindowShown(@NonNull String markerId); /** - * Sets the style to the given map style string, where an empty string indicates that the style - * should be cleared. + * Sets the style to the given map style string, where an empty string + * indicates that the style should be cleared. * - *

Returns false if there was an error setting the style, such as an invalid style string. + * Returns false if there was an error setting the style, such as an invalid + * style string. */ - @NonNull + @NonNull Boolean setStyle(@NonNull String style); /** - * Returns true if the last attempt to set a style, either via initial map style or setMapStyle, - * succeeded. + * Returns true if the last attempt to set a style, either via initial map + * style or setMapStyle, succeeded. * - *

This allows checking asynchronously for initial style failures, as there is no way to - * return failures from map initialization. + * This allows checking asynchronously for initial style failures, as there + * is no way to return failures from map initialization. */ - @NonNull + @NonNull Boolean didLastStyleSucceed(); /** Clears the cache of tiles previously requseted from the tile provider. */ void clearTileCache(@NonNull String tileOverlayId); @@ -1951,23 +2305,16 @@ void updateTileOverlays( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /** Sets up an instance of `MapsApi` to handle messages through the `binaryMessenger`. */ + /**Sets up an instance of `MapsApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable MapsApi api) { setUp(binaryMessenger, "", api); } - - static void setUp( - @NonNull BinaryMessenger binaryMessenger, - @NonNull String messageChannelSuffix, - @Nullable MapsApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable MapsApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1994,10 +2341,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2007,7 +2351,8 @@ public void error(Throwable error) { try { api.updateMapConfiguration(configurationArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2020,10 +2365,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2035,7 +2377,8 @@ public void error(Throwable error) { try { api.updateCircles(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2048,10 +2391,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2063,7 +2403,8 @@ public void error(Throwable error) { try { api.updateHeatmaps(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2076,10 +2417,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2090,7 +2428,8 @@ public void error(Throwable error) { try { api.updateClusterManagers(toAddArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2103,10 +2442,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2118,7 +2454,8 @@ public void error(Throwable error) { try { api.updateMarkers(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2131,10 +2468,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2146,7 +2480,8 @@ public void error(Throwable error) { try { api.updatePolygons(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2159,10 +2494,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2174,7 +2506,8 @@ public void error(Throwable error) { try { api.updatePolylines(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2187,10 +2520,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2202,7 +2532,8 @@ public void error(Throwable error) { try { api.updateTileOverlays(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2215,10 +2546,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2228,7 +2556,8 @@ public void error(Throwable error) { try { PlatformPoint output = api.getScreenCoordinate(latLngArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2241,10 +2570,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2254,7 +2580,8 @@ public void error(Throwable error) { try { PlatformLatLng output = api.getLatLng(screenCoordinateArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2267,10 +2594,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2278,7 +2602,8 @@ public void error(Throwable error) { try { PlatformLatLngBounds output = api.getVisibleRegion(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2291,10 +2616,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2304,7 +2626,8 @@ public void error(Throwable error) { try { api.moveCamera(cameraUpdateArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2317,10 +2640,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2330,7 +2650,8 @@ public void error(Throwable error) { try { api.animateCamera(cameraUpdateArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2343,10 +2664,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2354,7 +2672,8 @@ public void error(Throwable error) { try { Double output = api.getZoomLevel(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2367,10 +2686,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2380,7 +2696,8 @@ public void error(Throwable error) { try { api.showInfoWindow(markerIdArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2393,10 +2710,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2406,7 +2720,8 @@ public void error(Throwable error) { try { api.hideInfoWindow(markerIdArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2419,10 +2734,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2432,7 +2744,8 @@ public void error(Throwable error) { try { Boolean output = api.isInfoWindowShown(markerIdArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2445,10 +2758,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2458,7 +2768,8 @@ public void error(Throwable error) { try { Boolean output = api.setStyle(styleArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2471,10 +2782,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2482,7 +2790,8 @@ public void error(Throwable error) { try { Boolean output = api.didLastStyleSucceed(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2495,10 +2804,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2508,7 +2814,8 @@ public void error(Throwable error) { try { api.clearTileCache(tileOverlayIdArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2521,10 +2828,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2558,470 +2862,366 @@ public static class MapsCallbackApi { public MapsCallbackApi(@NonNull BinaryMessenger argBinaryMessenger) { this(argBinaryMessenger, ""); } - - public MapsCallbackApi( - @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + public MapsCallbackApi(@NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { this.binaryMessenger = argBinaryMessenger; this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ /** The codec used by MapsCallbackApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } /** Called when the map camera starts moving. */ public void onCameraMoveStarted(@NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when the map camera moves. */ - public void onCameraMove( - @NonNull PlatformCameraPosition cameraPositionArg, @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove" - + messageChannelSuffix; + public void onCameraMove(@NonNull PlatformCameraPosition cameraPositionArg, @NonNull VoidResult result) { + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(cameraPositionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when the map camera stops moving. */ public void onCameraIdle(@NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when the map, not a specifc map object, is tapped. */ public void onTap(@NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when the map, not a specifc map object, is long pressed. */ public void onLongPress(@NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker is tapped. */ public void onMarkerTap(@NonNull String markerIdArg, @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(markerIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker drag starts. */ - public void onMarkerDragStart( - @NonNull String markerIdArg, - @NonNull PlatformLatLng positionArg, - @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart" - + messageChannelSuffix; + public void onMarkerDragStart(@NonNull String markerIdArg, @NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Arrays.asList(markerIdArg, positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker drag updates. */ - public void onMarkerDrag( - @NonNull String markerIdArg, - @NonNull PlatformLatLng positionArg, - @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag" - + messageChannelSuffix; + public void onMarkerDrag(@NonNull String markerIdArg, @NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Arrays.asList(markerIdArg, positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker drag ends. */ - public void onMarkerDragEnd( - @NonNull String markerIdArg, - @NonNull PlatformLatLng positionArg, - @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd" - + messageChannelSuffix; + public void onMarkerDragEnd(@NonNull String markerIdArg, @NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Arrays.asList(markerIdArg, positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker's info window is tapped. */ public void onInfoWindowTap(@NonNull String markerIdArg, @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(markerIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a circle is tapped. */ public void onCircleTap(@NonNull String circleIdArg, @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(circleIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker cluster is tapped. */ public void onClusterTap(@NonNull PlatformCluster clusterArg, @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(clusterArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a polygon is tapped. */ public void onPolygonTap(@NonNull String polygonIdArg, @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(polygonIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a polyline is tapped. */ public void onPolylineTap(@NonNull String polylineIdArg, @NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(polylineIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called to get data for a map tile. */ - public void getTileOverlayTile( - @NonNull String tileOverlayIdArg, - @NonNull PlatformPoint locationArg, - @NonNull Long zoomArg, - @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile" - + messageChannelSuffix; + public void getTileOverlayTile(@NonNull String tileOverlayIdArg, @NonNull PlatformPoint locationArg, @NonNull Long zoomArg, @NonNull Result result) { + final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Arrays.asList(tileOverlayIdArg, locationArg, zoomArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") PlatformTile output = (PlatformTile) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } } /** * Interface for global SDK initialization. * - *

Generated interface from Pigeon that represents a handler of messages from Flutter. + * Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MapsInitializerApi { /** * Initializes the Google Maps SDK with the given renderer preference. * - *

A null renderer preference will result in the default renderer. + * A null renderer preference will result in the default renderer. * - *

Calling this more than once in the lifetime of an application will result in an error. + * Calling this more than once in the lifetime of an application will result + * in an error. */ - void initializeWithPreferredRenderer( - @Nullable PlatformRendererType type, @NonNull Result result); + void initializeWithPreferredRenderer(@Nullable PlatformRendererType type, @NonNull Result result); /** The codec used by MapsInitializerApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /** - * Sets up an instance of `MapsInitializerApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `MapsInitializerApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable MapsInitializerApi api) { setUp(binaryMessenger, "", api); } - - static void setUp( - @NonNull BinaryMessenger binaryMessenger, - @NonNull String messageChannelSuffix, - @Nullable MapsInitializerApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable MapsInitializerApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3052,75 +3252,66 @@ public void error(Throwable error) { /** * Inspector API only intended for use in integration tests. * - *

Generated interface from Pigeon that represents a handler of messages from Flutter. + * Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MapsInspectorApi { - @NonNull + @NonNull Boolean areBuildingsEnabled(); - @NonNull + @NonNull Boolean areRotateGesturesEnabled(); - @NonNull + @NonNull Boolean areZoomControlsEnabled(); - @NonNull + @NonNull Boolean areScrollGesturesEnabled(); - @NonNull + @NonNull Boolean areTiltGesturesEnabled(); - @NonNull + @NonNull Boolean areZoomGesturesEnabled(); - @NonNull + @NonNull Boolean isCompassEnabled(); - @Nullable + @Nullable Boolean isLiteModeEnabled(); - @NonNull + @NonNull Boolean isMapToolbarEnabled(); - @NonNull + @NonNull Boolean isMyLocationButtonEnabled(); - @NonNull + @NonNull Boolean isTrafficEnabled(); - @Nullable + @Nullable PlatformTileLayer getTileOverlayInfo(@NonNull String tileOverlayId); - @NonNull + @NonNull PlatformZoomRange getZoomRange(); - @NonNull + @NonNull List getClusters(@NonNull String clusterManagerId); /** The codec used by MapsInspectorApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /** - * Sets up an instance of `MapsInspectorApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `MapsInspectorApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable MapsInspectorApi api) { setUp(binaryMessenger, "", api); } - - static void setUp( - @NonNull BinaryMessenger binaryMessenger, - @NonNull String messageChannelSuffix, - @Nullable MapsInspectorApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable MapsInspectorApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3128,7 +3319,8 @@ static void setUp( try { Boolean output = api.areBuildingsEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3141,10 +3333,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3152,7 +3341,8 @@ static void setUp( try { Boolean output = api.areRotateGesturesEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3165,10 +3355,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3176,7 +3363,8 @@ static void setUp( try { Boolean output = api.areZoomControlsEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3189,10 +3377,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3200,7 +3385,8 @@ static void setUp( try { Boolean output = api.areScrollGesturesEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3213,10 +3399,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3224,7 +3407,8 @@ static void setUp( try { Boolean output = api.areTiltGesturesEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3237,10 +3421,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3248,7 +3429,8 @@ static void setUp( try { Boolean output = api.areZoomGesturesEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3261,10 +3443,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3272,7 +3451,8 @@ static void setUp( try { Boolean output = api.isCompassEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3285,10 +3465,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3296,7 +3473,8 @@ static void setUp( try { Boolean output = api.isLiteModeEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3309,10 +3487,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3320,7 +3495,8 @@ static void setUp( try { Boolean output = api.isMapToolbarEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3333,10 +3509,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3344,7 +3517,8 @@ static void setUp( try { Boolean output = api.isMyLocationButtonEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3357,10 +3531,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3368,7 +3539,8 @@ static void setUp( try { Boolean output = api.isTrafficEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3381,10 +3553,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3394,7 +3563,8 @@ static void setUp( try { PlatformTileLayer output = api.getTileOverlayInfo(tileOverlayIdArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3407,10 +3577,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3418,7 +3585,8 @@ static void setUp( try { PlatformZoomRange output = api.getZoomRange(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3431,10 +3599,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3444,7 +3609,8 @@ static void setUp( try { List output = api.getClusters(clusterManagerIdArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart index 214acc41ed2..e039a299702 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart @@ -688,7 +688,17 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { // This cast is not ideal, but the Java code already assumes this format. // See the TODOs at the top of this file and on the 'json' field in // messages.dart. - return PlatformCircle(json: circle.toJson() as Map); + return PlatformCircle( + consumeTapEvents: circle.consumeTapEvents, + fillColor: circle.fillColor.value, + strokeColor: circle.strokeColor.value, + visible: circle.visible, + strokeWidth: circle.strokeWidth, + zIndex: circle.zIndex.toDouble(), + center: _platformLatLngFromLatLng(circle.center), + radius: circle.radius, + circleId: circle.circleId.value, + ); } static PlatformHeatmap _platformHeatmapFromHeatmap(Heatmap heatmap) { @@ -708,7 +718,19 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { // This cast is not ideal, but the Java code already assumes this format. // See the TODOs at the top of this file and on the 'json' field in // messages.dart. - return PlatformMarker(json: marker.toJson() as Map); + return PlatformMarker( + alpha: marker.alpha, + anchor: Float64List.fromList([marker.anchor.dx, marker.anchor.dy]), + consumeTapEvents: marker.consumeTapEvents, + draggable: marker.draggable, + flat: marker.flat, + icon: marker.icon, + infoWindow: marker.infoWindow.toJson() as Map, + position: _platformLatLngFromLatLng(marker.position), + rotation: marker.rotation, + visible: marker.visible, + zIndex: marker.zIndex, + ); } static PlatformPolygon _platformPolygonFromPolygon(Polygon polygon) { diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart index 676b8f48b86..fac958f2688 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart @@ -18,8 +18,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -99,24 +98,61 @@ class PlatformCameraUpdate { /// Pigeon equivalent of the Circle class. class PlatformCircle { PlatformCircle({ - required this.json, + required this.consumeTapEvents, + required this.fillColor, + required this.strokeColor, + required this.visible, + required this.strokeWidth, + required this.zIndex, + required this.center, + required this.radius, + required this.circleId, }); - /// The circle data, as JSON. This should only be set from - /// Circle.toJson, and the native code must interpret it according to the - /// internal implementation details of that method. - Map json; + bool consumeTapEvents; + + int fillColor; + + int strokeColor; + + bool visible; + + int strokeWidth; + + double zIndex; + + PlatformLatLng center; + + double radius; + + String circleId; Object encode() { return [ - json, + consumeTapEvents, + fillColor, + strokeColor, + visible, + strokeWidth, + zIndex, + center, + radius, + circleId, ]; } static PlatformCircle decode(Object result) { result as List; return PlatformCircle( - json: (result[0] as Map?)!.cast(), + consumeTapEvents: result[0]! as bool, + fillColor: result[1]! as int, + strokeColor: result[2]! as int, + visible: result[3]! as bool, + strokeWidth: result[4]! as int, + zIndex: result[5]! as double, + center: result[6]! as PlatformLatLng, + radius: result[7]! as double, + circleId: result[8]! as String, ); } } @@ -171,24 +207,71 @@ class PlatformClusterManager { /// Pigeon equivalent of the Marker class. class PlatformMarker { PlatformMarker({ - required this.json, + required this.alpha, + required this.anchor, + required this.consumeTapEvents, + required this.draggable, + required this.flat, + required this.icon, + required this.infoWindow, + required this.position, + required this.rotation, + required this.visible, + required this.zIndex, }); - /// The marker data, as JSON. This should only be set from - /// Marker.toJson, and the native code must interpret it according to the - /// internal implementation details of that method. - Map json; + double alpha; + + Float64List anchor; + + bool consumeTapEvents; + + bool draggable; + + bool flat; + + Object icon; + + Map infoWindow; + + PlatformLatLng position; + + double rotation; + + bool visible; + + double zIndex; Object encode() { return [ - json, + alpha, + anchor, + consumeTapEvents, + draggable, + flat, + icon, + infoWindow, + position, + rotation, + visible, + zIndex, ]; } static PlatformMarker decode(Object result) { result as List; return PlatformMarker( - json: (result[0] as Map?)!.cast(), + alpha: result[0]! as double, + anchor: result[1]! as Float64List, + consumeTapEvents: result[2]! as bool, + draggable: result[3]! as bool, + flat: result[4]! as bool, + icon: result[5]!, + infoWindow: (result[6] as Map?)!.cast(), + position: result[7]! as PlatformLatLng, + rotation: result[8]! as double, + visible: result[9]! as bool, + zIndex: result[10]! as double, ); } } @@ -507,6 +590,7 @@ class PlatformZoomRange { } } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -514,55 +598,55 @@ class _PigeonCodec extends StandardMessageCodec { if (value is PlatformCameraPosition) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdate) { + } else if (value is PlatformCameraUpdate) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is PlatformCircle) { + } else if (value is PlatformCircle) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is PlatformHeatmap) { + } else if (value is PlatformHeatmap) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is PlatformClusterManager) { + } else if (value is PlatformClusterManager) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is PlatformMarker) { + } else if (value is PlatformMarker) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is PlatformPolygon) { + } else if (value is PlatformPolygon) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformPolyline) { + } else if (value is PlatformPolyline) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is PlatformTile) { + } else if (value is PlatformTile) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PlatformTileOverlay) { + } else if (value is PlatformTileOverlay) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLng) { + } else if (value is PlatformLatLng) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLngBounds) { + } else if (value is PlatformLatLngBounds) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PlatformCluster) { + } else if (value is PlatformCluster) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PlatformMapConfiguration) { + } else if (value is PlatformMapConfiguration) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PlatformPoint) { + } else if (value is PlatformPoint) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PlatformTileLayer) { + } else if (value is PlatformTileLayer) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PlatformZoomRange) { + } else if (value is PlatformZoomRange) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is PlatformRendererType) { + } else if (value is PlatformRendererType) { buffer.putUint8(146); writeValue(buffer, value.index); } else { @@ -573,41 +657,41 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return PlatformCameraPosition.decode(readValue(buffer)!); - case 130: + case 130: return PlatformCameraUpdate.decode(readValue(buffer)!); - case 131: + case 131: return PlatformCircle.decode(readValue(buffer)!); - case 132: + case 132: return PlatformHeatmap.decode(readValue(buffer)!); - case 133: + case 133: return PlatformClusterManager.decode(readValue(buffer)!); - case 134: + case 134: return PlatformMarker.decode(readValue(buffer)!); - case 135: + case 135: return PlatformPolygon.decode(readValue(buffer)!); - case 136: + case 136: return PlatformPolyline.decode(readValue(buffer)!); - case 137: + case 137: return PlatformTile.decode(readValue(buffer)!); - case 138: + case 138: return PlatformTileOverlay.decode(readValue(buffer)!); - case 139: + case 139: return PlatformLatLng.decode(readValue(buffer)!); - case 140: + case 140: return PlatformLatLngBounds.decode(readValue(buffer)!); - case 141: + case 141: return PlatformCluster.decode(readValue(buffer)!); - case 142: + case 142: return PlatformMapConfiguration.decode(readValue(buffer)!); - case 143: + case 143: return PlatformPoint.decode(readValue(buffer)!); - case 144: + case 144: return PlatformTileLayer.decode(readValue(buffer)!); - case 145: + case 145: return PlatformZoomRange.decode(readValue(buffer)!); - case 146: + case 146: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformRendererType.values[value]; default: @@ -625,8 +709,7 @@ class MapsApi { /// BinaryMessenger will be used which routes to the host platform. MapsApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -635,10 +718,8 @@ class MapsApi { /// Returns once the map instance is available. Future waitForMap() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -662,12 +743,9 @@ class MapsApi { /// /// Only non-null configuration values will result in updates; options with /// null values will remain unchanged. - Future updateMapConfiguration( - PlatformMapConfiguration configuration) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future updateMapConfiguration(PlatformMapConfiguration configuration) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -688,18 +766,15 @@ class MapsApi { } /// Updates the set of circles on the map. - Future updateCircles(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future updateCircles(List toAdd, List toChange, List idsToRemove) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -714,18 +789,15 @@ class MapsApi { } /// Updates the set of heatmaps on the map. - Future updateHeatmaps(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future updateHeatmaps(List toAdd, List toChange, List idsToRemove) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -740,18 +812,15 @@ class MapsApi { } /// Updates the set of custer managers for clusters on the map. - Future updateClusterManagers( - List toAdd, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future updateClusterManagers(List toAdd, List idsToRemove) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([toAdd, idsToRemove]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([toAdd, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -766,18 +835,15 @@ class MapsApi { } /// Updates the set of markers on the map. - Future updateMarkers(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future updateMarkers(List toAdd, List toChange, List idsToRemove) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -792,18 +858,15 @@ class MapsApi { } /// Updates the set of polygonss on the map. - Future updatePolygons(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future updatePolygons(List toAdd, List toChange, List idsToRemove) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -818,18 +881,15 @@ class MapsApi { } /// Updates the set of polylines on the map. - Future updatePolylines(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future updatePolylines(List toAdd, List toChange, List idsToRemove) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -844,18 +904,15 @@ class MapsApi { } /// Updates the set of tile overlays on the map. - Future updateTileOverlays(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future updateTileOverlays(List toAdd, List toChange, List idsToRemove) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -871,10 +928,8 @@ class MapsApi { /// Gets the screen coordinate for the given map location. Future getScreenCoordinate(PlatformLatLng latLng) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -901,16 +956,14 @@ class MapsApi { /// Gets the map location for the given screen coordinate. Future getLatLng(PlatformPoint screenCoordinate) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([screenCoordinate]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([screenCoordinate]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -931,10 +984,8 @@ class MapsApi { /// Gets the map region currently displayed on the map. Future getVisibleRegion() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -962,10 +1013,8 @@ class MapsApi { /// Moves the camera according to [cameraUpdate] immediately, with no /// animation. Future moveCamera(PlatformCameraUpdate cameraUpdate) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -987,10 +1036,8 @@ class MapsApi { /// Moves the camera according to [cameraUpdate], animating the update. Future animateCamera(PlatformCameraUpdate cameraUpdate) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1012,10 +1059,8 @@ class MapsApi { /// Gets the current map zoom level. Future getZoomLevel() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1042,10 +1087,8 @@ class MapsApi { /// Show the info window for the marker with the given ID. Future showInfoWindow(String markerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1067,10 +1110,8 @@ class MapsApi { /// Hide the info window for the marker with the given ID. Future hideInfoWindow(String markerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1093,10 +1134,8 @@ class MapsApi { /// Returns true if the marker with the given ID is currently displaying its /// info window. Future isInfoWindowShown(String markerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1127,10 +1166,8 @@ class MapsApi { /// Returns false if there was an error setting the style, such as an invalid /// style string. Future setStyle(String style) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1161,10 +1198,8 @@ class MapsApi { /// This allows checking asynchronously for initial style failures, as there /// is no way to return failures from map initialization. Future didLastStyleSucceed() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1191,10 +1226,8 @@ class MapsApi { /// Clears the cache of tiles previously requseted from the tile provider. Future clearTileCache(String tileOverlayId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1216,10 +1249,8 @@ class MapsApi { /// Takes a snapshot of the map and returns its image data. Future takeSnapshot() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1291,21 +1322,13 @@ abstract class MapsCallbackApi { void onPolylineTap(String polylineId); /// Called to get data for a map tile. - Future getTileOverlayTile( - String tileOverlayId, PlatformPoint location, int zoom); - - static void setUp( - MapsCallbackApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + Future getTileOverlayTile(String tileOverlayId, PlatformPoint location, int zoom); + + static void setUp(MapsCallbackApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -1316,28 +1339,24 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove was null.'); final List args = (message as List?)!; - final PlatformCameraPosition? arg_cameraPosition = - (args[0] as PlatformCameraPosition?); + final PlatformCameraPosition? arg_cameraPosition = (args[0] as PlatformCameraPosition?); assert(arg_cameraPosition != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove was null, expected non-null PlatformCameraPosition.'); try { @@ -1345,18 +1364,15 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -1367,25 +1383,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap was null.'); final List args = (message as List?)!; final PlatformLatLng? arg_position = (args[0] as PlatformLatLng?); assert(arg_position != null, @@ -1395,25 +1408,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress was null.'); final List args = (message as List?)!; final PlatformLatLng? arg_position = (args[0] as PlatformLatLng?); assert(arg_position != null, @@ -1423,25 +1433,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap was null.'); final List args = (message as List?)!; final String? arg_markerId = (args[0] as String?); assert(arg_markerId != null, @@ -1451,25 +1458,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart was null.'); final List args = (message as List?)!; final String? arg_markerId = (args[0] as String?); assert(arg_markerId != null, @@ -1482,25 +1486,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag was null.'); final List args = (message as List?)!; final String? arg_markerId = (args[0] as String?); assert(arg_markerId != null, @@ -1513,25 +1514,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd was null.'); final List args = (message as List?)!; final String? arg_markerId = (args[0] as String?); assert(arg_markerId != null, @@ -1544,25 +1542,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap was null.'); final List args = (message as List?)!; final String? arg_markerId = (args[0] as String?); assert(arg_markerId != null, @@ -1572,25 +1567,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap was null.'); final List args = (message as List?)!; final String? arg_circleId = (args[0] as String?); assert(arg_circleId != null, @@ -1600,25 +1592,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap was null.'); final List args = (message as List?)!; final PlatformCluster? arg_cluster = (args[0] as PlatformCluster?); assert(arg_cluster != null, @@ -1628,25 +1617,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap was null.'); final List args = (message as List?)!; final String? arg_polygonId = (args[0] as String?); assert(arg_polygonId != null, @@ -1656,25 +1642,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap was null.'); final List args = (message as List?)!; final String? arg_polylineId = (args[0] as String?); assert(arg_polylineId != null, @@ -1684,25 +1667,22 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile was null.'); final List args = (message as List?)!; final String? arg_tileOverlayId = (args[0] as String?); assert(arg_tileOverlayId != null, @@ -1714,14 +1694,12 @@ abstract class MapsCallbackApi { assert(arg_zoom != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile was null, expected non-null int.'); try { - final PlatformTile output = await api.getTileOverlayTile( - arg_tileOverlayId!, arg_location!, arg_zoom!); + final PlatformTile output = await api.getTileOverlayTile(arg_tileOverlayId!, arg_location!, arg_zoom!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -1734,11 +1712,9 @@ class MapsInitializerApi { /// Constructor for [MapsInitializerApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MapsInitializerApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MapsInitializerApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -1751,12 +1727,9 @@ class MapsInitializerApi { /// /// Calling this more than once in the lifetime of an application will result /// in an error. - Future initializeWithPreferredRenderer( - PlatformRendererType? type) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future initializeWithPreferredRenderer(PlatformRendererType? type) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1787,11 +1760,9 @@ class MapsInspectorApi { /// Constructor for [MapsInspectorApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MapsInspectorApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MapsInspectorApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -1799,10 +1770,8 @@ class MapsInspectorApi { final String __pigeon_messageChannelSuffix; Future areBuildingsEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1828,10 +1797,8 @@ class MapsInspectorApi { } Future areRotateGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1857,10 +1824,8 @@ class MapsInspectorApi { } Future areZoomControlsEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1886,10 +1851,8 @@ class MapsInspectorApi { } Future areScrollGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1915,10 +1878,8 @@ class MapsInspectorApi { } Future areTiltGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1944,10 +1905,8 @@ class MapsInspectorApi { } Future areZoomGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1973,10 +1932,8 @@ class MapsInspectorApi { } Future isCompassEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2002,10 +1959,8 @@ class MapsInspectorApi { } Future isLiteModeEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2026,10 +1981,8 @@ class MapsInspectorApi { } Future isMapToolbarEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2055,10 +2008,8 @@ class MapsInspectorApi { } Future isMyLocationButtonEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2084,10 +2035,8 @@ class MapsInspectorApi { } Future isTrafficEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2113,10 +2062,8 @@ class MapsInspectorApi { } Future getTileOverlayInfo(String tileOverlayId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2137,10 +2084,8 @@ class MapsInspectorApi { } Future getZoomRange() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2166,16 +2111,14 @@ class MapsInspectorApi { } Future> getClusters(String clusterManagerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([clusterManagerId]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([clusterManagerId]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2190,8 +2133,7 @@ class MapsInspectorApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)! - .cast(); + return (__pigeon_replyList[0] as List?)!.cast(); } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart index 33ca3931011..0d0336391ff 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart @@ -105,12 +105,12 @@ class PlatformMarker { }); final double alpha; - final List anchor; + final Float64List anchor; final bool consumeTapEvents; final bool draggable; final bool flat; final Object icon; - final Map infoWindow; + final Map infoWindow; final PlatformLatLng position; final double rotation; final bool visible; From 498a71e3fa7326bf325aae8598ebd7168ce51cdc Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Tue, 6 Aug 2024 15:26:10 -0400 Subject: [PATCH 03/35] Convert marker --- .../flutter/plugins/googlemaps/Convert.java | 14 +++++ .../plugins/googlemaps/MarkersController.java | 23 +++++--- .../flutter/plugins/googlemaps/Messages.java | 53 +++++++++++++++++-- .../lib/src/google_maps_flutter_android.dart | 4 +- .../lib/src/messages.g.dart | 10 ++++ .../pigeons/messages.dart | 4 ++ 6 files changed, 98 insertions(+), 10 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index 14a4872cd8d..82934f60985 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -660,6 +660,20 @@ static void interpretGoogleMapOptions(Object o, GoogleMapOptionsSink sink) { } } + static void interpretMarkerOptions(Messages.PlatformMarker marker, MarkerOptionsSink sink, AssetManager assetManager, float density) { + sink.setAlpha(marker.getAlpha().floatValue()); + sink.setAnchor((float)marker.getAnchor()[0], (float)marker.getAnchor()[1]); + sink.setConsumeTapEvents(marker.getConsumeTapEvents()); + sink.setDraggable(marker.getDraggable()); + sink.setFlat(marker.getFlat()); + sink.setIcon(toBitmapDescriptor(marker.getIcon(), assetManager, density)); + interpretInfoWindowOptions(sink, marker.getInfoWindow()); + sink.setPosition(toLatLng(marker.getPosition().toList())); + sink.setRotation(marker.getRotation().floatValue()); + sink.setVisible(marker.getVisible()); + sink.setZIndex(marker.getZIndex().floatValue()); + } + /** Set the options in the given object to marker options sink. */ static void interpretMarkerOptions( Map data, MarkerOptionsSink sink, AssetManager assetManager, float density) { diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java index d6546cc621b..7ed0da1c3fb 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java @@ -56,13 +56,13 @@ void addJsonMarkers(List markersToAdd) { void addMarkers(@NonNull List markersToAdd) { for (Messages.PlatformMarker markerToAdd : markersToAdd) { - addJsonMarker(markerToAdd.getJson()); + addMarker(markerToAdd); } } void changeMarkers(@NonNull List markersToChange) { for (Messages.PlatformMarker markerToChange : markersToChange) { - changeJsonMarker(markerToChange.getJson()); + changeMarker(markerToChange); } } @@ -193,6 +193,17 @@ private void addJsonMarker(Map marker) { addMarker(markerBuilder); } + private void addMarker(Messages.PlatformMarker marker) { + if (marker == null) { + return; + } + String markerId = marker.getMarkerId(); + String clusterManagerId = marker.getClusterManagerId(); + MarkerBuilder markerBuilder = new MarkerBuilder(markerId, clusterManagerId); + Convert.interpretMarkerOptions(marker, markerBuilder, assetManager, density); + addMarker(markerBuilder); + } + private void addMarker(MarkerBuilder markerBuilder) { if (markerBuilder == null) { return; @@ -225,25 +236,25 @@ private void createControllerForMarker(String markerId, Marker marker, boolean c googleMapsMarkerIdToDartMarkerId.put(marker.getId(), markerId); } - private void changeJsonMarker(Map marker) { + private void changeMarker(Messages.PlatformMarker marker) { if (marker == null) { return; } - String markerId = getMarkerId(marker); + String markerId = marker.getMarkerId(); MarkerBuilder markerBuilder = markerIdToMarkerBuilder.get(markerId); if (markerBuilder == null) { return; } - String clusterManagerId = getClusterManagerId(marker); + String clusterManagerId = marker.getClusterManagerId(); String oldClusterManagerId = markerBuilder.clusterManagerId(); // If the cluster ID on the updated marker has changed, the marker needs to // be removed and re-added to update its cluster manager state. if (!(Objects.equals(clusterManagerId, oldClusterManagerId))) { removeMarker(markerId); - addJsonMarker(marker); + addMarker(marker); return; } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java index 9b391d2b33c..640a997e734 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java @@ -855,6 +855,29 @@ public void setZIndex(@NonNull Double setterArg) { this.zIndex = setterArg; } + private @NonNull String markerId; + + public @NonNull String getMarkerId() { + return markerId; + } + + public void setMarkerId(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"markerId\" is null."); + } + this.markerId = setterArg; + } + + private @Nullable String clusterManagerId; + + public @Nullable String getClusterManagerId() { + return clusterManagerId; + } + + public void setClusterManagerId(@Nullable String setterArg) { + this.clusterManagerId = setterArg; + } + /** Constructor is non-public to enforce null safety; use Builder. */ PlatformMarker() {} @@ -863,12 +886,12 @@ public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PlatformMarker that = (PlatformMarker) o; - return alpha.equals(that.alpha) && Arrays.equals(anchor, that.anchor) && consumeTapEvents.equals(that.consumeTapEvents) && draggable.equals(that.draggable) && flat.equals(that.flat) && icon.equals(that.icon) && infoWindow.equals(that.infoWindow) && position.equals(that.position) && rotation.equals(that.rotation) && visible.equals(that.visible) && zIndex.equals(that.zIndex); + return alpha.equals(that.alpha) && Arrays.equals(anchor, that.anchor) && consumeTapEvents.equals(that.consumeTapEvents) && draggable.equals(that.draggable) && flat.equals(that.flat) && icon.equals(that.icon) && infoWindow.equals(that.infoWindow) && position.equals(that.position) && rotation.equals(that.rotation) && visible.equals(that.visible) && zIndex.equals(that.zIndex) && markerId.equals(that.markerId) && Objects.equals(clusterManagerId, that.clusterManagerId); } @Override public int hashCode() { - int __pigeon_result = Objects.hash(alpha, consumeTapEvents, draggable, flat, icon, infoWindow, position, rotation, visible, zIndex); + int __pigeon_result = Objects.hash(alpha, consumeTapEvents, draggable, flat, icon, infoWindow, position, rotation, visible, zIndex, markerId, clusterManagerId); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(anchor); return __pigeon_result; } @@ -963,6 +986,22 @@ public static final class Builder { return this; } + private @Nullable String markerId; + + @CanIgnoreReturnValue + public @NonNull Builder setMarkerId(@NonNull String setterArg) { + this.markerId = setterArg; + return this; + } + + private @Nullable String clusterManagerId; + + @CanIgnoreReturnValue + public @NonNull Builder setClusterManagerId(@Nullable String setterArg) { + this.clusterManagerId = setterArg; + return this; + } + public @NonNull PlatformMarker build() { PlatformMarker pigeonReturn = new PlatformMarker(); pigeonReturn.setAlpha(alpha); @@ -976,13 +1015,15 @@ public static final class Builder { pigeonReturn.setRotation(rotation); pigeonReturn.setVisible(visible); pigeonReturn.setZIndex(zIndex); + pigeonReturn.setMarkerId(markerId); + pigeonReturn.setClusterManagerId(clusterManagerId); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(11); + ArrayList toListResult = new ArrayList(13); toListResult.add(alpha); toListResult.add(anchor); toListResult.add(consumeTapEvents); @@ -994,6 +1035,8 @@ ArrayList toList() { toListResult.add(rotation); toListResult.add(visible); toListResult.add(zIndex); + toListResult.add(markerId); + toListResult.add(clusterManagerId); return toListResult; } @@ -1021,6 +1064,10 @@ ArrayList toList() { pigeonResult.setVisible((Boolean) visible); Object zIndex = __pigeon_list.get(10); pigeonResult.setZIndex((Double) zIndex); + Object markerId = __pigeon_list.get(11); + pigeonResult.setMarkerId((String) markerId); + Object clusterManagerId = __pigeon_list.get(12); + pigeonResult.setClusterManagerId((String) clusterManagerId); return pigeonResult; } } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart index e039a299702..48cf914a5af 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart @@ -724,12 +724,14 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { consumeTapEvents: marker.consumeTapEvents, draggable: marker.draggable, flat: marker.flat, - icon: marker.icon, + icon: marker.icon.toJson(), infoWindow: marker.infoWindow.toJson() as Map, position: _platformLatLngFromLatLng(marker.position), rotation: marker.rotation, visible: marker.visible, zIndex: marker.zIndex, + markerId: marker.markerId.value, + clusterManagerId: marker.clusterManagerId?.value, ); } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart index fac958f2688..245486c2c21 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart @@ -218,6 +218,8 @@ class PlatformMarker { required this.rotation, required this.visible, required this.zIndex, + required this.markerId, + this.clusterManagerId, }); double alpha; @@ -242,6 +244,10 @@ class PlatformMarker { double zIndex; + String markerId; + + String? clusterManagerId; + Object encode() { return [ alpha, @@ -255,6 +261,8 @@ class PlatformMarker { rotation, visible, zIndex, + markerId, + clusterManagerId, ]; } @@ -272,6 +280,8 @@ class PlatformMarker { rotation: result[8]! as double, visible: result[9]! as bool, zIndex: result[10]! as double, + markerId: result[11]! as String, + clusterManagerId: result[12] as String?, ); } } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart index 0d0336391ff..6d211d6375b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart @@ -102,6 +102,8 @@ class PlatformMarker { required this.rotation, required this.visible, required this.zIndex, + required this.markerId, + this.clusterManagerId, }); final double alpha; @@ -115,6 +117,8 @@ class PlatformMarker { final double rotation; final bool visible; final double zIndex; + final String markerId; + final String? clusterManagerId; } /// Pigeon equivalent of the Polygon class. From f7295ec0b14746874af01240110c3771037644be Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Tue, 6 Aug 2024 15:56:42 -0400 Subject: [PATCH 04/35] Update tests (not yet run) --- .../google_maps_flutter_android_test.dart | 57 +++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart index 5e3943b26ab..7e6c6a9f0c6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart @@ -12,6 +12,7 @@ import 'package:google_maps_flutter_android/src/messages.g.dart'; import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; +import 'package:pigeon/pigeon.dart'; import 'google_maps_flutter_android_test.mocks.dart'; @@ -287,10 +288,30 @@ void main() { expect(toRemove.first, object1.circleId.value); // Object two should be changed. expect(toChange.length, 1); - expect(toChange.first?.json, object2new.toJson()); + expect(toChange.first?.encode(), [ + object2new.consumeTapEvents, + object2new.fillColor.value, + object2new.strokeColor.value, + object2new.visible, + object2new.strokeWidth, + object2new.zIndex as double, + PlatformLatLng(latitude: object2new.center.latitude, longitude: object2new.center.longitude), + object2new.radius, + object2new.circleId.value, + ]); // Object 3 should be added. expect(toAdd.length, 1); - expect(toAdd.first?.json, object3.toJson()); + expect(toAdd.first?.encode(), [ + object3.consumeTapEvents, + object3.fillColor.value, + object3.strokeColor.value, + object3.visible, + object3.strokeWidth, + object3.zIndex as double, + PlatformLatLng(latitude: object3.center.latitude, longitude: object3.center.longitude), + object3.radius, + object3.circleId.value, + ]); }); test('updateClusterManagers passes expected arguments', () async { @@ -348,10 +369,38 @@ void main() { expect(toRemove.first, object1.markerId.value); // Object two should be changed. expect(toChange.length, 1); - expect(toChange.first?.json, object2new.toJson()); + expect(toChange.first?.encode(), [ + object2new.alpha, + Float64List.fromList([object2new.anchor.dx, object2new.anchor.dy]), + object2new.consumeTapEvents, + object2new.draggable, + object2new.flat, + object2new.icon.toJson(), + object2new.infoWindow.toJson(), + PlatformLatLng(latitude: object2new.position.latitude, longitude: object2new.position.longitude), + object2new.rotation, + object2new.visible, + object2new.zIndex, + object2new.markerId.value, + object2new.clusterManagerId?.value, + ]); // Object 3 should be added. expect(toAdd.length, 1); - expect(toAdd.first?.json, object3.toJson()); + expect(toAdd.first?.encode(), [ + object3.alpha, + Float64List.fromList([object3.anchor.dx, object3.anchor.dy]), + object3.consumeTapEvents, + object3.draggable, + object3.flat, + object3.icon.toJson(), + object3.infoWindow.toJson(), + PlatformLatLng(latitude: object3.position.latitude, longitude: object3.position.longitude), + object3.rotation, + object3.visible, + object3.zIndex, + object3.markerId.value, + object3.clusterManagerId?.value, + ]); }); test('updatePolygons passes expected arguments', () async { From b726dffa01ea8b425ea899ca7e8f9805e772b581 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Tue, 6 Aug 2024 17:09:45 -0400 Subject: [PATCH 05/35] Update java tests --- .../googlemaps/CirclesControllerTest.java | 33 ++++----- .../googlemaps/MarkersControllerTest.java | 68 ++++++------------- 2 files changed, 36 insertions(+), 65 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/CirclesControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/CirclesControllerTest.java index 2df310d13c3..cf64b4b5622 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/CirclesControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/CirclesControllerTest.java @@ -15,10 +15,8 @@ import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.Circle; import com.google.android.gms.maps.model.CircleOptions; -import java.util.Arrays; + import java.util.Collections; -import java.util.HashMap; -import java.util.Map; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -50,27 +48,26 @@ public void controller_changeCircles_updatesExistingCircle() { controller.setGoogleMap(mockGoogleMap); final String id = "a_circle"; - final Map circleJson = new HashMap<>(); - circleJson.put("circleId", id); - circleJson.put("consumeTapEvents", false); - circleJson.put("fillColor", 0); - circleJson.put("center", Arrays.asList(0.0, 0.0)); - circleJson.put("radius", 1.0); - circleJson.put("strokeColor", 0); - circleJson.put("strokeWidth", 1.0); - circleJson.put("visible", true); - circleJson.put("zIndex", 0); + + final Messages.PlatformCircle.Builder builder = new Messages.PlatformCircle.Builder(); + builder.setCircleId(id) + .setConsumeTapEvents(false) + .setFillColor(0L) + .setCenter(new Messages.PlatformLatLng.Builder().setLatitude(0.0).setLongitude(0.0).build()) + .setRadius(1.0) + .setStrokeColor(0L) + .setStrokeWidth(1L) + .setVisible(true) + .setZIndex(0.0); controller.addCircles( - Collections.singletonList( - new Messages.PlatformCircle.Builder().setJson(circleJson).build())); + Collections.singletonList(builder.build())); // There should be exactly one circle. Assert.assertEquals(1, controller.circleIdToController.size()); - circleJson.put("consumeTapEvents", true); + builder.setConsumeTapEvents(true); controller.changeCircles( - Collections.singletonList( - new Messages.PlatformCircle.Builder().setJson(circleJson).build())); + Collections.singletonList(builder.build())); // There should still only be one circle, and it should be updated. Assert.assertEquals(1, controller.circleIdToController.size()); verify(circle, times(1)).setClickable(true); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index 820ef50c451..7d03a044413 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -77,11 +77,9 @@ public void controller_OnMarkerDragStart() { when(googleMap.addMarker(any(MarkerOptions.class))).thenReturn(marker); final LatLng latLng = new LatLng(1.1, 2.2); - final Map markerOptions = new HashMap<>(); - markerOptions.put("markerId", googleMarkerId); - final List markers = Arrays.asList(markerOptions); - controller.addJsonMarkers(markers); + final List markers = Collections.singletonList(new Messages.PlatformMarker.Builder().setMarkerId(googleMarkerId).build()); + controller.addMarkers(markers); controller.onMarkerDragStart(googleMarkerId, latLng); Mockito.verify(flutterApi) @@ -98,11 +96,9 @@ public void controller_OnMarkerDragEnd() { when(googleMap.addMarker(any(MarkerOptions.class))).thenReturn(marker); final LatLng latLng = new LatLng(1.1, 2.2); - final Map markerOptions = new HashMap<>(); - markerOptions.put("markerId", googleMarkerId); - final List markers = Arrays.asList(markerOptions); - controller.addJsonMarkers(markers); + final List markers = Collections.singletonList(new Messages.PlatformMarker.Builder().setMarkerId(googleMarkerId).build()); + controller.addMarkers(markers); controller.onMarkerDragEnd(googleMarkerId, latLng); Mockito.verify(flutterApi) @@ -119,11 +115,9 @@ public void controller_OnMarkerDrag() { when(googleMap.addMarker(any(MarkerOptions.class))).thenReturn(marker); final LatLng latLng = new LatLng(1.1, 2.2); - final Map markerOptions = new HashMap<>(); - markerOptions.put("markerId", googleMarkerId); - final List markers = Arrays.asList(markerOptions); - controller.addJsonMarkers(markers); + final List markers = Collections.singletonList(new Messages.PlatformMarker.Builder().setMarkerId(googleMarkerId).build()); + controller.addMarkers(markers); controller.onMarkerDrag(googleMarkerId, latLng); Mockito.verify(flutterApi) @@ -134,9 +128,9 @@ public void controller_OnMarkerDrag() { public void controller_AddMarkerThrowsErrorIfMarkerIdIsNull() { final Map markerOptions = new HashMap<>(); - final List markers = Arrays.asList(markerOptions); + final List markers = Collections.singletonList(new Messages.PlatformMarker.Builder().build()); try { - controller.addJsonMarkers(markers); + controller.addMarkers(markers); } catch (IllegalArgumentException e) { assertEquals("markerId was null", e.getMessage()); throw e; @@ -150,22 +144,15 @@ public void controller_AddChangeAndRemoveMarkerWithClusterManagerId() { final String googleMarkerId = "abc123"; final String clusterManagerId = "cm123"; - when(marker.getId()).thenReturn(googleMarkerId); - - final LatLng latLng1 = new LatLng(1.1, 2.2); - final List location1 = new ArrayList<>(); - location1.add(latLng1.latitude); - location1.add(latLng1.longitude); + final Messages.PlatformMarker.Builder builder = new Messages.PlatformMarker.Builder(); + builder.setMarkerId(googleMarkerId) + .setClusterManagerId(clusterManagerId) + .setPosition(new Messages.PlatformLatLng.Builder().setLatitude(1.1).setLongitude(2.2).build()); - final Map markerOptions1 = new HashMap<>(); - markerOptions1.put("markerId", googleMarkerId); - markerOptions1.put("position", location1); - markerOptions1.put("clusterManagerId", clusterManagerId); - - final List markers = Arrays.asList(markerOptions1); + when(marker.getId()).thenReturn(googleMarkerId); // Add marker and capture the markerBuilder - controller.addJsonMarkers(markers); + controller.addMarkers(Collections.singletonList(builder.build())); ArgumentCaptor captor = ArgumentCaptor.forClass(MarkerBuilder.class); Mockito.verify(clusterManagersController, times(1)).addItem(captor.capture()); MarkerBuilder capturedMarkerBuilder = captor.getValue(); @@ -176,17 +163,10 @@ public void controller_AddChangeAndRemoveMarkerWithClusterManagerId() { // Change marker to test that markerController is created and the marker can be updated final LatLng latLng2 = new LatLng(3.3, 4.4); - final List location2 = new ArrayList<>(); - location2.add(latLng2.latitude); - location2.add(latLng2.longitude); - - final Map markerOptions2 = new HashMap<>(); - markerOptions2.put("markerId", googleMarkerId); - markerOptions2.put("position", location2); - markerOptions2.put("clusterManagerId", clusterManagerId); + + builder.setPosition(new Messages.PlatformLatLng.Builder().setLatitude(3.3).setLongitude(4.4).build()); final List updatedMarkers = - Collections.singletonList( - new Messages.PlatformMarker.Builder().setJson(markerOptions2).build()); + Collections.singletonList(builder.build()); controller.changeMarkers(updatedMarkers); Mockito.verify(marker, times(1)).setPosition(latLng2); @@ -212,11 +192,9 @@ public void controller_AddChangeAndRemoveMarkerWithoutClusterManagerId() { when(marker.getId()).thenReturn(googleMarkerId); when(googleMap.addMarker(any(MarkerOptions.class))).thenReturn(marker); - final Map markerOptions1 = new HashMap<>(); - markerOptions1.put("markerId", googleMarkerId); - - final List markers = Arrays.asList(markerOptions1); - controller.addJsonMarkers(markers); + final Messages.PlatformMarker.Builder builder = new Messages.PlatformMarker.Builder(); + builder.setMarkerId(googleMarkerId); + controller.addMarkers(Collections.singletonList(builder.build())); // clusterManagersController should not be called when adding the marker Mockito.verify(clusterManagersController, times(0)).addItem(any()); @@ -224,13 +202,9 @@ public void controller_AddChangeAndRemoveMarkerWithoutClusterManagerId() { Mockito.verify(spyMarkerCollection, times(1)).addMarker(any(MarkerOptions.class)); final float alpha = 0.1f; - final Map markerOptions2 = new HashMap<>(); - markerOptions2.put("markerId", googleMarkerId); - markerOptions2.put("alpha", alpha); final List markerUpdates = - Collections.singletonList( - new Messages.PlatformMarker.Builder().setJson(markerOptions2).build()); + Collections.singletonList(builder.setAlpha((double) alpha).build()); controller.changeMarkers(markerUpdates); Mockito.verify(marker, times(1)).setAlpha(alpha); From 089ffada0f200606738d8e320ff05e91b98da39e Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Tue, 6 Aug 2024 17:29:28 -0400 Subject: [PATCH 06/35] Public InfoWindow.toJson --- .../lib/src/types/marker.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart index 0921d2d4ec5..0c63d0d1108 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart @@ -64,7 +64,7 @@ class InfoWindow { ); } - Object _toJson() { + Object toJson() { final Map json = {}; void addIfPresent(String fieldName, Object? value) { @@ -296,7 +296,7 @@ class Marker implements MapsObject { addIfPresent('draggable', draggable); addIfPresent('flat', flat); addIfPresent('icon', icon.toJson()); - addIfPresent('infoWindow', infoWindow._toJson()); + addIfPresent('infoWindow', infoWindow.toJson()); addIfPresent('position', position.toJson()); addIfPresent('rotation', rotation); addIfPresent('visible', visible); From a0942663c9fda2e2df835042f2cd73f5e742da9c Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Wed, 7 Aug 2024 14:02:47 -0400 Subject: [PATCH 07/35] Update versioning --- .../google_maps_flutter_android/CHANGELOG.md | 4 ++++ .../google_maps_flutter_android/pubspec.yaml | 4 ++-- .../google_maps_flutter_platform_interface/CHANGELOG.md | 4 ++++ .../google_maps_flutter_platform_interface/pubspec.yaml | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md index e48f90c9073..aad5e2975ad 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.13.1 + +* Convert `PlatformCircle` and `PlatformMarker` to pigeon. + ## 2.13.0 * Adds support for heatmap layers. diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 82068018bc7..768634364da 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_android description: Android implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.13.0 +version: 2.13.1 environment: sdk: ^3.4.0 @@ -21,7 +21,7 @@ dependencies: flutter: sdk: flutter flutter_plugin_android_lifecycle: ^2.0.1 - google_maps_flutter_platform_interface: ^2.9.0 + google_maps_flutter_platform_interface: ^2.9.1 stream_transform: ^2.0.0 dev_dependencies: diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index 62ba5277b89..b7d278742a3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.9.1 + +* Expose `Messages.PlatformMarker.InfoWindow.toJson` for pigeon conversion. + ## 2.9.0 * Adds support for heatmap layers. diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml index a01bed82ff4..20cd26f3e44 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.9.0 +version: 2.9.1 environment: sdk: ^3.2.0 From 9984cc9c6f8c20de1a2c89423bf27d9962d794f7 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Wed, 7 Aug 2024 14:49:03 -0400 Subject: [PATCH 08/35] Federeated plugin path deps --- .../google_maps_flutter_android/example/pubspec.yaml | 5 +++++ .../google_maps_flutter_android/pubspec.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml index 9f3931140f6..c4e75c19a96 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml @@ -33,3 +33,8 @@ flutter: uses-material-design: true assets: - assets/ + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + {google_maps_flutter_android: {path: ../../../google_maps_flutter/google_maps_flutter_android}, google_maps_flutter_platform_interface: {path: ../../../google_maps_flutter/google_maps_flutter_platform_interface}} diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 768634364da..67b1fc1f63e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -37,3 +37,8 @@ topics: - google-maps - google-maps-flutter - map + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + {google_maps_flutter_platform_interface: {path: ../../google_maps_flutter/google_maps_flutter_platform_interface}} From a0034dcfed3dcd99c778a0b7fc054284b13dc596 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Wed, 7 Aug 2024 15:03:39 -0400 Subject: [PATCH 09/35] Analysis --- .../lib/src/google_maps_flutter_android.dart | 2 +- .../test/google_maps_flutter_android_test.dart | 4 ++-- .../lib/src/types/marker.dart | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart index 48cf914a5af..0189dbd3279 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart @@ -720,7 +720,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { // messages.dart. return PlatformMarker( alpha: marker.alpha, - anchor: Float64List.fromList([marker.anchor.dx, marker.anchor.dy]), + anchor: Float64List.fromList([marker.anchor.dx, marker.anchor.dy]), consumeTapEvents: marker.consumeTapEvents, draggable: marker.draggable, flat: marker.flat, diff --git a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart index 7e6c6a9f0c6..3fb944adfc1 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart @@ -371,7 +371,7 @@ void main() { expect(toChange.length, 1); expect(toChange.first?.encode(), [ object2new.alpha, - Float64List.fromList([object2new.anchor.dx, object2new.anchor.dy]), + Float64List.fromList([object2new.anchor.dx, object2new.anchor.dy]), object2new.consumeTapEvents, object2new.draggable, object2new.flat, @@ -388,7 +388,7 @@ void main() { expect(toAdd.length, 1); expect(toAdd.first?.encode(), [ object3.alpha, - Float64List.fromList([object3.anchor.dx, object3.anchor.dy]), + Float64List.fromList([object3.anchor.dx, object3.anchor.dy]), object3.consumeTapEvents, object3.draggable, object3.flat, diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart index 0c63d0d1108..b51cd9ada67 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart @@ -64,6 +64,7 @@ class InfoWindow { ); } + /// Converts this object to something serializable in JSON. Object toJson() { final Map json = {}; From bcd1dc04ea40274f7d62e4380ad759c3a8c91b91 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Wed, 7 Aug 2024 16:37:50 -0400 Subject: [PATCH 10/35] Null issues --- .../flutter/plugins/googlemaps/Convert.java | 3 +- .../flutter/plugins/googlemaps/Messages.java | 165 ++++++++++++++---- .../googlemaps/MarkersControllerTest.java | 20 ++- .../lib/src/google_maps_flutter_android.dart | 6 +- .../lib/src/messages.g.dart | 118 ++++++++----- .../pigeons/messages.dart | 46 +++-- 6 files changed, 253 insertions(+), 105 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index 82934f60985..10bb2cf9da0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -662,7 +662,7 @@ static void interpretGoogleMapOptions(Object o, GoogleMapOptionsSink sink) { static void interpretMarkerOptions(Messages.PlatformMarker marker, MarkerOptionsSink sink, AssetManager assetManager, float density) { sink.setAlpha(marker.getAlpha().floatValue()); - sink.setAnchor((float)marker.getAnchor()[0], (float)marker.getAnchor()[1]); + sink.setAnchor(marker.getAnchor().getDx().floatValue(), marker.getAnchor().getDy().floatValue()); sink.setConsumeTapEvents(marker.getConsumeTapEvents()); sink.setDraggable(marker.getDraggable()); sink.setFlat(marker.getFlat()); @@ -847,6 +847,7 @@ static String interpretCircleOptions(Messages.PlatformCircle circle, CircleOptio sink.setZIndex(circle.getZIndex().floatValue()); sink.setCenter(toLatLng(circle.getCenter().toList())); sink.setRadius(circle.getRadius()); + sink.setVisible(circle.getVisible()); return circle.getCircleId(); } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java index 640a997e734..81e55f14c50 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java @@ -706,6 +706,98 @@ ArrayList toList() { } } + /** + * Pigeon equivalent of the Offset class + * + * Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformOffset { + private @NonNull Double dx; + + public @NonNull Double getDx() { + return dx; + } + + public void setDx(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"dx\" is null."); + } + this.dx = setterArg; + } + + private @NonNull Double dy; + + public @NonNull Double getDy() { + return dy; + } + + public void setDy(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"dy\" is null."); + } + this.dy = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformOffset() {} + + @Override + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformOffset that = (PlatformOffset) o; + return dx.equals(that.dx) && dy.equals(that.dy); + } + + @Override + public int hashCode() { + return Objects.hash(dx, dy); + } + + public static final class Builder { + + private @Nullable Double dx; + + @CanIgnoreReturnValue + public @NonNull Builder setDx(@NonNull Double setterArg) { + this.dx = setterArg; + return this; + } + + private @Nullable Double dy; + + @CanIgnoreReturnValue + public @NonNull Builder setDy(@NonNull Double setterArg) { + this.dy = setterArg; + return this; + } + + public @NonNull PlatformOffset build() { + PlatformOffset pigeonReturn = new PlatformOffset(); + pigeonReturn.setDx(dx); + pigeonReturn.setDy(dy); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList(2); + toListResult.add(dx); + toListResult.add(dy); + return toListResult; + } + + static @NonNull PlatformOffset fromList(@NonNull ArrayList __pigeon_list) { + PlatformOffset pigeonResult = new PlatformOffset(); + Object dx = __pigeon_list.get(0); + pigeonResult.setDx((Double) dx); + Object dy = __pigeon_list.get(1); + pigeonResult.setDy((Double) dy); + return pigeonResult; + } + } + /** * Pigeon equivalent of the Marker class. * @@ -725,13 +817,13 @@ public void setAlpha(@NonNull Double setterArg) { this.alpha = setterArg; } - private @NonNull double[] anchor; + private @NonNull PlatformOffset anchor; - public @NonNull double[] getAnchor() { + public @NonNull PlatformOffset getAnchor() { return anchor; } - public void setAnchor(@NonNull double[] setterArg) { + public void setAnchor(@NonNull PlatformOffset setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"anchor\" is null."); } @@ -886,14 +978,12 @@ public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PlatformMarker that = (PlatformMarker) o; - return alpha.equals(that.alpha) && Arrays.equals(anchor, that.anchor) && consumeTapEvents.equals(that.consumeTapEvents) && draggable.equals(that.draggable) && flat.equals(that.flat) && icon.equals(that.icon) && infoWindow.equals(that.infoWindow) && position.equals(that.position) && rotation.equals(that.rotation) && visible.equals(that.visible) && zIndex.equals(that.zIndex) && markerId.equals(that.markerId) && Objects.equals(clusterManagerId, that.clusterManagerId); + return alpha.equals(that.alpha) && anchor.equals(that.anchor) && consumeTapEvents.equals(that.consumeTapEvents) && draggable.equals(that.draggable) && flat.equals(that.flat) && icon.equals(that.icon) && infoWindow.equals(that.infoWindow) && position.equals(that.position) && rotation.equals(that.rotation) && visible.equals(that.visible) && zIndex.equals(that.zIndex) && markerId.equals(that.markerId) && Objects.equals(clusterManagerId, that.clusterManagerId); } @Override public int hashCode() { - int __pigeon_result = Objects.hash(alpha, consumeTapEvents, draggable, flat, icon, infoWindow, position, rotation, visible, zIndex, markerId, clusterManagerId); - __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(anchor); - return __pigeon_result; + return Objects.hash(alpha, anchor, consumeTapEvents, draggable, flat, icon, infoWindow, position, rotation, visible, zIndex, markerId, clusterManagerId); } public static final class Builder { @@ -906,10 +996,10 @@ public static final class Builder { return this; } - private @Nullable double[] anchor; + private @Nullable PlatformOffset anchor; @CanIgnoreReturnValue - public @NonNull Builder setAnchor(@NonNull double[] setterArg) { + public @NonNull Builder setAnchor(@NonNull PlatformOffset setterArg) { this.anchor = setterArg; return this; } @@ -1045,7 +1135,7 @@ ArrayList toList() { Object alpha = __pigeon_list.get(0); pigeonResult.setAlpha((Double) alpha); Object anchor = __pigeon_list.get(1); - pigeonResult.setAnchor((double[]) anchor); + pigeonResult.setAnchor((PlatformOffset) anchor); Object consumeTapEvents = __pigeon_list.get(2); pigeonResult.setConsumeTapEvents((Boolean) consumeTapEvents); Object draggable = __pigeon_list.get(3); @@ -2147,30 +2237,32 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { case (byte) 133: return PlatformClusterManager.fromList((ArrayList) readValue(buffer)); case (byte) 134: - return PlatformMarker.fromList((ArrayList) readValue(buffer)); + return PlatformOffset.fromList((ArrayList) readValue(buffer)); case (byte) 135: - return PlatformPolygon.fromList((ArrayList) readValue(buffer)); + return PlatformMarker.fromList((ArrayList) readValue(buffer)); case (byte) 136: - return PlatformPolyline.fromList((ArrayList) readValue(buffer)); + return PlatformPolygon.fromList((ArrayList) readValue(buffer)); case (byte) 137: - return PlatformTile.fromList((ArrayList) readValue(buffer)); + return PlatformPolyline.fromList((ArrayList) readValue(buffer)); case (byte) 138: - return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); + return PlatformTile.fromList((ArrayList) readValue(buffer)); case (byte) 139: - return PlatformLatLng.fromList((ArrayList) readValue(buffer)); + return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); case (byte) 140: - return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); + return PlatformLatLng.fromList((ArrayList) readValue(buffer)); case (byte) 141: - return PlatformCluster.fromList((ArrayList) readValue(buffer)); + return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); case (byte) 142: - return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); + return PlatformCluster.fromList((ArrayList) readValue(buffer)); case (byte) 143: - return PlatformPoint.fromList((ArrayList) readValue(buffer)); + return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); case (byte) 144: - return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); + return PlatformPoint.fromList((ArrayList) readValue(buffer)); case (byte) 145: - return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); case (byte) 146: + return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + case (byte) 147: Object value = readValue(buffer); return value == null ? null : PlatformRendererType.values()[(int) value]; default: @@ -2195,44 +2287,47 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } else if (value instanceof PlatformClusterManager) { stream.write(133); writeValue(stream, ((PlatformClusterManager) value).toList()); - } else if (value instanceof PlatformMarker) { + } else if (value instanceof PlatformOffset) { stream.write(134); + writeValue(stream, ((PlatformOffset) value).toList()); + } else if (value instanceof PlatformMarker) { + stream.write(135); writeValue(stream, ((PlatformMarker) value).toList()); } else if (value instanceof PlatformPolygon) { - stream.write(135); + stream.write(136); writeValue(stream, ((PlatformPolygon) value).toList()); } else if (value instanceof PlatformPolyline) { - stream.write(136); + stream.write(137); writeValue(stream, ((PlatformPolyline) value).toList()); } else if (value instanceof PlatformTile) { - stream.write(137); + stream.write(138); writeValue(stream, ((PlatformTile) value).toList()); } else if (value instanceof PlatformTileOverlay) { - stream.write(138); + stream.write(139); writeValue(stream, ((PlatformTileOverlay) value).toList()); } else if (value instanceof PlatformLatLng) { - stream.write(139); + stream.write(140); writeValue(stream, ((PlatformLatLng) value).toList()); } else if (value instanceof PlatformLatLngBounds) { - stream.write(140); + stream.write(141); writeValue(stream, ((PlatformLatLngBounds) value).toList()); } else if (value instanceof PlatformCluster) { - stream.write(141); + stream.write(142); writeValue(stream, ((PlatformCluster) value).toList()); } else if (value instanceof PlatformMapConfiguration) { - stream.write(142); + stream.write(143); writeValue(stream, ((PlatformMapConfiguration) value).toList()); } else if (value instanceof PlatformPoint) { - stream.write(143); + stream.write(144); writeValue(stream, ((PlatformPoint) value).toList()); } else if (value instanceof PlatformTileLayer) { - stream.write(144); + stream.write(145); writeValue(stream, ((PlatformTileLayer) value).toList()); } else if (value instanceof PlatformZoomRange) { - stream.write(145); + stream.write(146); writeValue(stream, ((PlatformZoomRange) value).toList()); } else if (value instanceof PlatformRendererType) { - stream.write(146); + stream.write(147); writeValue(stream, value == null ? null : ((PlatformRendererType) value).index); } else { super.writeValue(stream, value); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index 7d03a044413..bff29450558 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -51,6 +51,14 @@ public class MarkersControllerTest { private AssetManager assetManager; private final float density = 1; + private static Messages.PlatformMarker.Builder defaultBuilder() { + return new Messages.PlatformMarker.Builder().setPosition( + new Messages.PlatformLatLng.Builder().setLatitude(0.0).setLongitude(0.0).build() + ).setAnchor( + new Messages.PlatformOffset.Builder().setDx(0.0).setDy(0.0).build() + ); + } + @Before public void setUp() { MockitoAnnotations.openMocks(this); @@ -78,7 +86,7 @@ public void controller_OnMarkerDragStart() { final LatLng latLng = new LatLng(1.1, 2.2); - final List markers = Collections.singletonList(new Messages.PlatformMarker.Builder().setMarkerId(googleMarkerId).build()); + final List markers = Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); controller.addMarkers(markers); controller.onMarkerDragStart(googleMarkerId, latLng); @@ -97,7 +105,7 @@ public void controller_OnMarkerDragEnd() { final LatLng latLng = new LatLng(1.1, 2.2); - final List markers = Collections.singletonList(new Messages.PlatformMarker.Builder().setMarkerId(googleMarkerId).build()); + final List markers = Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); controller.addMarkers(markers); controller.onMarkerDragEnd(googleMarkerId, latLng); @@ -116,7 +124,7 @@ public void controller_OnMarkerDrag() { final LatLng latLng = new LatLng(1.1, 2.2); - final List markers = Collections.singletonList(new Messages.PlatformMarker.Builder().setMarkerId(googleMarkerId).build()); + final List markers = Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); controller.addMarkers(markers); controller.onMarkerDrag(googleMarkerId, latLng); @@ -128,7 +136,7 @@ public void controller_OnMarkerDrag() { public void controller_AddMarkerThrowsErrorIfMarkerIdIsNull() { final Map markerOptions = new HashMap<>(); - final List markers = Collections.singletonList(new Messages.PlatformMarker.Builder().build()); + final List markers = Collections.singletonList(defaultBuilder().build()); try { controller.addMarkers(markers); } catch (IllegalArgumentException e) { @@ -144,7 +152,7 @@ public void controller_AddChangeAndRemoveMarkerWithClusterManagerId() { final String googleMarkerId = "abc123"; final String clusterManagerId = "cm123"; - final Messages.PlatformMarker.Builder builder = new Messages.PlatformMarker.Builder(); + final Messages.PlatformMarker.Builder builder = defaultBuilder(); builder.setMarkerId(googleMarkerId) .setClusterManagerId(clusterManagerId) .setPosition(new Messages.PlatformLatLng.Builder().setLatitude(1.1).setLongitude(2.2).build()); @@ -192,7 +200,7 @@ public void controller_AddChangeAndRemoveMarkerWithoutClusterManagerId() { when(marker.getId()).thenReturn(googleMarkerId); when(googleMap.addMarker(any(MarkerOptions.class))).thenReturn(marker); - final Messages.PlatformMarker.Builder builder = new Messages.PlatformMarker.Builder(); + final Messages.PlatformMarker.Builder builder = defaultBuilder(); builder.setMarkerId(googleMarkerId); controller.addMarkers(Collections.singletonList(builder.build())); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart index 0189dbd3279..47e569be4f7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart @@ -674,6 +674,10 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { latitude: latLng.latitude, longitude: latLng.longitude); } + static PlatformOffset _platformOffsetFromOffset(Offset offset) { + return PlatformOffset(dx: offset.dx, dy: offset.dy); + } + static ScreenCoordinate _screenCoordinateFromPlatformPoint( PlatformPoint point) { return ScreenCoordinate(x: point.x, y: point.y); @@ -720,7 +724,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { // messages.dart. return PlatformMarker( alpha: marker.alpha, - anchor: Float64List.fromList([marker.anchor.dx, marker.anchor.dy]), + anchor: _platformOffsetFromOffset(marker.anchor), consumeTapEvents: marker.consumeTapEvents, draggable: marker.draggable, flat: marker.flat, diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart index 245486c2c21..e679d7eeda0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart @@ -98,14 +98,14 @@ class PlatformCameraUpdate { /// Pigeon equivalent of the Circle class. class PlatformCircle { PlatformCircle({ - required this.consumeTapEvents, - required this.fillColor, - required this.strokeColor, - required this.visible, - required this.strokeWidth, - required this.zIndex, + this.consumeTapEvents = false, + this.fillColor = 0x00000000, + this.strokeColor = 0xFF000000, + this.visible = true, + this.strokeWidth = 10, + this.zIndex = 0.0, required this.center, - required this.radius, + this.radius = 0, required this.circleId, }); @@ -204,27 +204,54 @@ class PlatformClusterManager { } } +/// Pigeon equivalent of the Offset class +class PlatformOffset { + PlatformOffset({ + required this.dx, + required this.dy, + }); + + double dx; + + double dy; + + Object encode() { + return [ + dx, + dy, + ]; + } + + static PlatformOffset decode(Object result) { + result as List; + return PlatformOffset( + dx: result[0]! as double, + dy: result[1]! as double, + ); + } +} + /// Pigeon equivalent of the Marker class. class PlatformMarker { PlatformMarker({ - required this.alpha, + this.alpha = 1.0, required this.anchor, - required this.consumeTapEvents, - required this.draggable, - required this.flat, - required this.icon, - required this.infoWindow, + this.consumeTapEvents = false, + this.draggable = false, + this.flat = false, + this.icon = const ['defaultMarker'], + this.infoWindow = const {'anchor' : [0.5, 0.0]}, required this.position, - required this.rotation, - required this.visible, - required this.zIndex, + this.rotation = 0.0, + this.visible = true, + this.zIndex = 0.0, required this.markerId, this.clusterManagerId, }); double alpha; - Float64List anchor; + PlatformOffset anchor; bool consumeTapEvents; @@ -270,7 +297,7 @@ class PlatformMarker { result as List; return PlatformMarker( alpha: result[0]! as double, - anchor: result[1]! as Float64List, + anchor: result[1]! as PlatformOffset, consumeTapEvents: result[2]! as bool, draggable: result[3]! as bool, flat: result[4]! as bool, @@ -620,44 +647,47 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is PlatformClusterManager) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is PlatformMarker) { + } else if (value is PlatformOffset) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is PlatformPolygon) { + } else if (value is PlatformMarker) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformPolyline) { + } else if (value is PlatformPolygon) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is PlatformTile) { + } else if (value is PlatformPolyline) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PlatformTileOverlay) { + } else if (value is PlatformTile) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLng) { + } else if (value is PlatformTileOverlay) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLngBounds) { + } else if (value is PlatformLatLng) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PlatformCluster) { + } else if (value is PlatformLatLngBounds) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PlatformMapConfiguration) { + } else if (value is PlatformCluster) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PlatformPoint) { + } else if (value is PlatformMapConfiguration) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PlatformTileLayer) { + } else if (value is PlatformPoint) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PlatformZoomRange) { + } else if (value is PlatformTileLayer) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is PlatformRendererType) { + } else if (value is PlatformZoomRange) { buffer.putUint8(146); + writeValue(buffer, value.encode()); + } else if (value is PlatformRendererType) { + buffer.putUint8(147); writeValue(buffer, value.index); } else { super.writeValue(buffer, value); @@ -678,30 +708,32 @@ class _PigeonCodec extends StandardMessageCodec { case 133: return PlatformClusterManager.decode(readValue(buffer)!); case 134: - return PlatformMarker.decode(readValue(buffer)!); + return PlatformOffset.decode(readValue(buffer)!); case 135: - return PlatformPolygon.decode(readValue(buffer)!); + return PlatformMarker.decode(readValue(buffer)!); case 136: - return PlatformPolyline.decode(readValue(buffer)!); + return PlatformPolygon.decode(readValue(buffer)!); case 137: - return PlatformTile.decode(readValue(buffer)!); + return PlatformPolyline.decode(readValue(buffer)!); case 138: - return PlatformTileOverlay.decode(readValue(buffer)!); + return PlatformTile.decode(readValue(buffer)!); case 139: - return PlatformLatLng.decode(readValue(buffer)!); + return PlatformTileOverlay.decode(readValue(buffer)!); case 140: - return PlatformLatLngBounds.decode(readValue(buffer)!); + return PlatformLatLng.decode(readValue(buffer)!); case 141: - return PlatformCluster.decode(readValue(buffer)!); + return PlatformLatLngBounds.decode(readValue(buffer)!); case 142: - return PlatformMapConfiguration.decode(readValue(buffer)!); + return PlatformCluster.decode(readValue(buffer)!); case 143: - return PlatformPoint.decode(readValue(buffer)!); + return PlatformMapConfiguration.decode(readValue(buffer)!); case 144: - return PlatformTileLayer.decode(readValue(buffer)!); + return PlatformPoint.decode(readValue(buffer)!); case 145: - return PlatformZoomRange.decode(readValue(buffer)!); + return PlatformTileLayer.decode(readValue(buffer)!); case 146: + return PlatformZoomRange.decode(readValue(buffer)!); + case 147: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformRendererType.values[value]; default: diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart index 6d211d6375b..769446207d0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart @@ -47,15 +47,15 @@ class PlatformCameraUpdate { /// Pigeon equivalent of the Circle class. class PlatformCircle { PlatformCircle({ - required this.consumeTapEvents, - required this.fillColor, - required this.strokeColor, - required this.visible, - required this.strokeWidth, - required this.zIndex, - required this.center, - required this.radius, required this.circleId, + required this.center, + this.consumeTapEvents = false, + this.fillColor = 0x00000000, + this.strokeColor = 0xFF000000, + this.visible = true, + this.strokeWidth = 10, + this.zIndex = 0.0, + this.radius = 0, }); final bool consumeTapEvents; @@ -88,26 +88,34 @@ class PlatformClusterManager { final String identifier; } +/// Pigeon equivalent of the Offset class +class PlatformOffset { + PlatformOffset(this.dx, this.dy); + + final double dx; + final double dy; +} + /// Pigeon equivalent of the Marker class. class PlatformMarker { PlatformMarker({ - required this.alpha, + required this.markerId, + this.alpha = 1.0, required this.anchor, - required this.consumeTapEvents, - required this.draggable, - required this.flat, - required this.icon, - required this.infoWindow, + this.consumeTapEvents = false, + this.draggable = false, + this.flat = false, + this.icon = const ['defaultMarker'], + this.infoWindow = const {'anchor': [0.5, 0.0]}, required this.position, - required this.rotation, - required this.visible, - required this.zIndex, - required this.markerId, + this.rotation = 0.0, + this.visible = true, + this.zIndex = 0.0, this.clusterManagerId, }); final double alpha; - final Float64List anchor; + final PlatformOffset anchor; final bool consumeTapEvents; final bool draggable; final bool flat; From 4580b3bc38d14153bbeedb7ffffc2fa2a9e2b342 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Wed, 7 Aug 2024 17:22:46 -0400 Subject: [PATCH 11/35] Disect tests --- .../google_maps_flutter_android_test.dart | 146 +++++++++++------- 1 file changed, 90 insertions(+), 56 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart index 3fb944adfc1..80d68956ec6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart @@ -12,7 +12,6 @@ import 'package:google_maps_flutter_android/src/messages.g.dart'; import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:pigeon/pigeon.dart'; import 'google_maps_flutter_android_test.mocks.dart'; @@ -287,31 +286,46 @@ void main() { expect(toRemove.length, 1); expect(toRemove.first, object1.circleId.value); // Object two should be changed. - expect(toChange.length, 1); - expect(toChange.first?.encode(), [ - object2new.consumeTapEvents, - object2new.fillColor.value, - object2new.strokeColor.value, - object2new.visible, - object2new.strokeWidth, - object2new.zIndex as double, - PlatformLatLng(latitude: object2new.center.latitude, longitude: object2new.center.longitude), - object2new.radius, - object2new.circleId.value, - ]); + { + expect(toChange.length, 1); + final List? encoded = toChange.first?.encode() as List?; + expect(encoded?.getRange(0, 6), [ + object2new.consumeTapEvents, + object2new.fillColor.value, + object2new.strokeColor.value, + object2new.visible, + object2new.strokeWidth, + object2new.zIndex.toDouble(), + ]); + final PlatformLatLng? latLng = encoded?[6] as PlatformLatLng?; + expect(latLng?.latitude, object2new.center.latitude); + expect(latLng?.longitude, object2new.center.longitude); + expect(encoded?.getRange(7, 9), [ + object2new.radius, + object2new.circleId.value, + ]); + } // Object 3 should be added. expect(toAdd.length, 1); - expect(toAdd.first?.encode(), [ - object3.consumeTapEvents, - object3.fillColor.value, - object3.strokeColor.value, - object3.visible, - object3.strokeWidth, - object3.zIndex as double, - PlatformLatLng(latitude: object3.center.latitude, longitude: object3.center.longitude), - object3.radius, - object3.circleId.value, - ]); + { + expect(toAdd.length, 1); + final List? encoded = toAdd.first?.encode() as List?; + expect(encoded?.getRange(0, 6), [ + object3.consumeTapEvents, + object3.fillColor.value, + object3.strokeColor.value, + object3.visible, + object3.strokeWidth, + object3.zIndex.toDouble(), + ]); + final PlatformLatLng? latLng = encoded?[6] as PlatformLatLng?; + expect(latLng?.latitude, object3.center.latitude); + expect(latLng?.longitude, object3.center.longitude); + expect(encoded?.getRange(7, 9), [ + object3.radius, + object3.circleId.value, + ]); + } }); test('updateClusterManagers passes expected arguments', () async { @@ -368,39 +382,59 @@ void main() { expect(toRemove.length, 1); expect(toRemove.first, object1.markerId.value); // Object two should be changed. - expect(toChange.length, 1); - expect(toChange.first?.encode(), [ - object2new.alpha, - Float64List.fromList([object2new.anchor.dx, object2new.anchor.dy]), - object2new.consumeTapEvents, - object2new.draggable, - object2new.flat, - object2new.icon.toJson(), - object2new.infoWindow.toJson(), - PlatformLatLng(latitude: object2new.position.latitude, longitude: object2new.position.longitude), - object2new.rotation, - object2new.visible, - object2new.zIndex, - object2new.markerId.value, - object2new.clusterManagerId?.value, - ]); + { + expect(toChange.length, 1); + final List? encoded = toChange.first?.encode() as List?; + expect(encoded?[0], object2new.alpha); + final PlatformOffset? offset = encoded?[1] as PlatformOffset?; + expect(offset?.dx, object2new.anchor.dx); + expect(offset?.dy, object2new.anchor.dy); + expect(encoded?.getRange(2, 7).toList(), [ + object2new.consumeTapEvents, + object2new.draggable, + object2new.flat, + object2new.icon.toJson(), + object2new.infoWindow.toJson(), + ] + ); + final PlatformLatLng? latLng = encoded?[7] as PlatformLatLng?; + expect(latLng?.latitude, object2new.position.latitude); + expect(latLng?.longitude, object2new.position.longitude); + expect(encoded?.getRange(8, 13), [ + object2new.rotation, + object2new.visible, + object2new.zIndex, + object2new.markerId.value, + object2new.clusterManagerId?.value, + ]); + } // Object 3 should be added. - expect(toAdd.length, 1); - expect(toAdd.first?.encode(), [ - object3.alpha, - Float64List.fromList([object3.anchor.dx, object3.anchor.dy]), - object3.consumeTapEvents, - object3.draggable, - object3.flat, - object3.icon.toJson(), - object3.infoWindow.toJson(), - PlatformLatLng(latitude: object3.position.latitude, longitude: object3.position.longitude), - object3.rotation, - object3.visible, - object3.zIndex, - object3.markerId.value, - object3.clusterManagerId?.value, - ]); + { + expect(toAdd.length, 1); + final List? encoded = toAdd.first?.encode() as List?; + expect(encoded?[0], object3.alpha); + final PlatformOffset? offset = encoded?[1] as PlatformOffset?; + expect(offset?.dx, object3.anchor.dx); + expect(offset?.dy, object3.anchor.dy); + expect(encoded?.getRange(2, 7).toList(), [ + object3.consumeTapEvents, + object3.draggable, + object3.flat, + object3.icon.toJson(), + object3.infoWindow.toJson(), + ] + ); + final PlatformLatLng? latLng = encoded?[7] as PlatformLatLng?; + expect(latLng?.latitude, object3.position.latitude); + expect(latLng?.longitude, object3.position.longitude); + expect(encoded?.getRange(8, 13), [ + object3.rotation, + object3.visible, + object3.zIndex, + object3.markerId.value, + object3.clusterManagerId?.value, + ]); + } }); test('updatePolygons passes expected arguments', () async { From 12c24dab11ff1656d3efef36059631f6beb2610d Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Wed, 7 Aug 2024 18:13:38 -0400 Subject: [PATCH 12/35] BUilder test args --- .../plugins/googlemaps/MarkersControllerTest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index bff29450558..72a6d36d05d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -52,11 +52,22 @@ public class MarkersControllerTest { private final float density = 1; private static Messages.PlatformMarker.Builder defaultBuilder() { + Map infoWindow = new HashMap<>(); + List anchor = new ArrayList<>(Arrays.asList(0.5, 0.0)); + infoWindow.put("anchor", anchor); return new Messages.PlatformMarker.Builder().setPosition( new Messages.PlatformLatLng.Builder().setLatitude(0.0).setLongitude(0.0).build() ).setAnchor( new Messages.PlatformOffset.Builder().setDx(0.0).setDy(0.0).build() - ); + ).setFlat(false) + .setDraggable(false) + .setVisible(true) + .setAlpha(1.0) + .setRotation(0.0) + .setZIndex(0.0) + .setConsumeTapEvents(false) + .setIcon(Collections.singletonList("defaultMarker")) + .setInfoWindow(infoWindow); } @Before From b3a91251561a2d198ac3259bcab7dee0ff29a7e0 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 8 Aug 2024 13:33:46 -0400 Subject: [PATCH 13/35] Fix up tests --- .../main/java/io/flutter/plugins/googlemaps/Convert.java | 2 ++ .../flutter/plugins/googlemaps/MarkersControllerTest.java | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index 10bb2cf9da0..b7df3fc7424 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -107,6 +107,8 @@ private static BitmapDescriptor toBitmapDescriptor( } final Map byteData = toMap(data.get(1)); return getBitmapFromBytes(byteData, density, new BitmapDescriptorFactoryWrapper()); + case "null": + return null; default: throw new IllegalArgumentException("Cannot interpret " + o + " as BitmapDescriptor"); } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index 72a6d36d05d..084b7211f8a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -66,7 +66,7 @@ private static Messages.PlatformMarker.Builder defaultBuilder() { .setRotation(0.0) .setZIndex(0.0) .setConsumeTapEvents(false) - .setIcon(Collections.singletonList("defaultMarker")) + .setIcon(Collections.singletonList("null")) .setInfoWindow(infoWindow); } @@ -143,14 +143,12 @@ public void controller_OnMarkerDrag() { .onMarkerDrag(eq(googleMarkerId), eq(Convert.latLngToPigeon(latLng)), any()); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalStateException.class) public void controller_AddMarkerThrowsErrorIfMarkerIdIsNull() { - final Map markerOptions = new HashMap<>(); - final List markers = Collections.singletonList(defaultBuilder().build()); try { controller.addMarkers(markers); - } catch (IllegalArgumentException e) { + } catch (IllegalStateException e) { assertEquals("markerId was null", e.getMessage()); throw e; } From cfccaf384dc54c4df8ff16133dcfb3fe4fd463a7 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 8 Aug 2024 13:47:37 -0400 Subject: [PATCH 14/35] Un-expose toJson --- .../flutter/plugins/googlemaps/Messages.java | 180 ++++++++++++++---- .../lib/src/google_maps_flutter_android.dart | 6 +- .../lib/src/messages.g.dart | 95 ++++++--- .../pigeons/messages.dart | 19 +- .../google_maps_flutter_android_test.dart | 16 +- .../lib/src/types/marker.dart | 5 +- 6 files changed, 249 insertions(+), 72 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java index 81e55f14c50..e5a3d67c64a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java @@ -707,7 +707,7 @@ ArrayList toList() { } /** - * Pigeon equivalent of the Offset class + * Pigeon equivalent of the Offset class. * * Generated class from Pigeon that represents data sent in messages. */ @@ -798,6 +798,117 @@ ArrayList toList() { } } + /** + * Pigeon equivalent of the InfoWindow class. + * + * Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformInfoWindow { + private @Nullable String title; + + public @Nullable String getTitle() { + return title; + } + + public void setTitle(@Nullable String setterArg) { + this.title = setterArg; + } + + private @Nullable String snippet; + + public @Nullable String getSnippet() { + return snippet; + } + + public void setSnippet(@Nullable String setterArg) { + this.snippet = setterArg; + } + + private @NonNull PlatformOffset anchor; + + public @NonNull PlatformOffset getAnchor() { + return anchor; + } + + public void setAnchor(@NonNull PlatformOffset setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"anchor\" is null."); + } + this.anchor = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformInfoWindow() {} + + @Override + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformInfoWindow that = (PlatformInfoWindow) o; + return Objects.equals(title, that.title) && Objects.equals(snippet, that.snippet) && anchor.equals(that.anchor); + } + + @Override + public int hashCode() { + return Objects.hash(title, snippet, anchor); + } + + public static final class Builder { + + private @Nullable String title; + + @CanIgnoreReturnValue + public @NonNull Builder setTitle(@Nullable String setterArg) { + this.title = setterArg; + return this; + } + + private @Nullable String snippet; + + @CanIgnoreReturnValue + public @NonNull Builder setSnippet(@Nullable String setterArg) { + this.snippet = setterArg; + return this; + } + + private @Nullable PlatformOffset anchor; + + @CanIgnoreReturnValue + public @NonNull Builder setAnchor(@NonNull PlatformOffset setterArg) { + this.anchor = setterArg; + return this; + } + + public @NonNull PlatformInfoWindow build() { + PlatformInfoWindow pigeonReturn = new PlatformInfoWindow(); + pigeonReturn.setTitle(title); + pigeonReturn.setSnippet(snippet); + pigeonReturn.setAnchor(anchor); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList(3); + toListResult.add(title); + toListResult.add(snippet); + toListResult.add(anchor); + return toListResult; + } + + static @NonNull PlatformInfoWindow fromList(@NonNull ArrayList __pigeon_list) { + PlatformInfoWindow pigeonResult = new PlatformInfoWindow(); + Object title = __pigeon_list.get(0); + pigeonResult.setTitle((String) title); + Object snippet = __pigeon_list.get(1); + pigeonResult.setSnippet((String) snippet); + Object anchor = __pigeon_list.get(2); + pigeonResult.setAnchor((PlatformOffset) anchor); + return pigeonResult; + } + } + /** * Pigeon equivalent of the Marker class. * @@ -882,13 +993,13 @@ public void setIcon(@NonNull Object setterArg) { this.icon = setterArg; } - private @NonNull Map infoWindow; + private @NonNull PlatformInfoWindow infoWindow; - public @NonNull Map getInfoWindow() { + public @NonNull PlatformInfoWindow getInfoWindow() { return infoWindow; } - public void setInfoWindow(@NonNull Map setterArg) { + public void setInfoWindow(@NonNull PlatformInfoWindow setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"infoWindow\" is null."); } @@ -1036,10 +1147,10 @@ public static final class Builder { return this; } - private @Nullable Map infoWindow; + private @Nullable PlatformInfoWindow infoWindow; @CanIgnoreReturnValue - public @NonNull Builder setInfoWindow(@NonNull Map setterArg) { + public @NonNull Builder setInfoWindow(@NonNull PlatformInfoWindow setterArg) { this.infoWindow = setterArg; return this; } @@ -1145,7 +1256,7 @@ ArrayList toList() { Object icon = __pigeon_list.get(5); pigeonResult.setIcon(icon); Object infoWindow = __pigeon_list.get(6); - pigeonResult.setInfoWindow((Map) infoWindow); + pigeonResult.setInfoWindow((PlatformInfoWindow) infoWindow); Object position = __pigeon_list.get(7); pigeonResult.setPosition((PlatformLatLng) position); Object rotation = __pigeon_list.get(8); @@ -2239,30 +2350,32 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { case (byte) 134: return PlatformOffset.fromList((ArrayList) readValue(buffer)); case (byte) 135: - return PlatformMarker.fromList((ArrayList) readValue(buffer)); + return PlatformInfoWindow.fromList((ArrayList) readValue(buffer)); case (byte) 136: - return PlatformPolygon.fromList((ArrayList) readValue(buffer)); + return PlatformMarker.fromList((ArrayList) readValue(buffer)); case (byte) 137: - return PlatformPolyline.fromList((ArrayList) readValue(buffer)); + return PlatformPolygon.fromList((ArrayList) readValue(buffer)); case (byte) 138: - return PlatformTile.fromList((ArrayList) readValue(buffer)); + return PlatformPolyline.fromList((ArrayList) readValue(buffer)); case (byte) 139: - return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); + return PlatformTile.fromList((ArrayList) readValue(buffer)); case (byte) 140: - return PlatformLatLng.fromList((ArrayList) readValue(buffer)); + return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); case (byte) 141: - return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); + return PlatformLatLng.fromList((ArrayList) readValue(buffer)); case (byte) 142: - return PlatformCluster.fromList((ArrayList) readValue(buffer)); + return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); case (byte) 143: - return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); + return PlatformCluster.fromList((ArrayList) readValue(buffer)); case (byte) 144: - return PlatformPoint.fromList((ArrayList) readValue(buffer)); + return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); case (byte) 145: - return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); + return PlatformPoint.fromList((ArrayList) readValue(buffer)); case (byte) 146: - return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); case (byte) 147: + return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + case (byte) 148: Object value = readValue(buffer); return value == null ? null : PlatformRendererType.values()[(int) value]; default: @@ -2290,44 +2403,47 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } else if (value instanceof PlatformOffset) { stream.write(134); writeValue(stream, ((PlatformOffset) value).toList()); - } else if (value instanceof PlatformMarker) { + } else if (value instanceof PlatformInfoWindow) { stream.write(135); + writeValue(stream, ((PlatformInfoWindow) value).toList()); + } else if (value instanceof PlatformMarker) { + stream.write(136); writeValue(stream, ((PlatformMarker) value).toList()); } else if (value instanceof PlatformPolygon) { - stream.write(136); + stream.write(137); writeValue(stream, ((PlatformPolygon) value).toList()); } else if (value instanceof PlatformPolyline) { - stream.write(137); + stream.write(138); writeValue(stream, ((PlatformPolyline) value).toList()); } else if (value instanceof PlatformTile) { - stream.write(138); + stream.write(139); writeValue(stream, ((PlatformTile) value).toList()); } else if (value instanceof PlatformTileOverlay) { - stream.write(139); + stream.write(140); writeValue(stream, ((PlatformTileOverlay) value).toList()); } else if (value instanceof PlatformLatLng) { - stream.write(140); + stream.write(141); writeValue(stream, ((PlatformLatLng) value).toList()); } else if (value instanceof PlatformLatLngBounds) { - stream.write(141); + stream.write(142); writeValue(stream, ((PlatformLatLngBounds) value).toList()); } else if (value instanceof PlatformCluster) { - stream.write(142); + stream.write(143); writeValue(stream, ((PlatformCluster) value).toList()); } else if (value instanceof PlatformMapConfiguration) { - stream.write(143); + stream.write(144); writeValue(stream, ((PlatformMapConfiguration) value).toList()); } else if (value instanceof PlatformPoint) { - stream.write(144); + stream.write(145); writeValue(stream, ((PlatformPoint) value).toList()); } else if (value instanceof PlatformTileLayer) { - stream.write(145); + stream.write(146); writeValue(stream, ((PlatformTileLayer) value).toList()); } else if (value instanceof PlatformZoomRange) { - stream.write(146); + stream.write(147); writeValue(stream, ((PlatformZoomRange) value).toList()); } else if (value instanceof PlatformRendererType) { - stream.write(147); + stream.write(148); writeValue(stream, value == null ? null : ((PlatformRendererType) value).index); } else { super.writeValue(stream, value); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart index 47e569be4f7..968b246372e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart @@ -718,6 +718,10 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { identifier: clusterManager.clusterManagerId.value); } + static PlatformInfoWindow _platformInfoWindowFromInfoWindow(InfoWindow window) { + return PlatformInfoWindow(title: window.title, snippet: window.snippet, anchor: _platformOffsetFromOffset(window.anchor)); + } + static PlatformMarker _platformMarkerFromMarker(Marker marker) { // This cast is not ideal, but the Java code already assumes this format. // See the TODOs at the top of this file and on the 'json' field in @@ -729,7 +733,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { draggable: marker.draggable, flat: marker.flat, icon: marker.icon.toJson(), - infoWindow: marker.infoWindow.toJson() as Map, + infoWindow: _platformInfoWindowFromInfoWindow(marker.infoWindow), position: _platformLatLngFromLatLng(marker.position), rotation: marker.rotation, visible: marker.visible, diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart index e679d7eeda0..38f14a8deab 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart @@ -204,7 +204,7 @@ class PlatformClusterManager { } } -/// Pigeon equivalent of the Offset class +/// Pigeon equivalent of the Offset class. class PlatformOffset { PlatformOffset({ required this.dx, @@ -231,6 +231,38 @@ class PlatformOffset { } } +/// Pigeon equivalent of the InfoWindow class. +class PlatformInfoWindow { + PlatformInfoWindow({ + this.title, + this.snippet, + required this.anchor, + }); + + String? title; + + String? snippet; + + PlatformOffset anchor; + + Object encode() { + return [ + title, + snippet, + anchor, + ]; + } + + static PlatformInfoWindow decode(Object result) { + result as List; + return PlatformInfoWindow( + title: result[0] as String?, + snippet: result[1] as String?, + anchor: result[2]! as PlatformOffset, + ); + } +} + /// Pigeon equivalent of the Marker class. class PlatformMarker { PlatformMarker({ @@ -240,7 +272,7 @@ class PlatformMarker { this.draggable = false, this.flat = false, this.icon = const ['defaultMarker'], - this.infoWindow = const {'anchor' : [0.5, 0.0]}, + required this.infoWindow, required this.position, this.rotation = 0.0, this.visible = true, @@ -261,7 +293,7 @@ class PlatformMarker { Object icon; - Map infoWindow; + PlatformInfoWindow infoWindow; PlatformLatLng position; @@ -302,7 +334,7 @@ class PlatformMarker { draggable: result[3]! as bool, flat: result[4]! as bool, icon: result[5]!, - infoWindow: (result[6] as Map?)!.cast(), + infoWindow: result[6]! as PlatformInfoWindow, position: result[7]! as PlatformLatLng, rotation: result[8]! as double, visible: result[9]! as bool, @@ -650,44 +682,47 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is PlatformOffset) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is PlatformMarker) { + } else if (value is PlatformInfoWindow) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformPolygon) { + } else if (value is PlatformMarker) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is PlatformPolyline) { + } else if (value is PlatformPolygon) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PlatformTile) { + } else if (value is PlatformPolyline) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PlatformTileOverlay) { + } else if (value is PlatformTile) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLng) { + } else if (value is PlatformTileOverlay) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLngBounds) { + } else if (value is PlatformLatLng) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PlatformCluster) { + } else if (value is PlatformLatLngBounds) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PlatformMapConfiguration) { + } else if (value is PlatformCluster) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PlatformPoint) { + } else if (value is PlatformMapConfiguration) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PlatformTileLayer) { + } else if (value is PlatformPoint) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is PlatformZoomRange) { + } else if (value is PlatformTileLayer) { buffer.putUint8(146); writeValue(buffer, value.encode()); - } else if (value is PlatformRendererType) { + } else if (value is PlatformZoomRange) { buffer.putUint8(147); + writeValue(buffer, value.encode()); + } else if (value is PlatformRendererType) { + buffer.putUint8(148); writeValue(buffer, value.index); } else { super.writeValue(buffer, value); @@ -710,30 +745,32 @@ class _PigeonCodec extends StandardMessageCodec { case 134: return PlatformOffset.decode(readValue(buffer)!); case 135: - return PlatformMarker.decode(readValue(buffer)!); + return PlatformInfoWindow.decode(readValue(buffer)!); case 136: - return PlatformPolygon.decode(readValue(buffer)!); + return PlatformMarker.decode(readValue(buffer)!); case 137: - return PlatformPolyline.decode(readValue(buffer)!); + return PlatformPolygon.decode(readValue(buffer)!); case 138: - return PlatformTile.decode(readValue(buffer)!); + return PlatformPolyline.decode(readValue(buffer)!); case 139: - return PlatformTileOverlay.decode(readValue(buffer)!); + return PlatformTile.decode(readValue(buffer)!); case 140: - return PlatformLatLng.decode(readValue(buffer)!); + return PlatformTileOverlay.decode(readValue(buffer)!); case 141: - return PlatformLatLngBounds.decode(readValue(buffer)!); + return PlatformLatLng.decode(readValue(buffer)!); case 142: - return PlatformCluster.decode(readValue(buffer)!); + return PlatformLatLngBounds.decode(readValue(buffer)!); case 143: - return PlatformMapConfiguration.decode(readValue(buffer)!); + return PlatformCluster.decode(readValue(buffer)!); case 144: - return PlatformPoint.decode(readValue(buffer)!); + return PlatformMapConfiguration.decode(readValue(buffer)!); case 145: - return PlatformTileLayer.decode(readValue(buffer)!); + return PlatformPoint.decode(readValue(buffer)!); case 146: - return PlatformZoomRange.decode(readValue(buffer)!); + return PlatformTileLayer.decode(readValue(buffer)!); case 147: + return PlatformZoomRange.decode(readValue(buffer)!); + case 148: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformRendererType.values[value]; default: diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart index 769446207d0..35b119f9e89 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart @@ -88,7 +88,7 @@ class PlatformClusterManager { final String identifier; } -/// Pigeon equivalent of the Offset class +/// Pigeon equivalent of the Offset class. class PlatformOffset { PlatformOffset(this.dx, this.dy); @@ -96,6 +96,19 @@ class PlatformOffset { final double dy; } +/// Pigeon equivalent of the InfoWindow class. +class PlatformInfoWindow { + PlatformInfoWindow({ + required this.anchor, + this.title, + this.snippet, + }); + + final String? title; + final String? snippet; + final PlatformOffset anchor; +} + /// Pigeon equivalent of the Marker class. class PlatformMarker { PlatformMarker({ @@ -106,7 +119,7 @@ class PlatformMarker { this.draggable = false, this.flat = false, this.icon = const ['defaultMarker'], - this.infoWindow = const {'anchor': [0.5, 0.0]}, + required this.infoWindow, required this.position, this.rotation = 0.0, this.visible = true, @@ -120,7 +133,7 @@ class PlatformMarker { final bool draggable; final bool flat; final Object icon; - final Map infoWindow; + final PlatformInfoWindow infoWindow; final PlatformLatLng position; final double rotation; final bool visible; diff --git a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart index 80d68956ec6..236a954a072 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart @@ -389,14 +389,18 @@ void main() { final PlatformOffset? offset = encoded?[1] as PlatformOffset?; expect(offset?.dx, object2new.anchor.dx); expect(offset?.dy, object2new.anchor.dy); - expect(encoded?.getRange(2, 7).toList(), [ + expect(encoded?.getRange(2, 6).toList(), [ object2new.consumeTapEvents, object2new.draggable, object2new.flat, object2new.icon.toJson(), - object2new.infoWindow.toJson(), ] ); + final PlatformInfoWindow? window = encoded?[6] as PlatformInfoWindow?; + expect(window?.title, object2new.infoWindow.title); + expect(window?.snippet, object2new.infoWindow.snippet); + expect(window?.anchor.dx, object2new.infoWindow.anchor.dx); + expect(window?.anchor.dy, object2new.infoWindow.anchor.dy); final PlatformLatLng? latLng = encoded?[7] as PlatformLatLng?; expect(latLng?.latitude, object2new.position.latitude); expect(latLng?.longitude, object2new.position.longitude); @@ -416,14 +420,18 @@ void main() { final PlatformOffset? offset = encoded?[1] as PlatformOffset?; expect(offset?.dx, object3.anchor.dx); expect(offset?.dy, object3.anchor.dy); - expect(encoded?.getRange(2, 7).toList(), [ + expect(encoded?.getRange(2, 6).toList(), [ object3.consumeTapEvents, object3.draggable, object3.flat, object3.icon.toJson(), - object3.infoWindow.toJson(), ] ); + final PlatformInfoWindow? window = encoded?[6] as PlatformInfoWindow?; + expect(window?.title, object3.infoWindow.title); + expect(window?.snippet, object3.infoWindow.snippet); + expect(window?.anchor.dx, object3.infoWindow.anchor.dx); + expect(window?.anchor.dy, object3.infoWindow.anchor.dy); final PlatformLatLng? latLng = encoded?[7] as PlatformLatLng?; expect(latLng?.latitude, object3.position.latitude); expect(latLng?.longitude, object3.position.longitude); diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart index b51cd9ada67..0921d2d4ec5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart @@ -64,8 +64,7 @@ class InfoWindow { ); } - /// Converts this object to something serializable in JSON. - Object toJson() { + Object _toJson() { final Map json = {}; void addIfPresent(String fieldName, Object? value) { @@ -297,7 +296,7 @@ class Marker implements MapsObject { addIfPresent('draggable', draggable); addIfPresent('flat', flat); addIfPresent('icon', icon.toJson()); - addIfPresent('infoWindow', infoWindow.toJson()); + addIfPresent('infoWindow', infoWindow._toJson()); addIfPresent('position', position.toJson()); addIfPresent('rotation', rotation); addIfPresent('visible', visible); From a469e4223e3389b82cd7179d5ee791c7b91a310e Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 8 Aug 2024 13:56:41 -0400 Subject: [PATCH 15/35] Post merge resolution --- .../google_maps_flutter_android/CHANGELOG.md | 4 + .../flutter/plugins/googlemaps/Messages.java | 225 +++++------------- .../lib/src/messages.g.dart | 77 +++--- .../google_maps_flutter_android/pubspec.yaml | 2 +- .../CHANGELOG.md | 5 - .../pubspec.yaml | 6 +- 6 files changed, 110 insertions(+), 209 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md index c2c7aec6aa7..d9649c41256 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.14.1 + +* Converts `PlatformCircle` and `PlatformMarker` to pigeon. + ## 2.14.0 * Updates map configuration and platform view creation parameters to use Pigeon. diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java index 33b73bbf23c..eb60063f328 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java @@ -1623,7 +1623,7 @@ ArrayList toList() { /** * Pigeon equivalent of Flutter's EdgeInsets. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformEdgeInsets { private @NonNull Double top; @@ -1683,17 +1683,10 @@ public void setRight(@NonNull Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformEdgeInsets that = (PlatformEdgeInsets) o; - return top.equals(that.top) - && bottom.equals(that.bottom) - && left.equals(that.left) - && right.equals(that.right); + return top.equals(that.top) && bottom.equals(that.bottom) && left.equals(that.left) && right.equals(that.right); } @Override @@ -2016,17 +2009,10 @@ public void setMarkerIds(@NonNull List setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformCluster that = (PlatformCluster) o; - return clusterManagerId.equals(that.clusterManagerId) - && position.equals(that.position) - && bounds.equals(that.bounds) - && markerIds.equals(that.markerIds); + return clusterManagerId.equals(that.clusterManagerId) && position.equals(that.position) && bounds.equals(that.bounds) && markerIds.equals(that.markerIds); } @Override @@ -2105,10 +2091,10 @@ ArrayList toList() { /** * Pigeon equivalent of CameraTargetBounds. * - *

As with the Dart version, it exists to distinguish between not setting a a target, and - * having an explicitly unbounded target (null [bounds]). + * As with the Dart version, it exists to distinguish between not setting a + * a target, and having an explicitly unbounded target (null [bounds]). * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraTargetBounds { private @Nullable PlatformLatLngBounds bounds; @@ -2123,12 +2109,8 @@ public void setBounds(@Nullable PlatformLatLngBounds setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformCameraTargetBounds that = (PlatformCameraTargetBounds) o; return Objects.equals(bounds, that.bounds); } @@ -2173,7 +2155,7 @@ ArrayList toList() { /** * Information passed to the platform view creation. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformMapViewCreationParams { private @NonNull PlatformCameraPosition initialCameraPosition; @@ -2298,36 +2280,15 @@ public void setInitialClusterManagers(@NonNull List sett @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformMapViewCreationParams that = (PlatformMapViewCreationParams) o; - return initialCameraPosition.equals(that.initialCameraPosition) - && mapConfiguration.equals(that.mapConfiguration) - && initialCircles.equals(that.initialCircles) - && initialMarkers.equals(that.initialMarkers) - && initialPolygons.equals(that.initialPolygons) - && initialPolylines.equals(that.initialPolylines) - && initialHeatmaps.equals(that.initialHeatmaps) - && initialTileOverlays.equals(that.initialTileOverlays) - && initialClusterManagers.equals(that.initialClusterManagers); + return initialCameraPosition.equals(that.initialCameraPosition) && mapConfiguration.equals(that.mapConfiguration) && initialCircles.equals(that.initialCircles) && initialMarkers.equals(that.initialMarkers) && initialPolygons.equals(that.initialPolygons) && initialPolylines.equals(that.initialPolylines) && initialHeatmaps.equals(that.initialHeatmaps) && initialTileOverlays.equals(that.initialTileOverlays) && initialClusterManagers.equals(that.initialClusterManagers); } @Override public int hashCode() { - return Objects.hash( - initialCameraPosition, - mapConfiguration, - initialCircles, - initialMarkers, - initialPolygons, - initialPolylines, - initialHeatmaps, - initialTileOverlays, - initialClusterManagers); + return Objects.hash(initialCameraPosition, mapConfiguration, initialCircles, initialMarkers, initialPolygons, initialPolylines, initialHeatmaps, initialTileOverlays, initialClusterManagers); } public static final class Builder { @@ -2399,8 +2360,7 @@ public static final class Builder { private @Nullable List initialClusterManagers; @CanIgnoreReturnValue - public @NonNull Builder setInitialClusterManagers( - @NonNull List setterArg) { + public @NonNull Builder setInitialClusterManagers(@NonNull List setterArg) { this.initialClusterManagers = setterArg; return this; } @@ -2435,8 +2395,7 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformMapViewCreationParams fromList( - @NonNull ArrayList __pigeon_list) { + static @NonNull PlatformMapViewCreationParams fromList(@NonNull ArrayList __pigeon_list) { PlatformMapViewCreationParams pigeonResult = new PlatformMapViewCreationParams(); Object initialCameraPosition = __pigeon_list.get(0); pigeonResult.setInitialCameraPosition((PlatformCameraPosition) initialCameraPosition); @@ -2463,7 +2422,7 @@ ArrayList toList() { /** * Pigeon equivalent of MapConfiguration. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformMapConfiguration { private @Nullable Boolean compassEnabled; @@ -2668,58 +2627,15 @@ public void setStyle(@Nullable String setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } PlatformMapConfiguration that = (PlatformMapConfiguration) o; - return Objects.equals(compassEnabled, that.compassEnabled) - && Objects.equals(cameraTargetBounds, that.cameraTargetBounds) - && Objects.equals(mapType, that.mapType) - && Objects.equals(minMaxZoomPreference, that.minMaxZoomPreference) - && Objects.equals(mapToolbarEnabled, that.mapToolbarEnabled) - && Objects.equals(rotateGesturesEnabled, that.rotateGesturesEnabled) - && Objects.equals(scrollGesturesEnabled, that.scrollGesturesEnabled) - && Objects.equals(tiltGesturesEnabled, that.tiltGesturesEnabled) - && Objects.equals(trackCameraPosition, that.trackCameraPosition) - && Objects.equals(zoomControlsEnabled, that.zoomControlsEnabled) - && Objects.equals(zoomGesturesEnabled, that.zoomGesturesEnabled) - && Objects.equals(myLocationEnabled, that.myLocationEnabled) - && Objects.equals(myLocationButtonEnabled, that.myLocationButtonEnabled) - && Objects.equals(padding, that.padding) - && Objects.equals(indoorViewEnabled, that.indoorViewEnabled) - && Objects.equals(trafficEnabled, that.trafficEnabled) - && Objects.equals(buildingsEnabled, that.buildingsEnabled) - && Objects.equals(liteModeEnabled, that.liteModeEnabled) - && Objects.equals(cloudMapId, that.cloudMapId) - && Objects.equals(style, that.style); + return Objects.equals(compassEnabled, that.compassEnabled) && Objects.equals(cameraTargetBounds, that.cameraTargetBounds) && Objects.equals(mapType, that.mapType) && Objects.equals(minMaxZoomPreference, that.minMaxZoomPreference) && Objects.equals(mapToolbarEnabled, that.mapToolbarEnabled) && Objects.equals(rotateGesturesEnabled, that.rotateGesturesEnabled) && Objects.equals(scrollGesturesEnabled, that.scrollGesturesEnabled) && Objects.equals(tiltGesturesEnabled, that.tiltGesturesEnabled) && Objects.equals(trackCameraPosition, that.trackCameraPosition) && Objects.equals(zoomControlsEnabled, that.zoomControlsEnabled) && Objects.equals(zoomGesturesEnabled, that.zoomGesturesEnabled) && Objects.equals(myLocationEnabled, that.myLocationEnabled) && Objects.equals(myLocationButtonEnabled, that.myLocationButtonEnabled) && Objects.equals(padding, that.padding) && Objects.equals(indoorViewEnabled, that.indoorViewEnabled) && Objects.equals(trafficEnabled, that.trafficEnabled) && Objects.equals(buildingsEnabled, that.buildingsEnabled) && Objects.equals(liteModeEnabled, that.liteModeEnabled) && Objects.equals(cloudMapId, that.cloudMapId) && Objects.equals(style, that.style); } @Override public int hashCode() { - return Objects.hash( - compassEnabled, - cameraTargetBounds, - mapType, - minMaxZoomPreference, - mapToolbarEnabled, - rotateGesturesEnabled, - scrollGesturesEnabled, - tiltGesturesEnabled, - trackCameraPosition, - zoomControlsEnabled, - zoomGesturesEnabled, - myLocationEnabled, - myLocationButtonEnabled, - padding, - indoorViewEnabled, - trafficEnabled, - buildingsEnabled, - liteModeEnabled, - cloudMapId, - style); + return Objects.hash(compassEnabled, cameraTargetBounds, mapType, minMaxZoomPreference, mapToolbarEnabled, rotateGesturesEnabled, scrollGesturesEnabled, tiltGesturesEnabled, trackCameraPosition, zoomControlsEnabled, zoomGesturesEnabled, myLocationEnabled, myLocationButtonEnabled, padding, indoorViewEnabled, trafficEnabled, buildingsEnabled, liteModeEnabled, cloudMapId, style); } public static final class Builder { @@ -2735,8 +2651,7 @@ public static final class Builder { private @Nullable PlatformCameraTargetBounds cameraTargetBounds; @CanIgnoreReturnValue - public @NonNull Builder setCameraTargetBounds( - @Nullable PlatformCameraTargetBounds setterArg) { + public @NonNull Builder setCameraTargetBounds(@Nullable PlatformCameraTargetBounds setterArg) { this.cameraTargetBounds = setterArg; return this; } @@ -3329,39 +3244,35 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { case (byte) 138: return PlatformPolyline.fromList((ArrayList) readValue(buffer)); case (byte) 139: - return PlatformEdgeInsets.fromList((ArrayList) readValue(buffer)); + return PlatformTile.fromList((ArrayList) readValue(buffer)); case (byte) 140: - return PlatformLatLng.fromList((ArrayList) readValue(buffer)); + return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); case (byte) 141: - return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); + return PlatformEdgeInsets.fromList((ArrayList) readValue(buffer)); case (byte) 142: - return PlatformCluster.fromList((ArrayList) readValue(buffer)); + return PlatformLatLng.fromList((ArrayList) readValue(buffer)); case (byte) 143: - return PlatformCameraTargetBounds.fromList((ArrayList) readValue(buffer)); + return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); case (byte) 144: - return PlatformMapViewCreationParams.fromList((ArrayList) readValue(buffer)); + return PlatformCluster.fromList((ArrayList) readValue(buffer)); case (byte) 145: - return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); + return PlatformCameraTargetBounds.fromList((ArrayList) readValue(buffer)); case (byte) 146: - return PlatformPoint.fromList((ArrayList) readValue(buffer)); + return PlatformMapViewCreationParams.fromList((ArrayList) readValue(buffer)); case (byte) 147: - return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); + return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); case (byte) 148: - return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + return PlatformPoint.fromList((ArrayList) readValue(buffer)); case (byte) 149: - // Manual edit to fix https://github.com/flutter/flutter/issues/150108 - // the way the generator will fix it once the PR lands. - { - Object value = readValue(buffer); - return value == null ? null : PlatformMapType.values()[(int) value]; - } + return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); case (byte) 150: - // Manual edit to fix https://github.com/flutter/flutter/issues/150108 - // the way the generator will fix it once the PR lands. - { - Object value = readValue(buffer); - return value == null ? null : PlatformRendererType.values()[(int) value]; - } + return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + case (byte) 151: + Object value = readValue(buffer); + return value == null ? null : PlatformMapType.values()[(int) value]; + case (byte) 152: + Object value = readValue(buffer); + return value == null ? null : PlatformRendererType.values()[(int) value]; default: return super.readValueOfType(type, buffer); } @@ -3406,40 +3317,40 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { stream.write(140); writeValue(stream, ((PlatformTileOverlay) value).toList()); } else if (value instanceof PlatformEdgeInsets) { - stream.write(139); + stream.write(141); writeValue(stream, ((PlatformEdgeInsets) value).toList()); } else if (value instanceof PlatformLatLng) { - stream.write(140); + stream.write(142); writeValue(stream, ((PlatformLatLng) value).toList()); } else if (value instanceof PlatformLatLngBounds) { - stream.write(141); + stream.write(143); writeValue(stream, ((PlatformLatLngBounds) value).toList()); } else if (value instanceof PlatformCluster) { - stream.write(142); + stream.write(144); writeValue(stream, ((PlatformCluster) value).toList()); } else if (value instanceof PlatformCameraTargetBounds) { - stream.write(143); + stream.write(145); writeValue(stream, ((PlatformCameraTargetBounds) value).toList()); } else if (value instanceof PlatformMapViewCreationParams) { - stream.write(144); + stream.write(146); writeValue(stream, ((PlatformMapViewCreationParams) value).toList()); } else if (value instanceof PlatformMapConfiguration) { - stream.write(145); + stream.write(147); writeValue(stream, ((PlatformMapConfiguration) value).toList()); } else if (value instanceof PlatformPoint) { - stream.write(146); + stream.write(148); writeValue(stream, ((PlatformPoint) value).toList()); } else if (value instanceof PlatformTileLayer) { - stream.write(147); + stream.write(149); writeValue(stream, ((PlatformTileLayer) value).toList()); } else if (value instanceof PlatformZoomRange) { - stream.write(148); + stream.write(150); writeValue(stream, ((PlatformZoomRange) value).toList()); } else if (value instanceof PlatformMapType) { - stream.write(149); + stream.write(151); writeValue(stream, value == null ? null : ((PlatformMapType) value).index); } else if (value instanceof PlatformRendererType) { - stream.write(150); + stream.write(152); writeValue(stream, value == null ? null : ((PlatformRendererType) value).index); } else { super.writeValue(stream, value); @@ -4504,10 +4415,11 @@ public void error(Throwable error) { } } /** - * Dummy interface to force generation of the platform view creation params, which are not used in - * any Pigeon calls, only the platform view creation call made internally by Flutter. + * Dummy interface to force generation of the platform view creation params, + * which are not used in any Pigeon calls, only the platform view creation + * call made internally by Flutter. * - *

Generated interface from Pigeon that represents a handler of messages from Flutter. + * Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MapsPlatformViewApi { @@ -4517,26 +4429,16 @@ public interface MapsPlatformViewApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /** - * Sets up an instance of `MapsPlatformViewApi` to handle messages through the - * `binaryMessenger`. - */ + /**Sets up an instance of `MapsPlatformViewApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable MapsPlatformViewApi api) { setUp(binaryMessenger, "", api); } - - static void setUp( - @NonNull BinaryMessenger binaryMessenger, - @NonNull String messageChannelSuffix, - @Nullable MapsPlatformViewApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable MapsPlatformViewApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4546,7 +4448,8 @@ static void setUp( try { api.createView(typeArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart index e6bba3dae09..388764ad5c8 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart @@ -668,13 +668,10 @@ class PlatformMapViewCreationParams { initialCircles: (result[2] as List?)!.cast(), initialMarkers: (result[3] as List?)!.cast(), initialPolygons: (result[4] as List?)!.cast(), - initialPolylines: - (result[5] as List?)!.cast(), + initialPolylines: (result[5] as List?)!.cast(), initialHeatmaps: (result[6] as List?)!.cast(), - initialTileOverlays: - (result[7] as List?)!.cast(), - initialClusterManagers: - (result[8] as List?)!.cast(), + initialTileOverlays: (result[7] as List?)!.cast(), + initialClusterManagers: (result[8] as List?)!.cast(), ); } } @@ -922,41 +919,47 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is PlatformPolyline) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PlatformEdgeInsets) { + } else if (value is PlatformTile) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLng) { + } else if (value is PlatformTileOverlay) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLngBounds) { + } else if (value is PlatformEdgeInsets) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PlatformCluster) { + } else if (value is PlatformLatLng) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraTargetBounds) { + } else if (value is PlatformLatLngBounds) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PlatformMapViewCreationParams) { + } else if (value is PlatformCluster) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PlatformMapConfiguration) { + } else if (value is PlatformCameraTargetBounds) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is PlatformPoint) { + } else if (value is PlatformMapViewCreationParams) { buffer.putUint8(146); writeValue(buffer, value.encode()); - } else if (value is PlatformTileLayer) { + } else if (value is PlatformMapConfiguration) { buffer.putUint8(147); writeValue(buffer, value.encode()); - } else if (value is PlatformZoomRange) { + } else if (value is PlatformPoint) { buffer.putUint8(148); writeValue(buffer, value.encode()); - } else if (value is PlatformMapType) { + } else if (value is PlatformTileLayer) { buffer.putUint8(149); - writeValue(buffer, value.index); - } else if (value is PlatformRendererType) { + writeValue(buffer, value.encode()); + } else if (value is PlatformZoomRange) { buffer.putUint8(150); + writeValue(buffer, value.encode()); + } else if (value is PlatformMapType) { + buffer.putUint8(151); + writeValue(buffer, value.index); + } else if (value is PlatformRendererType) { + buffer.putUint8(152); writeValue(buffer, value.index); } else { super.writeValue(buffer, value); @@ -990,30 +993,30 @@ class _PigeonCodec extends StandardMessageCodec { return PlatformTile.decode(readValue(buffer)!); case 140: return PlatformTileOverlay.decode(readValue(buffer)!); - case 139: + case 141: return PlatformEdgeInsets.decode(readValue(buffer)!); - case 140: + case 142: return PlatformLatLng.decode(readValue(buffer)!); - case 141: + case 143: return PlatformLatLngBounds.decode(readValue(buffer)!); - case 142: + case 144: return PlatformCluster.decode(readValue(buffer)!); - case 143: + case 145: return PlatformCameraTargetBounds.decode(readValue(buffer)!); - case 144: + case 146: return PlatformMapViewCreationParams.decode(readValue(buffer)!); - case 145: + case 147: return PlatformMapConfiguration.decode(readValue(buffer)!); - case 146: + case 148: return PlatformPoint.decode(readValue(buffer)!); - case 147: + case 149: return PlatformTileLayer.decode(readValue(buffer)!); - case 148: + case 150: return PlatformZoomRange.decode(readValue(buffer)!); - case 149: + case 151: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformMapType.values[value]; - case 150: + case 152: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformRendererType.values[value]; default: @@ -2084,11 +2087,9 @@ class MapsPlatformViewApi { /// Constructor for [MapsPlatformViewApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MapsPlatformViewApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MapsPlatformViewApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -2096,10 +2097,8 @@ class MapsPlatformViewApi { final String __pigeon_messageChannelSuffix; Future createView(PlatformMapViewCreationParams? type) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index fa1f7066bd8..2b0601a24ac 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_android description: Android implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.14.0 +version: 2.14.1 environment: sdk: ^3.4.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index 91d20366b7d..62ba5277b89 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,8 +1,3 @@ -## 2.9.1 - -* Expose `Messages.PlatformMarker.InfoWindow.toJson` for pigeon conversion. -* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. - ## 2.9.0 * Adds support for heatmap layers. diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml index 805164c520d..a01bed82ff4 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml @@ -4,11 +4,11 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.9.1 +version: 2.9.0 environment: - sdk: ^3.3.0 - flutter: ">=3.19.0" + sdk: ^3.2.0 + flutter: ">=3.16.0" dependencies: collection: ^1.15.0 From 0d7cf1c2101c0cc990ab49d561375820405b1be8 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 8 Aug 2024 14:34:58 -0400 Subject: [PATCH 16/35] Fix info window interpret --- .../java/io/flutter/plugins/googlemaps/Convert.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index dbe9b857d5d..cf6fcfe5022 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -724,6 +724,18 @@ static void interpretMarkerOptions( } } + private static void interpretInfoWindowOptions(MarkerOptionsSink sink, Messages.PlatformInfoWindow infoWindow) { + String title = infoWindow.getTitle(); + String snippet = infoWindow.getSnippet(); + // snippet is nullable. + if (title != null) { + sink.setInfoWindowText(title, snippet); + } + Messages.PlatformOffset infoWindowAnchor = infoWindow.getAnchor(); + final List anchorData = toList(infoWindowAnchor); + sink.setInfoWindowAnchor(toFloat(anchorData.get(0)), toFloat(anchorData.get(1))); + } + private static void interpretInfoWindowOptions( MarkerOptionsSink sink, Map infoWindow) { String title = (String) infoWindow.get("title"); From 31a860bddc30107c2615431cda05c6b60a9a0817 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 8 Aug 2024 14:53:10 -0400 Subject: [PATCH 17/35] Manual pigeon edit --- .../io/flutter/plugins/googlemaps/Messages.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java index eb60063f328..32f519a8132 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java @@ -3268,11 +3268,19 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { case (byte) 150: return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); case (byte) 151: - Object value = readValue(buffer); - return value == null ? null : PlatformMapType.values()[(int) value]; + // Manual edit to fix https://github.com/flutter/flutter/issues/150108 + // the way the generator will fix it once the PR lands. + { + Object value = readValue(buffer); + return value == null ? null : PlatformMapType.values()[(int) value]; + } case (byte) 152: - Object value = readValue(buffer); - return value == null ? null : PlatformRendererType.values()[(int) value]; + // Manual edit to fix https://github.com/flutter/flutter/issues/150108 + // the way the generator will fix it once the PR lands. + { + Object value = readValue(buffer); + return value == null ? null : PlatformRendererType.values()[(int) value]; + } default: return super.readValueOfType(type, buffer); } From c2c16287f0be61ab96a0ab865118360a2f674e8c Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 8 Aug 2024 15:29:18 -0400 Subject: [PATCH 18/35] Undo path deps --- .../google_maps_flutter_android/example/pubspec.yaml | 5 ----- .../google_maps_flutter_android/pubspec.yaml | 7 +------ .../google_maps_flutter_platform_interface/CHANGELOG.md | 4 ++++ .../google_maps_flutter_platform_interface/pubspec.yaml | 4 ++-- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml index c4e75c19a96..9f3931140f6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml @@ -33,8 +33,3 @@ flutter: uses-material-design: true assets: - assets/ - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - {google_maps_flutter_android: {path: ../../../google_maps_flutter/google_maps_flutter_android}, google_maps_flutter_platform_interface: {path: ../../../google_maps_flutter/google_maps_flutter_platform_interface}} diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 2b0601a24ac..204de640572 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: flutter: sdk: flutter flutter_plugin_android_lifecycle: ^2.0.1 - google_maps_flutter_platform_interface: ^2.9.1 + google_maps_flutter_platform_interface: ^2.9.0 stream_transform: ^2.0.0 dev_dependencies: @@ -37,8 +37,3 @@ topics: - google-maps - google-maps-flutter - map - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - {google_maps_flutter_platform_interface: {path: ../../google_maps_flutter/google_maps_flutter_platform_interface}} diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index 62ba5277b89..25d015dc385 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. + ## 2.9.0 * Adds support for heatmap layers. diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml index a01bed82ff4..70705df49d0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.9.0 environment: - sdk: ^3.2.0 - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: collection: ^1.15.0 From fa909ae41c882ce83c5a27bf5227bb1b45f89f41 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 8 Aug 2024 16:09:53 -0400 Subject: [PATCH 19/35] Fix cast issue --- .../src/main/java/io/flutter/plugins/googlemaps/Convert.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index cf6fcfe5022..dbe91ee8fa3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -732,8 +732,7 @@ private static void interpretInfoWindowOptions(MarkerOptionsSink sink, Messages. sink.setInfoWindowText(title, snippet); } Messages.PlatformOffset infoWindowAnchor = infoWindow.getAnchor(); - final List anchorData = toList(infoWindowAnchor); - sink.setInfoWindowAnchor(toFloat(anchorData.get(0)), toFloat(anchorData.get(1))); + sink.setInfoWindowAnchor(infoWindowAnchor.getDx().floatValue(), infoWindowAnchor.getDy().floatValue()); } private static void interpretInfoWindowOptions( From 2410ccd1b28764fd9c7eebb9a9d7473588cb4f6b Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 8 Aug 2024 16:51:04 -0400 Subject: [PATCH 20/35] Add missing import --- .../io/flutter/plugins/googlemaps/MarkersControllerTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index 1593fc6a0c4..d51edd15bcd 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -24,6 +24,7 @@ import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; From 1e3703038a0f43b6fdfe1a284c5cc18cf24ab5e5 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 8 Aug 2024 17:57:25 -0400 Subject: [PATCH 21/35] Builds? --- .../plugins/googlemaps/MarkersControllerTest.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index d51edd15bcd..b63e96711c3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -23,12 +23,8 @@ import com.google.maps.android.collections.MarkerManager; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; -import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -51,9 +47,8 @@ public class MarkersControllerTest { private final float density = 1; private static Messages.PlatformMarker.Builder defaultBuilder() { - Map infoWindow = new HashMap<>(); - List anchor = new ArrayList<>(Arrays.asList(0.5, 0.0)); - infoWindow.put("anchor", anchor); + Messages.PlatformOffset anchor = new Messages.PlatformOffset.Builder().setDx(0.5).setDy(0.0).build(); + Messages.PlatformInfoWindow infoWindow = new Messages.PlatformInfoWindow.Builder().setAnchor(anchor).build(); return new Messages.PlatformMarker.Builder().setPosition( new Messages.PlatformLatLng.Builder().setLatitude(0.0).setLongitude(0.0).build() ).setAnchor( From c71c80b149111338e1d6f7e37c1f073497f60a9b Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 9 Aug 2024 08:56:29 -0400 Subject: [PATCH 22/35] Formatting --- .../flutter/plugins/googlemaps/Convert.java | 15 +- .../flutter/plugins/googlemaps/Messages.java | 1187 +++++++++++------ .../googlemaps/CirclesControllerTest.java | 26 +- .../googlemaps/MarkersControllerTest.java | 58 +- .../lib/src/google_maps_flutter_android.dart | 8 +- .../lib/src/messages.g.dart | 633 +++++---- .../google_maps_flutter_android_test.dart | 6 +- 7 files changed, 1259 insertions(+), 674 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index dbe91ee8fa3..13c50a43a41 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -659,9 +659,14 @@ static void interpretMapConfiguration( } } - static void interpretMarkerOptions(Messages.PlatformMarker marker, MarkerOptionsSink sink, AssetManager assetManager, float density) { + static void interpretMarkerOptions( + Messages.PlatformMarker marker, + MarkerOptionsSink sink, + AssetManager assetManager, + float density) { sink.setAlpha(marker.getAlpha().floatValue()); - sink.setAnchor(marker.getAnchor().getDx().floatValue(), marker.getAnchor().getDy().floatValue()); + sink.setAnchor( + marker.getAnchor().getDx().floatValue(), marker.getAnchor().getDy().floatValue()); sink.setConsumeTapEvents(marker.getConsumeTapEvents()); sink.setDraggable(marker.getDraggable()); sink.setFlat(marker.getFlat()); @@ -724,7 +729,8 @@ static void interpretMarkerOptions( } } - private static void interpretInfoWindowOptions(MarkerOptionsSink sink, Messages.PlatformInfoWindow infoWindow) { + private static void interpretInfoWindowOptions( + MarkerOptionsSink sink, Messages.PlatformInfoWindow infoWindow) { String title = infoWindow.getTitle(); String snippet = infoWindow.getSnippet(); // snippet is nullable. @@ -732,7 +738,8 @@ private static void interpretInfoWindowOptions(MarkerOptionsSink sink, Messages. sink.setInfoWindowText(title, snippet); } Messages.PlatformOffset infoWindowAnchor = infoWindow.getAnchor(); - sink.setInfoWindowAnchor(infoWindowAnchor.getDx().floatValue(), infoWindowAnchor.getDy().floatValue()); + sink.setInfoWindowAnchor( + infoWindowAnchor.getDx().floatValue(), infoWindowAnchor.getDy().floatValue()); } private static void interpretInfoWindowOptions( diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java index 32f519a8132..18a3b0e5452 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -41,8 +40,7 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) - { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { super(message); this.code = code; this.details = details; @@ -61,14 +59,15 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @NonNull protected static FlutterError createConnectionError(@NonNull String channelName) { - return new FlutterError("channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); + return new FlutterError( + "channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); } @Target(METHOD) @@ -104,7 +103,7 @@ private PlatformRendererType(final int index) { /** * Pigeon representatation of a CameraPosition. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraPosition { private @NonNull Double bearing; @@ -164,10 +163,17 @@ public void setZoom(@NonNull Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformCameraPosition that = (PlatformCameraPosition) o; - return bearing.equals(that.bearing) && target.equals(that.target) && tilt.equals(that.tilt) && zoom.equals(that.zoom); + return bearing.equals(that.bearing) + && target.equals(that.target) + && tilt.equals(that.tilt) + && zoom.equals(that.zoom); } @Override @@ -246,13 +252,13 @@ ArrayList toList() { /** * Pigeon representation of a CameraUpdate. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdate { /** - * The update data, as JSON. This should only be set from - * CameraUpdate.toJson, and the native code must interpret it according to the - * internal implementation details of the CameraUpdate class. + * The update data, as JSON. This should only be set from CameraUpdate.toJson, and the native + * code must interpret it according to the internal implementation details of the CameraUpdate + * class. */ private @NonNull Object json; @@ -272,8 +278,12 @@ public void setJson(@NonNull Object setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformCameraUpdate that = (PlatformCameraUpdate) o; return json.equals(that.json); } @@ -318,7 +328,7 @@ ArrayList toList() { /** * Pigeon equivalent of the Circle class. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCircle { private @NonNull Boolean consumeTapEvents; @@ -443,15 +453,36 @@ public void setCircleId(@NonNull String setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformCircle that = (PlatformCircle) o; - return consumeTapEvents.equals(that.consumeTapEvents) && fillColor.equals(that.fillColor) && strokeColor.equals(that.strokeColor) && visible.equals(that.visible) && strokeWidth.equals(that.strokeWidth) && zIndex.equals(that.zIndex) && center.equals(that.center) && radius.equals(that.radius) && circleId.equals(that.circleId); + return consumeTapEvents.equals(that.consumeTapEvents) + && fillColor.equals(that.fillColor) + && strokeColor.equals(that.strokeColor) + && visible.equals(that.visible) + && strokeWidth.equals(that.strokeWidth) + && zIndex.equals(that.zIndex) + && center.equals(that.center) + && radius.equals(that.radius) + && circleId.equals(that.circleId); } @Override public int hashCode() { - return Objects.hash(consumeTapEvents, fillColor, strokeColor, visible, strokeWidth, zIndex, center, radius, circleId); + return Objects.hash( + consumeTapEvents, + fillColor, + strokeColor, + visible, + strokeWidth, + zIndex, + center, + radius, + circleId); } public static final class Builder { @@ -563,13 +594,22 @@ ArrayList toList() { Object consumeTapEvents = __pigeon_list.get(0); pigeonResult.setConsumeTapEvents((Boolean) consumeTapEvents); Object fillColor = __pigeon_list.get(1); - pigeonResult.setFillColor((fillColor == null) ? null : ((fillColor instanceof Integer) ? (Integer) fillColor : (Long) fillColor)); + pigeonResult.setFillColor( + (fillColor == null) + ? null + : ((fillColor instanceof Integer) ? (Integer) fillColor : (Long) fillColor)); Object strokeColor = __pigeon_list.get(2); - pigeonResult.setStrokeColor((strokeColor == null) ? null : ((strokeColor instanceof Integer) ? (Integer) strokeColor : (Long) strokeColor)); + pigeonResult.setStrokeColor( + (strokeColor == null) + ? null + : ((strokeColor instanceof Integer) ? (Integer) strokeColor : (Long) strokeColor)); Object visible = __pigeon_list.get(3); pigeonResult.setVisible((Boolean) visible); Object strokeWidth = __pigeon_list.get(4); - pigeonResult.setStrokeWidth((strokeWidth == null) ? null : ((strokeWidth instanceof Integer) ? (Integer) strokeWidth : (Long) strokeWidth)); + pigeonResult.setStrokeWidth( + (strokeWidth == null) + ? null + : ((strokeWidth instanceof Integer) ? (Integer) strokeWidth : (Long) strokeWidth)); Object zIndex = __pigeon_list.get(5); pigeonResult.setZIndex((Double) zIndex); Object center = __pigeon_list.get(6); @@ -585,13 +625,12 @@ ArrayList toList() { /** * Pigeon equivalent of the Heatmap class. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformHeatmap { /** - * The heatmap data, as JSON. This should only be set from - * Heatmap.toJson, and the native code must interpret it according to the - * internal implementation details of that method. + * The heatmap data, as JSON. This should only be set from Heatmap.toJson, and the native code + * must interpret it according to the internal implementation details of that method. */ private @NonNull Map json; @@ -611,8 +650,12 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformHeatmap that = (PlatformHeatmap) o; return json.equals(that.json); } @@ -657,7 +700,7 @@ ArrayList toList() { /** * Pigeon equivalent of the ClusterManager class. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformClusterManager { private @NonNull String identifier; @@ -678,8 +721,12 @@ public void setIdentifier(@NonNull String setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformClusterManager that = (PlatformClusterManager) o; return identifier.equals(that.identifier); } @@ -724,7 +771,7 @@ ArrayList toList() { /** * Pigeon equivalent of the Offset class. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformOffset { private @NonNull Double dx; @@ -758,8 +805,12 @@ public void setDy(@NonNull Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformOffset that = (PlatformOffset) o; return dx.equals(that.dx) && dy.equals(that.dy); } @@ -816,7 +867,7 @@ ArrayList toList() { /** * Pigeon equivalent of the InfoWindow class. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformInfoWindow { private @Nullable String title; @@ -857,10 +908,16 @@ public void setAnchor(@NonNull PlatformOffset setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformInfoWindow that = (PlatformInfoWindow) o; - return Objects.equals(title, that.title) && Objects.equals(snippet, that.snippet) && anchor.equals(that.anchor); + return Objects.equals(title, that.title) + && Objects.equals(snippet, that.snippet) + && anchor.equals(that.anchor); } @Override @@ -927,7 +984,7 @@ ArrayList toList() { /** * Pigeon equivalent of the Marker class. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformMarker { private @NonNull Double alpha; @@ -1101,15 +1158,44 @@ public void setClusterManagerId(@Nullable String setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformMarker that = (PlatformMarker) o; - return alpha.equals(that.alpha) && anchor.equals(that.anchor) && consumeTapEvents.equals(that.consumeTapEvents) && draggable.equals(that.draggable) && flat.equals(that.flat) && icon.equals(that.icon) && infoWindow.equals(that.infoWindow) && position.equals(that.position) && rotation.equals(that.rotation) && visible.equals(that.visible) && zIndex.equals(that.zIndex) && markerId.equals(that.markerId) && Objects.equals(clusterManagerId, that.clusterManagerId); + return alpha.equals(that.alpha) + && anchor.equals(that.anchor) + && consumeTapEvents.equals(that.consumeTapEvents) + && draggable.equals(that.draggable) + && flat.equals(that.flat) + && icon.equals(that.icon) + && infoWindow.equals(that.infoWindow) + && position.equals(that.position) + && rotation.equals(that.rotation) + && visible.equals(that.visible) + && zIndex.equals(that.zIndex) + && markerId.equals(that.markerId) + && Objects.equals(clusterManagerId, that.clusterManagerId); } @Override public int hashCode() { - return Objects.hash(alpha, anchor, consumeTapEvents, draggable, flat, icon, infoWindow, position, rotation, visible, zIndex, markerId, clusterManagerId); + return Objects.hash( + alpha, + anchor, + consumeTapEvents, + draggable, + flat, + icon, + infoWindow, + position, + rotation, + visible, + zIndex, + markerId, + clusterManagerId); } public static final class Builder { @@ -1291,13 +1377,12 @@ ArrayList toList() { /** * Pigeon equivalent of the Polygon class. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformPolygon { /** - * The polygon data, as JSON. This should only be set from - * Polygon.toJson, and the native code must interpret it according to the - * internal implementation details of that method. + * The polygon data, as JSON. This should only be set from Polygon.toJson, and the native code + * must interpret it according to the internal implementation details of that method. */ private @NonNull Map json; @@ -1317,8 +1402,12 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformPolygon that = (PlatformPolygon) o; return json.equals(that.json); } @@ -1363,13 +1452,12 @@ ArrayList toList() { /** * Pigeon equivalent of the Polyline class. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformPolyline { /** - * The polyline data, as JSON. This should only be set from - * Polyline.toJson, and the native code must interpret it according to the - * internal implementation details of that method. + * The polyline data, as JSON. This should only be set from Polyline.toJson, and the native code + * must interpret it according to the internal implementation details of that method. */ private @NonNull Map json; @@ -1389,8 +1477,12 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformPolyline that = (PlatformPolyline) o; return json.equals(that.json); } @@ -1435,7 +1527,7 @@ ArrayList toList() { /** * Pigeon equivalent of the Tile class. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformTile { private @NonNull Long width; @@ -1479,10 +1571,16 @@ public void setData(@Nullable byte[] setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformTile that = (PlatformTile) o; - return width.equals(that.width) && height.equals(that.height) && Arrays.equals(data, that.data); + return width.equals(that.width) + && height.equals(that.height) + && Arrays.equals(data, that.data); } @Override @@ -1539,9 +1637,13 @@ ArrayList toList() { static @NonNull PlatformTile fromList(@NonNull ArrayList __pigeon_list) { PlatformTile pigeonResult = new PlatformTile(); Object width = __pigeon_list.get(0); - pigeonResult.setWidth((width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); + pigeonResult.setWidth( + (width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); Object height = __pigeon_list.get(1); - pigeonResult.setHeight((height == null) ? null : ((height instanceof Integer) ? (Integer) height : (Long) height)); + pigeonResult.setHeight( + (height == null) + ? null + : ((height instanceof Integer) ? (Integer) height : (Long) height)); Object data = __pigeon_list.get(2); pigeonResult.setData((byte[]) data); return pigeonResult; @@ -1551,13 +1653,13 @@ ArrayList toList() { /** * Pigeon equivalent of the TileOverlay class. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformTileOverlay { /** - * The tile overlay data, as JSON. This should only be set from - * TileOverlay.toJson, and the native code must interpret it according to the - * internal implementation details of that method. + * The tile overlay data, as JSON. This should only be set from TileOverlay.toJson, and the + * native code must interpret it according to the internal implementation details of that + * method. */ private @NonNull Map json; @@ -1577,8 +1679,12 @@ public void setJson(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformTileOverlay that = (PlatformTileOverlay) o; return json.equals(that.json); } @@ -1623,7 +1729,7 @@ ArrayList toList() { /** * Pigeon equivalent of Flutter's EdgeInsets. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformEdgeInsets { private @NonNull Double top; @@ -1683,10 +1789,17 @@ public void setRight(@NonNull Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformEdgeInsets that = (PlatformEdgeInsets) o; - return top.equals(that.top) && bottom.equals(that.bottom) && left.equals(that.left) && right.equals(that.right); + return top.equals(that.top) + && bottom.equals(that.bottom) + && left.equals(that.left) + && right.equals(that.right); } @Override @@ -1765,7 +1878,7 @@ ArrayList toList() { /** * Pigeon equivalent of LatLng. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformLatLng { private @NonNull Double latitude; @@ -1799,8 +1912,12 @@ public void setLongitude(@NonNull Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformLatLng that = (PlatformLatLng) o; return latitude.equals(that.latitude) && longitude.equals(that.longitude); } @@ -1857,7 +1974,7 @@ ArrayList toList() { /** * Pigeon equivalent of LatLngBounds. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformLatLngBounds { private @NonNull PlatformLatLng northeast; @@ -1891,8 +2008,12 @@ public void setSouthwest(@NonNull PlatformLatLng setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformLatLngBounds that = (PlatformLatLngBounds) o; return northeast.equals(that.northeast) && southwest.equals(that.southwest); } @@ -1949,7 +2070,7 @@ ArrayList toList() { /** * Pigeon equivalent of Cluster. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCluster { private @NonNull String clusterManagerId; @@ -2009,10 +2130,17 @@ public void setMarkerIds(@NonNull List setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformCluster that = (PlatformCluster) o; - return clusterManagerId.equals(that.clusterManagerId) && position.equals(that.position) && bounds.equals(that.bounds) && markerIds.equals(that.markerIds); + return clusterManagerId.equals(that.clusterManagerId) + && position.equals(that.position) + && bounds.equals(that.bounds) + && markerIds.equals(that.markerIds); } @Override @@ -2091,10 +2219,10 @@ ArrayList toList() { /** * Pigeon equivalent of CameraTargetBounds. * - * As with the Dart version, it exists to distinguish between not setting a - * a target, and having an explicitly unbounded target (null [bounds]). + *

As with the Dart version, it exists to distinguish between not setting a a target, and + * having an explicitly unbounded target (null [bounds]). * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraTargetBounds { private @Nullable PlatformLatLngBounds bounds; @@ -2109,8 +2237,12 @@ public void setBounds(@Nullable PlatformLatLngBounds setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformCameraTargetBounds that = (PlatformCameraTargetBounds) o; return Objects.equals(bounds, that.bounds); } @@ -2155,7 +2287,7 @@ ArrayList toList() { /** * Information passed to the platform view creation. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformMapViewCreationParams { private @NonNull PlatformCameraPosition initialCameraPosition; @@ -2280,15 +2412,36 @@ public void setInitialClusterManagers(@NonNull List sett @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformMapViewCreationParams that = (PlatformMapViewCreationParams) o; - return initialCameraPosition.equals(that.initialCameraPosition) && mapConfiguration.equals(that.mapConfiguration) && initialCircles.equals(that.initialCircles) && initialMarkers.equals(that.initialMarkers) && initialPolygons.equals(that.initialPolygons) && initialPolylines.equals(that.initialPolylines) && initialHeatmaps.equals(that.initialHeatmaps) && initialTileOverlays.equals(that.initialTileOverlays) && initialClusterManagers.equals(that.initialClusterManagers); + return initialCameraPosition.equals(that.initialCameraPosition) + && mapConfiguration.equals(that.mapConfiguration) + && initialCircles.equals(that.initialCircles) + && initialMarkers.equals(that.initialMarkers) + && initialPolygons.equals(that.initialPolygons) + && initialPolylines.equals(that.initialPolylines) + && initialHeatmaps.equals(that.initialHeatmaps) + && initialTileOverlays.equals(that.initialTileOverlays) + && initialClusterManagers.equals(that.initialClusterManagers); } @Override public int hashCode() { - return Objects.hash(initialCameraPosition, mapConfiguration, initialCircles, initialMarkers, initialPolygons, initialPolylines, initialHeatmaps, initialTileOverlays, initialClusterManagers); + return Objects.hash( + initialCameraPosition, + mapConfiguration, + initialCircles, + initialMarkers, + initialPolygons, + initialPolylines, + initialHeatmaps, + initialTileOverlays, + initialClusterManagers); } public static final class Builder { @@ -2360,7 +2513,8 @@ public static final class Builder { private @Nullable List initialClusterManagers; @CanIgnoreReturnValue - public @NonNull Builder setInitialClusterManagers(@NonNull List setterArg) { + public @NonNull Builder setInitialClusterManagers( + @NonNull List setterArg) { this.initialClusterManagers = setterArg; return this; } @@ -2395,7 +2549,8 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformMapViewCreationParams fromList(@NonNull ArrayList __pigeon_list) { + static @NonNull PlatformMapViewCreationParams fromList( + @NonNull ArrayList __pigeon_list) { PlatformMapViewCreationParams pigeonResult = new PlatformMapViewCreationParams(); Object initialCameraPosition = __pigeon_list.get(0); pigeonResult.setInitialCameraPosition((PlatformCameraPosition) initialCameraPosition); @@ -2422,7 +2577,7 @@ ArrayList toList() { /** * Pigeon equivalent of MapConfiguration. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformMapConfiguration { private @Nullable Boolean compassEnabled; @@ -2627,15 +2782,58 @@ public void setStyle(@Nullable String setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformMapConfiguration that = (PlatformMapConfiguration) o; - return Objects.equals(compassEnabled, that.compassEnabled) && Objects.equals(cameraTargetBounds, that.cameraTargetBounds) && Objects.equals(mapType, that.mapType) && Objects.equals(minMaxZoomPreference, that.minMaxZoomPreference) && Objects.equals(mapToolbarEnabled, that.mapToolbarEnabled) && Objects.equals(rotateGesturesEnabled, that.rotateGesturesEnabled) && Objects.equals(scrollGesturesEnabled, that.scrollGesturesEnabled) && Objects.equals(tiltGesturesEnabled, that.tiltGesturesEnabled) && Objects.equals(trackCameraPosition, that.trackCameraPosition) && Objects.equals(zoomControlsEnabled, that.zoomControlsEnabled) && Objects.equals(zoomGesturesEnabled, that.zoomGesturesEnabled) && Objects.equals(myLocationEnabled, that.myLocationEnabled) && Objects.equals(myLocationButtonEnabled, that.myLocationButtonEnabled) && Objects.equals(padding, that.padding) && Objects.equals(indoorViewEnabled, that.indoorViewEnabled) && Objects.equals(trafficEnabled, that.trafficEnabled) && Objects.equals(buildingsEnabled, that.buildingsEnabled) && Objects.equals(liteModeEnabled, that.liteModeEnabled) && Objects.equals(cloudMapId, that.cloudMapId) && Objects.equals(style, that.style); + return Objects.equals(compassEnabled, that.compassEnabled) + && Objects.equals(cameraTargetBounds, that.cameraTargetBounds) + && Objects.equals(mapType, that.mapType) + && Objects.equals(minMaxZoomPreference, that.minMaxZoomPreference) + && Objects.equals(mapToolbarEnabled, that.mapToolbarEnabled) + && Objects.equals(rotateGesturesEnabled, that.rotateGesturesEnabled) + && Objects.equals(scrollGesturesEnabled, that.scrollGesturesEnabled) + && Objects.equals(tiltGesturesEnabled, that.tiltGesturesEnabled) + && Objects.equals(trackCameraPosition, that.trackCameraPosition) + && Objects.equals(zoomControlsEnabled, that.zoomControlsEnabled) + && Objects.equals(zoomGesturesEnabled, that.zoomGesturesEnabled) + && Objects.equals(myLocationEnabled, that.myLocationEnabled) + && Objects.equals(myLocationButtonEnabled, that.myLocationButtonEnabled) + && Objects.equals(padding, that.padding) + && Objects.equals(indoorViewEnabled, that.indoorViewEnabled) + && Objects.equals(trafficEnabled, that.trafficEnabled) + && Objects.equals(buildingsEnabled, that.buildingsEnabled) + && Objects.equals(liteModeEnabled, that.liteModeEnabled) + && Objects.equals(cloudMapId, that.cloudMapId) + && Objects.equals(style, that.style); } @Override public int hashCode() { - return Objects.hash(compassEnabled, cameraTargetBounds, mapType, minMaxZoomPreference, mapToolbarEnabled, rotateGesturesEnabled, scrollGesturesEnabled, tiltGesturesEnabled, trackCameraPosition, zoomControlsEnabled, zoomGesturesEnabled, myLocationEnabled, myLocationButtonEnabled, padding, indoorViewEnabled, trafficEnabled, buildingsEnabled, liteModeEnabled, cloudMapId, style); + return Objects.hash( + compassEnabled, + cameraTargetBounds, + mapType, + minMaxZoomPreference, + mapToolbarEnabled, + rotateGesturesEnabled, + scrollGesturesEnabled, + tiltGesturesEnabled, + trackCameraPosition, + zoomControlsEnabled, + zoomGesturesEnabled, + myLocationEnabled, + myLocationButtonEnabled, + padding, + indoorViewEnabled, + trafficEnabled, + buildingsEnabled, + liteModeEnabled, + cloudMapId, + style); } public static final class Builder { @@ -2651,7 +2849,8 @@ public static final class Builder { private @Nullable PlatformCameraTargetBounds cameraTargetBounds; @CanIgnoreReturnValue - public @NonNull Builder setCameraTargetBounds(@Nullable PlatformCameraTargetBounds setterArg) { + public @NonNull Builder setCameraTargetBounds( + @Nullable PlatformCameraTargetBounds setterArg) { this.cameraTargetBounds = setterArg; return this; } @@ -2901,7 +3100,7 @@ ArrayList toList() { /** * Pigeon representation of an x,y coordinate. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformPoint { private @NonNull Long x; @@ -2935,8 +3134,12 @@ public void setY(@NonNull Long setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformPoint that = (PlatformPoint) o; return x.equals(that.x) && y.equals(that.y); } @@ -2993,7 +3196,7 @@ ArrayList toList() { /** * Pigeon equivalent of native TileOverlay properties. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformTileLayer { private @NonNull Boolean visible; @@ -3053,10 +3256,17 @@ public void setZIndex(@NonNull Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformTileLayer that = (PlatformTileLayer) o; - return visible.equals(that.visible) && fadeIn.equals(that.fadeIn) && transparency.equals(that.transparency) && zIndex.equals(that.zIndex); + return visible.equals(that.visible) + && fadeIn.equals(that.fadeIn) + && transparency.equals(that.transparency) + && zIndex.equals(that.zIndex); } @Override @@ -3135,7 +3345,7 @@ ArrayList toList() { /** * Possible outcomes of launching a URL. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformZoomRange { private @Nullable Double min; @@ -3160,8 +3370,12 @@ public void setMax(@Nullable Double setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } PlatformZoomRange that = (PlatformZoomRange) o; return Objects.equals(min, that.min) && Objects.equals(max, that.max); } @@ -3366,7 +3580,6 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } } - /** Asynchronous error handling return type for non-nullable API method returns. */ public interface Result { /** Success case callback method for handling returns. */ @@ -3394,9 +3607,9 @@ public interface VoidResult { /** * Interface for non-test interactions with the native SDK. * - * For test-only state queries, see [MapsInspectorApi]. + *

For test-only state queries, see [MapsInspectorApi]. * - * Generated interface from Pigeon that represents a handler of messages from Flutter. + *

Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MapsApi { /** Returns once the map instance is available. */ @@ -3404,70 +3617,82 @@ public interface MapsApi { /** * Updates the map's configuration options. * - * Only non-null configuration values will result in updates; options with - * null values will remain unchanged. + *

Only non-null configuration values will result in updates; options with null values will + * remain unchanged. */ void updateMapConfiguration(@NonNull PlatformMapConfiguration configuration); /** Updates the set of circles on the map. */ - void updateCircles(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + void updateCircles( + @NonNull List toAdd, + @NonNull List toChange, + @NonNull List idsToRemove); /** Updates the set of heatmaps on the map. */ - void updateHeatmaps(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + void updateHeatmaps( + @NonNull List toAdd, + @NonNull List toChange, + @NonNull List idsToRemove); /** Updates the set of custer managers for clusters on the map. */ - void updateClusterManagers(@NonNull List toAdd, @NonNull List idsToRemove); + void updateClusterManagers( + @NonNull List toAdd, @NonNull List idsToRemove); /** Updates the set of markers on the map. */ - void updateMarkers(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + void updateMarkers( + @NonNull List toAdd, + @NonNull List toChange, + @NonNull List idsToRemove); /** Updates the set of polygonss on the map. */ - void updatePolygons(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + void updatePolygons( + @NonNull List toAdd, + @NonNull List toChange, + @NonNull List idsToRemove); /** Updates the set of polylines on the map. */ - void updatePolylines(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + void updatePolylines( + @NonNull List toAdd, + @NonNull List toChange, + @NonNull List idsToRemove); /** Updates the set of tile overlays on the map. */ - void updateTileOverlays(@NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + void updateTileOverlays( + @NonNull List toAdd, + @NonNull List toChange, + @NonNull List idsToRemove); /** Gets the screen coordinate for the given map location. */ - @NonNull + @NonNull PlatformPoint getScreenCoordinate(@NonNull PlatformLatLng latLng); /** Gets the map location for the given screen coordinate. */ - @NonNull + @NonNull PlatformLatLng getLatLng(@NonNull PlatformPoint screenCoordinate); /** Gets the map region currently displayed on the map. */ - @NonNull + @NonNull PlatformLatLngBounds getVisibleRegion(); - /** - * Moves the camera according to [cameraUpdate] immediately, with no - * animation. - */ + /** Moves the camera according to [cameraUpdate] immediately, with no animation. */ void moveCamera(@NonNull PlatformCameraUpdate cameraUpdate); /** Moves the camera according to [cameraUpdate], animating the update. */ void animateCamera(@NonNull PlatformCameraUpdate cameraUpdate); /** Gets the current map zoom level. */ - @NonNull + @NonNull Double getZoomLevel(); /** Show the info window for the marker with the given ID. */ void showInfoWindow(@NonNull String markerId); /** Hide the info window for the marker with the given ID. */ void hideInfoWindow(@NonNull String markerId); - /** - * Returns true if the marker with the given ID is currently displaying its - * info window. - */ - @NonNull + /** Returns true if the marker with the given ID is currently displaying its info window. */ + @NonNull Boolean isInfoWindowShown(@NonNull String markerId); /** - * Sets the style to the given map style string, where an empty string - * indicates that the style should be cleared. + * Sets the style to the given map style string, where an empty string indicates that the style + * should be cleared. * - * Returns false if there was an error setting the style, such as an invalid - * style string. + *

Returns false if there was an error setting the style, such as an invalid style string. */ - @NonNull + @NonNull Boolean setStyle(@NonNull String style); /** - * Returns true if the last attempt to set a style, either via initial map - * style or setMapStyle, succeeded. + * Returns true if the last attempt to set a style, either via initial map style or setMapStyle, + * succeeded. * - * This allows checking asynchronously for initial style failures, as there - * is no way to return failures from map initialization. + *

This allows checking asynchronously for initial style failures, as there is no way to + * return failures from map initialization. */ - @NonNull + @NonNull Boolean didLastStyleSucceed(); /** Clears the cache of tiles previously requseted from the tile provider. */ void clearTileCache(@NonNull String tileOverlayId); @@ -3478,16 +3703,23 @@ public interface MapsApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /**Sets up an instance of `MapsApi` to handle messages through the `binaryMessenger`. */ + /** Sets up an instance of `MapsApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable MapsApi api) { setUp(binaryMessenger, "", api); } - static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable MapsApi api) { + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable MapsApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3514,7 +3746,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3524,8 +3759,7 @@ public void error(Throwable error) { try { api.updateMapConfiguration(configurationArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3538,7 +3772,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3550,8 +3787,7 @@ public void error(Throwable error) { try { api.updateCircles(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3564,7 +3800,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3576,8 +3815,7 @@ public void error(Throwable error) { try { api.updateHeatmaps(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3590,7 +3828,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3601,8 +3842,7 @@ public void error(Throwable error) { try { api.updateClusterManagers(toAddArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3615,7 +3855,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3627,8 +3870,7 @@ public void error(Throwable error) { try { api.updateMarkers(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3641,7 +3883,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3653,8 +3898,7 @@ public void error(Throwable error) { try { api.updatePolygons(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3667,7 +3911,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3679,8 +3926,7 @@ public void error(Throwable error) { try { api.updatePolylines(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3693,7 +3939,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3705,8 +3954,7 @@ public void error(Throwable error) { try { api.updateTileOverlays(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3719,7 +3967,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3729,8 +3980,7 @@ public void error(Throwable error) { try { PlatformPoint output = api.getScreenCoordinate(latLngArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3743,7 +3993,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3753,8 +4006,7 @@ public void error(Throwable error) { try { PlatformLatLng output = api.getLatLng(screenCoordinateArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3767,7 +4019,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3775,8 +4030,7 @@ public void error(Throwable error) { try { PlatformLatLngBounds output = api.getVisibleRegion(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3789,7 +4043,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3799,8 +4056,7 @@ public void error(Throwable error) { try { api.moveCamera(cameraUpdateArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3813,7 +4069,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3823,8 +4082,7 @@ public void error(Throwable error) { try { api.animateCamera(cameraUpdateArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3837,7 +4095,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3845,8 +4106,7 @@ public void error(Throwable error) { try { Double output = api.getZoomLevel(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3859,7 +4119,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3869,8 +4132,7 @@ public void error(Throwable error) { try { api.showInfoWindow(markerIdArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3883,7 +4145,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3893,8 +4158,7 @@ public void error(Throwable error) { try { api.hideInfoWindow(markerIdArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3907,7 +4171,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3917,8 +4184,7 @@ public void error(Throwable error) { try { Boolean output = api.isInfoWindowShown(markerIdArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3931,7 +4197,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3941,8 +4210,7 @@ public void error(Throwable error) { try { Boolean output = api.setStyle(styleArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3955,7 +4223,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3963,8 +4234,7 @@ public void error(Throwable error) { try { Boolean output = api.didLastStyleSucceed(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3977,7 +4247,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3987,8 +4260,7 @@ public void error(Throwable error) { try { api.clearTileCache(tileOverlayIdArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4001,7 +4273,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4035,366 +4310,470 @@ public static class MapsCallbackApi { public MapsCallbackApi(@NonNull BinaryMessenger argBinaryMessenger) { this(argBinaryMessenger, ""); } - public MapsCallbackApi(@NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + + public MapsCallbackApi( + @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { this.binaryMessenger = argBinaryMessenger; this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ /** The codec used by MapsCallbackApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } /** Called when the map camera starts moving. */ public void onCameraMoveStarted(@NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when the map camera moves. */ - public void onCameraMove(@NonNull PlatformCameraPosition cameraPositionArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove" + messageChannelSuffix; + public void onCameraMove( + @NonNull PlatformCameraPosition cameraPositionArg, @NonNull VoidResult result) { + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(cameraPositionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when the map camera stops moving. */ public void onCameraIdle(@NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when the map, not a specifc map object, is tapped. */ public void onTap(@NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when the map, not a specifc map object, is long pressed. */ public void onLongPress(@NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker is tapped. */ public void onMarkerTap(@NonNull String markerIdArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(markerIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker drag starts. */ - public void onMarkerDragStart(@NonNull String markerIdArg, @NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart" + messageChannelSuffix; + public void onMarkerDragStart( + @NonNull String markerIdArg, + @NonNull PlatformLatLng positionArg, + @NonNull VoidResult result) { + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Arrays.asList(markerIdArg, positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker drag updates. */ - public void onMarkerDrag(@NonNull String markerIdArg, @NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag" + messageChannelSuffix; + public void onMarkerDrag( + @NonNull String markerIdArg, + @NonNull PlatformLatLng positionArg, + @NonNull VoidResult result) { + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Arrays.asList(markerIdArg, positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker drag ends. */ - public void onMarkerDragEnd(@NonNull String markerIdArg, @NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd" + messageChannelSuffix; + public void onMarkerDragEnd( + @NonNull String markerIdArg, + @NonNull PlatformLatLng positionArg, + @NonNull VoidResult result) { + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Arrays.asList(markerIdArg, positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker's info window is tapped. */ public void onInfoWindowTap(@NonNull String markerIdArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(markerIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a circle is tapped. */ public void onCircleTap(@NonNull String circleIdArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(circleIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a marker cluster is tapped. */ public void onClusterTap(@NonNull PlatformCluster clusterArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(clusterArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a polygon is tapped. */ public void onPolygonTap(@NonNull String polygonIdArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(polygonIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called when a polyline is tapped. */ public void onPolylineTap(@NonNull String polylineIdArg, @NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(polylineIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Called to get data for a map tile. */ - public void getTileOverlayTile(@NonNull String tileOverlayIdArg, @NonNull PlatformPoint locationArg, @NonNull Long zoomArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile" + messageChannelSuffix; + public void getTileOverlayTile( + @NonNull String tileOverlayIdArg, + @NonNull PlatformPoint locationArg, + @NonNull Long zoomArg, + @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Arrays.asList(tileOverlayIdArg, locationArg, zoomArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") PlatformTile output = (PlatformTile) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } } /** * Interface for global SDK initialization. * - * Generated interface from Pigeon that represents a handler of messages from Flutter. + *

Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MapsInitializerApi { /** * Initializes the Google Maps SDK with the given renderer preference. * - * A null renderer preference will result in the default renderer. + *

A null renderer preference will result in the default renderer. * - * Calling this more than once in the lifetime of an application will result - * in an error. + *

Calling this more than once in the lifetime of an application will result in an error. */ - void initializeWithPreferredRenderer(@Nullable PlatformRendererType type, @NonNull Result result); + void initializeWithPreferredRenderer( + @Nullable PlatformRendererType type, @NonNull Result result); /** The codec used by MapsInitializerApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /**Sets up an instance of `MapsInitializerApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `MapsInitializerApi` to handle messages through the `binaryMessenger`. + */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable MapsInitializerApi api) { setUp(binaryMessenger, "", api); } - static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable MapsInitializerApi api) { + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable MapsInitializerApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4423,11 +4802,10 @@ public void error(Throwable error) { } } /** - * Dummy interface to force generation of the platform view creation params, - * which are not used in any Pigeon calls, only the platform view creation - * call made internally by Flutter. + * Dummy interface to force generation of the platform view creation params, which are not used in + * any Pigeon calls, only the platform view creation call made internally by Flutter. * - * Generated interface from Pigeon that represents a handler of messages from Flutter. + *

Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MapsPlatformViewApi { @@ -4437,16 +4815,26 @@ public interface MapsPlatformViewApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /**Sets up an instance of `MapsPlatformViewApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `MapsPlatformViewApi` to handle messages through the + * `binaryMessenger`. + */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable MapsPlatformViewApi api) { setUp(binaryMessenger, "", api); } - static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable MapsPlatformViewApi api) { + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable MapsPlatformViewApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4456,8 +4844,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { api.createView(typeArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4472,66 +4859,75 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess /** * Inspector API only intended for use in integration tests. * - * Generated interface from Pigeon that represents a handler of messages from Flutter. + *

Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MapsInspectorApi { - @NonNull + @NonNull Boolean areBuildingsEnabled(); - @NonNull + @NonNull Boolean areRotateGesturesEnabled(); - @NonNull + @NonNull Boolean areZoomControlsEnabled(); - @NonNull + @NonNull Boolean areScrollGesturesEnabled(); - @NonNull + @NonNull Boolean areTiltGesturesEnabled(); - @NonNull + @NonNull Boolean areZoomGesturesEnabled(); - @NonNull + @NonNull Boolean isCompassEnabled(); - @Nullable + @Nullable Boolean isLiteModeEnabled(); - @NonNull + @NonNull Boolean isMapToolbarEnabled(); - @NonNull + @NonNull Boolean isMyLocationButtonEnabled(); - @NonNull + @NonNull Boolean isTrafficEnabled(); - @Nullable + @Nullable PlatformTileLayer getTileOverlayInfo(@NonNull String tileOverlayId); - @NonNull + @NonNull PlatformZoomRange getZoomRange(); - @NonNull + @NonNull List getClusters(@NonNull String clusterManagerId); /** The codec used by MapsInspectorApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /**Sets up an instance of `MapsInspectorApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `MapsInspectorApi` to handle messages through the `binaryMessenger`. + */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable MapsInspectorApi api) { setUp(binaryMessenger, "", api); } - static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable MapsInspectorApi api) { + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable MapsInspectorApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4539,8 +4935,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.areBuildingsEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4553,7 +4948,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4561,8 +4959,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.areRotateGesturesEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4575,7 +4972,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4583,8 +4983,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.areZoomControlsEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4597,7 +4996,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4605,8 +5007,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.areScrollGesturesEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4619,7 +5020,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4627,8 +5031,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.areTiltGesturesEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4641,7 +5044,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4649,8 +5055,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.areZoomGesturesEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4663,7 +5068,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4671,8 +5079,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.isCompassEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4685,7 +5092,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4693,8 +5103,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.isLiteModeEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4707,7 +5116,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4715,8 +5127,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.isMapToolbarEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4729,7 +5140,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4737,8 +5151,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.isMyLocationButtonEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4751,7 +5164,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4759,8 +5175,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.isTrafficEnabled(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4773,7 +5188,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4783,8 +5201,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { PlatformTileLayer output = api.getTileOverlayInfo(tileOverlayIdArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4797,7 +5214,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4805,8 +5225,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { PlatformZoomRange output = api.getZoomRange(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4819,7 +5238,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4829,8 +5251,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { List output = api.getClusters(clusterManagerIdArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/CirclesControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/CirclesControllerTest.java index cf64b4b5622..6d09d704722 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/CirclesControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/CirclesControllerTest.java @@ -15,7 +15,6 @@ import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.Circle; import com.google.android.gms.maps.model.CircleOptions; - import java.util.Collections; import org.junit.After; import org.junit.Assert; @@ -50,24 +49,23 @@ public void controller_changeCircles_updatesExistingCircle() { final String id = "a_circle"; final Messages.PlatformCircle.Builder builder = new Messages.PlatformCircle.Builder(); - builder.setCircleId(id) - .setConsumeTapEvents(false) - .setFillColor(0L) - .setCenter(new Messages.PlatformLatLng.Builder().setLatitude(0.0).setLongitude(0.0).build()) - .setRadius(1.0) - .setStrokeColor(0L) - .setStrokeWidth(1L) - .setVisible(true) - .setZIndex(0.0); + builder + .setCircleId(id) + .setConsumeTapEvents(false) + .setFillColor(0L) + .setCenter(new Messages.PlatformLatLng.Builder().setLatitude(0.0).setLongitude(0.0).build()) + .setRadius(1.0) + .setStrokeColor(0L) + .setStrokeWidth(1L) + .setVisible(true) + .setZIndex(0.0); - controller.addCircles( - Collections.singletonList(builder.build())); + controller.addCircles(Collections.singletonList(builder.build())); // There should be exactly one circle. Assert.assertEquals(1, controller.circleIdToController.size()); builder.setConsumeTapEvents(true); - controller.changeCircles( - Collections.singletonList(builder.build())); + controller.changeCircles(Collections.singletonList(builder.build())); // There should still only be one circle, and it should be updated. Assert.assertEquals(1, controller.circleIdToController.size()); verify(circle, times(1)).setClickable(true); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index b63e96711c3..6f016f21933 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -47,21 +47,23 @@ public class MarkersControllerTest { private final float density = 1; private static Messages.PlatformMarker.Builder defaultBuilder() { - Messages.PlatformOffset anchor = new Messages.PlatformOffset.Builder().setDx(0.5).setDy(0.0).build(); - Messages.PlatformInfoWindow infoWindow = new Messages.PlatformInfoWindow.Builder().setAnchor(anchor).build(); - return new Messages.PlatformMarker.Builder().setPosition( - new Messages.PlatformLatLng.Builder().setLatitude(0.0).setLongitude(0.0).build() - ).setAnchor( - new Messages.PlatformOffset.Builder().setDx(0.0).setDy(0.0).build() - ).setFlat(false) - .setDraggable(false) - .setVisible(true) - .setAlpha(1.0) - .setRotation(0.0) - .setZIndex(0.0) - .setConsumeTapEvents(false) - .setIcon(Collections.singletonList("null")) - .setInfoWindow(infoWindow); + Messages.PlatformOffset anchor = + new Messages.PlatformOffset.Builder().setDx(0.5).setDy(0.0).build(); + Messages.PlatformInfoWindow infoWindow = + new Messages.PlatformInfoWindow.Builder().setAnchor(anchor).build(); + return new Messages.PlatformMarker.Builder() + .setPosition( + new Messages.PlatformLatLng.Builder().setLatitude(0.0).setLongitude(0.0).build()) + .setAnchor(new Messages.PlatformOffset.Builder().setDx(0.0).setDy(0.0).build()) + .setFlat(false) + .setDraggable(false) + .setVisible(true) + .setAlpha(1.0) + .setRotation(0.0) + .setZIndex(0.0) + .setConsumeTapEvents(false) + .setIcon(Collections.singletonList("null")) + .setInfoWindow(infoWindow); } @Before @@ -90,7 +92,8 @@ public void controller_OnMarkerDragStart() { final LatLng latLng = new LatLng(1.1, 2.2); - final List markers = Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); + final List markers = + Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); controller.addMarkers(markers); controller.onMarkerDragStart(googleMarkerId, latLng); @@ -109,7 +112,8 @@ public void controller_OnMarkerDragEnd() { final LatLng latLng = new LatLng(1.1, 2.2); - final List markers = Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); + final List markers = + Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); controller.addMarkers(markers); controller.onMarkerDragEnd(googleMarkerId, latLng); @@ -128,7 +132,8 @@ public void controller_OnMarkerDrag() { final LatLng latLng = new LatLng(1.1, 2.2); - final List markers = Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); + final List markers = + Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); controller.addMarkers(markers); controller.onMarkerDrag(googleMarkerId, latLng); @@ -139,7 +144,8 @@ public void controller_OnMarkerDrag() { @Test(expected = IllegalStateException.class) public void controller_AddMarkerThrowsErrorIfMarkerIdIsNull() { - final List markers = Collections.singletonList(defaultBuilder().build()); + final List markers = + Collections.singletonList(defaultBuilder().build()); try { controller.addMarkers(markers); } catch (IllegalStateException e) { @@ -156,9 +162,11 @@ public void controller_AddChangeAndRemoveMarkerWithClusterManagerId() { final String clusterManagerId = "cm123"; final Messages.PlatformMarker.Builder builder = defaultBuilder(); - builder.setMarkerId(googleMarkerId) - .setClusterManagerId(clusterManagerId) - .setPosition(new Messages.PlatformLatLng.Builder().setLatitude(1.1).setLongitude(2.2).build()); + builder + .setMarkerId(googleMarkerId) + .setClusterManagerId(clusterManagerId) + .setPosition( + new Messages.PlatformLatLng.Builder().setLatitude(1.1).setLongitude(2.2).build()); when(marker.getId()).thenReturn(googleMarkerId); @@ -175,9 +183,9 @@ public void controller_AddChangeAndRemoveMarkerWithClusterManagerId() { // Change marker to test that markerController is created and the marker can be updated final LatLng latLng2 = new LatLng(3.3, 4.4); - builder.setPosition(new Messages.PlatformLatLng.Builder().setLatitude(3.3).setLongitude(4.4).build()); - final List updatedMarkers = - Collections.singletonList(builder.build()); + builder.setPosition( + new Messages.PlatformLatLng.Builder().setLatitude(3.3).setLongitude(4.4).build()); + final List updatedMarkers = Collections.singletonList(builder.build()); controller.changeMarkers(updatedMarkers); Mockito.verify(marker, times(1)).setPosition(latLng2); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart index c9c153f295d..b0c3d0c9852 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart @@ -722,8 +722,12 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { identifier: clusterManager.clusterManagerId.value); } - static PlatformInfoWindow _platformInfoWindowFromInfoWindow(InfoWindow window) { - return PlatformInfoWindow(title: window.title, snippet: window.snippet, anchor: _platformOffsetFromOffset(window.anchor)); + static PlatformInfoWindow _platformInfoWindowFromInfoWindow( + InfoWindow window) { + return PlatformInfoWindow( + title: window.title, + snippet: window.snippet, + anchor: _platformOffsetFromOffset(window.anchor)); } static PlatformMarker _platformMarkerFromMarker(Marker marker) { diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart index 388764ad5c8..d28a12eb1b5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart @@ -18,7 +18,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -668,10 +669,13 @@ class PlatformMapViewCreationParams { initialCircles: (result[2] as List?)!.cast(), initialMarkers: (result[3] as List?)!.cast(), initialPolygons: (result[4] as List?)!.cast(), - initialPolylines: (result[5] as List?)!.cast(), + initialPolylines: + (result[5] as List?)!.cast(), initialHeatmaps: (result[6] as List?)!.cast(), - initialTileOverlays: (result[7] as List?)!.cast(), - initialClusterManagers: (result[8] as List?)!.cast(), + initialTileOverlays: + (result[7] as List?)!.cast(), + initialClusterManagers: + (result[8] as List?)!.cast(), ); } } @@ -884,7 +888,6 @@ class PlatformZoomRange { } } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -892,73 +895,73 @@ class _PigeonCodec extends StandardMessageCodec { if (value is PlatformCameraPosition) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdate) { + } else if (value is PlatformCameraUpdate) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is PlatformCircle) { + } else if (value is PlatformCircle) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is PlatformHeatmap) { + } else if (value is PlatformHeatmap) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is PlatformClusterManager) { + } else if (value is PlatformClusterManager) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is PlatformOffset) { + } else if (value is PlatformOffset) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is PlatformInfoWindow) { + } else if (value is PlatformInfoWindow) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformMarker) { + } else if (value is PlatformMarker) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is PlatformPolygon) { + } else if (value is PlatformPolygon) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PlatformPolyline) { + } else if (value is PlatformPolyline) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PlatformTile) { + } else if (value is PlatformTile) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PlatformTileOverlay) { + } else if (value is PlatformTileOverlay) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PlatformEdgeInsets) { + } else if (value is PlatformEdgeInsets) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLng) { + } else if (value is PlatformLatLng) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLngBounds) { + } else if (value is PlatformLatLngBounds) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PlatformCluster) { + } else if (value is PlatformCluster) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraTargetBounds) { + } else if (value is PlatformCameraTargetBounds) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is PlatformMapViewCreationParams) { + } else if (value is PlatformMapViewCreationParams) { buffer.putUint8(146); writeValue(buffer, value.encode()); - } else if (value is PlatformMapConfiguration) { + } else if (value is PlatformMapConfiguration) { buffer.putUint8(147); writeValue(buffer, value.encode()); - } else if (value is PlatformPoint) { + } else if (value is PlatformPoint) { buffer.putUint8(148); writeValue(buffer, value.encode()); - } else if (value is PlatformTileLayer) { + } else if (value is PlatformTileLayer) { buffer.putUint8(149); writeValue(buffer, value.encode()); - } else if (value is PlatformZoomRange) { + } else if (value is PlatformZoomRange) { buffer.putUint8(150); writeValue(buffer, value.encode()); - } else if (value is PlatformMapType) { + } else if (value is PlatformMapType) { buffer.putUint8(151); writeValue(buffer, value.index); - } else if (value is PlatformRendererType) { + } else if (value is PlatformRendererType) { buffer.putUint8(152); writeValue(buffer, value.index); } else { @@ -969,54 +972,54 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return PlatformCameraPosition.decode(readValue(buffer)!); - case 130: + case 130: return PlatformCameraUpdate.decode(readValue(buffer)!); - case 131: + case 131: return PlatformCircle.decode(readValue(buffer)!); - case 132: + case 132: return PlatformHeatmap.decode(readValue(buffer)!); - case 133: + case 133: return PlatformClusterManager.decode(readValue(buffer)!); - case 134: + case 134: return PlatformOffset.decode(readValue(buffer)!); - case 135: + case 135: return PlatformInfoWindow.decode(readValue(buffer)!); - case 136: + case 136: return PlatformMarker.decode(readValue(buffer)!); - case 137: + case 137: return PlatformPolygon.decode(readValue(buffer)!); - case 138: + case 138: return PlatformPolyline.decode(readValue(buffer)!); - case 139: + case 139: return PlatformTile.decode(readValue(buffer)!); - case 140: + case 140: return PlatformTileOverlay.decode(readValue(buffer)!); - case 141: + case 141: return PlatformEdgeInsets.decode(readValue(buffer)!); - case 142: + case 142: return PlatformLatLng.decode(readValue(buffer)!); - case 143: + case 143: return PlatformLatLngBounds.decode(readValue(buffer)!); - case 144: + case 144: return PlatformCluster.decode(readValue(buffer)!); - case 145: + case 145: return PlatformCameraTargetBounds.decode(readValue(buffer)!); - case 146: + case 146: return PlatformMapViewCreationParams.decode(readValue(buffer)!); - case 147: + case 147: return PlatformMapConfiguration.decode(readValue(buffer)!); - case 148: + case 148: return PlatformPoint.decode(readValue(buffer)!); - case 149: + case 149: return PlatformTileLayer.decode(readValue(buffer)!); - case 150: + case 150: return PlatformZoomRange.decode(readValue(buffer)!); - case 151: + case 151: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformMapType.values[value]; - case 152: + case 152: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformRendererType.values[value]; default: @@ -1034,7 +1037,8 @@ class MapsApi { /// BinaryMessenger will be used which routes to the host platform. MapsApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -1043,8 +1047,10 @@ class MapsApi { /// Returns once the map instance is available. Future waitForMap() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1068,9 +1074,12 @@ class MapsApi { /// /// Only non-null configuration values will result in updates; options with /// null values will remain unchanged. - Future updateMapConfiguration(PlatformMapConfiguration configuration) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future updateMapConfiguration( + PlatformMapConfiguration configuration) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1091,15 +1100,18 @@ class MapsApi { } /// Updates the set of circles on the map. - Future updateCircles(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future updateCircles(List toAdd, + List toChange, List idsToRemove) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1114,15 +1126,18 @@ class MapsApi { } /// Updates the set of heatmaps on the map. - Future updateHeatmaps(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future updateHeatmaps(List toAdd, + List toChange, List idsToRemove) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1137,15 +1152,18 @@ class MapsApi { } /// Updates the set of custer managers for clusters on the map. - Future updateClusterManagers(List toAdd, List idsToRemove) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future updateClusterManagers( + List toAdd, List idsToRemove) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([toAdd, idsToRemove]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([toAdd, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1160,15 +1178,18 @@ class MapsApi { } /// Updates the set of markers on the map. - Future updateMarkers(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future updateMarkers(List toAdd, + List toChange, List idsToRemove) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1183,15 +1204,18 @@ class MapsApi { } /// Updates the set of polygonss on the map. - Future updatePolygons(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future updatePolygons(List toAdd, + List toChange, List idsToRemove) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1206,15 +1230,18 @@ class MapsApi { } /// Updates the set of polylines on the map. - Future updatePolylines(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future updatePolylines(List toAdd, + List toChange, List idsToRemove) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1229,15 +1256,18 @@ class MapsApi { } /// Updates the set of tile overlays on the map. - Future updateTileOverlays(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future updateTileOverlays(List toAdd, + List toChange, List idsToRemove) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1253,8 +1283,10 @@ class MapsApi { /// Gets the screen coordinate for the given map location. Future getScreenCoordinate(PlatformLatLng latLng) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1281,14 +1313,16 @@ class MapsApi { /// Gets the map location for the given screen coordinate. Future getLatLng(PlatformPoint screenCoordinate) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([screenCoordinate]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([screenCoordinate]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1309,8 +1343,10 @@ class MapsApi { /// Gets the map region currently displayed on the map. Future getVisibleRegion() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1338,8 +1374,10 @@ class MapsApi { /// Moves the camera according to [cameraUpdate] immediately, with no /// animation. Future moveCamera(PlatformCameraUpdate cameraUpdate) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1361,8 +1399,10 @@ class MapsApi { /// Moves the camera according to [cameraUpdate], animating the update. Future animateCamera(PlatformCameraUpdate cameraUpdate) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1384,8 +1424,10 @@ class MapsApi { /// Gets the current map zoom level. Future getZoomLevel() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1412,8 +1454,10 @@ class MapsApi { /// Show the info window for the marker with the given ID. Future showInfoWindow(String markerId) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1435,8 +1479,10 @@ class MapsApi { /// Hide the info window for the marker with the given ID. Future hideInfoWindow(String markerId) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1459,8 +1505,10 @@ class MapsApi { /// Returns true if the marker with the given ID is currently displaying its /// info window. Future isInfoWindowShown(String markerId) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1491,8 +1539,10 @@ class MapsApi { /// Returns false if there was an error setting the style, such as an invalid /// style string. Future setStyle(String style) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1523,8 +1573,10 @@ class MapsApi { /// This allows checking asynchronously for initial style failures, as there /// is no way to return failures from map initialization. Future didLastStyleSucceed() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1551,8 +1603,10 @@ class MapsApi { /// Clears the cache of tiles previously requseted from the tile provider. Future clearTileCache(String tileOverlayId) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1574,8 +1628,10 @@ class MapsApi { /// Takes a snapshot of the map and returns its image data. Future takeSnapshot() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1647,13 +1703,21 @@ abstract class MapsCallbackApi { void onPolylineTap(String polylineId); /// Called to get data for a map tile. - Future getTileOverlayTile(String tileOverlayId, PlatformPoint location, int zoom); - - static void setUp(MapsCallbackApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + Future getTileOverlayTile( + String tileOverlayId, PlatformPoint location, int zoom); + + static void setUp( + MapsCallbackApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -1664,24 +1728,28 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove was null.'); final List args = (message as List?)!; - final PlatformCameraPosition? arg_cameraPosition = (args[0] as PlatformCameraPosition?); + final PlatformCameraPosition? arg_cameraPosition = + (args[0] as PlatformCameraPosition?); assert(arg_cameraPosition != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove was null, expected non-null PlatformCameraPosition.'); try { @@ -1689,15 +1757,18 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -1708,22 +1779,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap was null.'); final List args = (message as List?)!; final PlatformLatLng? arg_position = (args[0] as PlatformLatLng?); assert(arg_position != null, @@ -1733,22 +1807,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress was null.'); final List args = (message as List?)!; final PlatformLatLng? arg_position = (args[0] as PlatformLatLng?); assert(arg_position != null, @@ -1758,22 +1835,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap was null.'); final List args = (message as List?)!; final String? arg_markerId = (args[0] as String?); assert(arg_markerId != null, @@ -1783,22 +1863,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart was null.'); final List args = (message as List?)!; final String? arg_markerId = (args[0] as String?); assert(arg_markerId != null, @@ -1811,22 +1894,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag was null.'); final List args = (message as List?)!; final String? arg_markerId = (args[0] as String?); assert(arg_markerId != null, @@ -1839,22 +1925,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd was null.'); final List args = (message as List?)!; final String? arg_markerId = (args[0] as String?); assert(arg_markerId != null, @@ -1867,22 +1956,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap was null.'); final List args = (message as List?)!; final String? arg_markerId = (args[0] as String?); assert(arg_markerId != null, @@ -1892,22 +1984,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap was null.'); final List args = (message as List?)!; final String? arg_circleId = (args[0] as String?); assert(arg_circleId != null, @@ -1917,22 +2012,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap was null.'); final List args = (message as List?)!; final PlatformCluster? arg_cluster = (args[0] as PlatformCluster?); assert(arg_cluster != null, @@ -1942,22 +2040,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap was null.'); final List args = (message as List?)!; final String? arg_polygonId = (args[0] as String?); assert(arg_polygonId != null, @@ -1967,22 +2068,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap was null.'); final List args = (message as List?)!; final String? arg_polylineId = (args[0] as String?); assert(arg_polylineId != null, @@ -1992,22 +2096,25 @@ abstract class MapsCallbackApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile was null.'); + 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile was null.'); final List args = (message as List?)!; final String? arg_tileOverlayId = (args[0] as String?); assert(arg_tileOverlayId != null, @@ -2019,12 +2126,14 @@ abstract class MapsCallbackApi { assert(arg_zoom != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile was null, expected non-null int.'); try { - final PlatformTile output = await api.getTileOverlayTile(arg_tileOverlayId!, arg_location!, arg_zoom!); + final PlatformTile output = await api.getTileOverlayTile( + arg_tileOverlayId!, arg_location!, arg_zoom!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -2037,9 +2146,11 @@ class MapsInitializerApi { /// Constructor for [MapsInitializerApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MapsInitializerApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MapsInitializerApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -2052,9 +2163,12 @@ class MapsInitializerApi { /// /// Calling this more than once in the lifetime of an application will result /// in an error. - Future initializeWithPreferredRenderer(PlatformRendererType? type) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future initializeWithPreferredRenderer( + PlatformRendererType? type) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2087,9 +2201,11 @@ class MapsPlatformViewApi { /// Constructor for [MapsPlatformViewApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MapsPlatformViewApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MapsPlatformViewApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -2097,8 +2213,10 @@ class MapsPlatformViewApi { final String __pigeon_messageChannelSuffix; Future createView(PlatformMapViewCreationParams? type) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2124,9 +2242,11 @@ class MapsInspectorApi { /// Constructor for [MapsInspectorApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MapsInspectorApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MapsInspectorApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -2134,8 +2254,10 @@ class MapsInspectorApi { final String __pigeon_messageChannelSuffix; Future areBuildingsEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2161,8 +2283,10 @@ class MapsInspectorApi { } Future areRotateGesturesEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2188,8 +2312,10 @@ class MapsInspectorApi { } Future areZoomControlsEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2215,8 +2341,10 @@ class MapsInspectorApi { } Future areScrollGesturesEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2242,8 +2370,10 @@ class MapsInspectorApi { } Future areTiltGesturesEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2269,8 +2399,10 @@ class MapsInspectorApi { } Future areZoomGesturesEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2296,8 +2428,10 @@ class MapsInspectorApi { } Future isCompassEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2323,8 +2457,10 @@ class MapsInspectorApi { } Future isLiteModeEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2345,8 +2481,10 @@ class MapsInspectorApi { } Future isMapToolbarEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2372,8 +2510,10 @@ class MapsInspectorApi { } Future isMyLocationButtonEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2399,8 +2539,10 @@ class MapsInspectorApi { } Future isTrafficEnabled() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2426,8 +2568,10 @@ class MapsInspectorApi { } Future getTileOverlayInfo(String tileOverlayId) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2448,8 +2592,10 @@ class MapsInspectorApi { } Future getZoomRange() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2475,14 +2621,16 @@ class MapsInspectorApi { } Future> getClusters(String clusterManagerId) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([clusterManagerId]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([clusterManagerId]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2497,7 +2645,8 @@ class MapsInspectorApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (__pigeon_replyList[0] as List?)! + .cast(); } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart index d325048bf1f..95a06148a3b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart @@ -408,8 +408,7 @@ void main() { object2new.draggable, object2new.flat, object2new.icon.toJson(), - ] - ); + ]); final PlatformInfoWindow? window = encoded?[6] as PlatformInfoWindow?; expect(window?.title, object2new.infoWindow.title); expect(window?.snippet, object2new.infoWindow.snippet); @@ -439,8 +438,7 @@ void main() { object3.draggable, object3.flat, object3.icon.toJson(), - ] - ); + ]); final PlatformInfoWindow? window = encoded?[6] as PlatformInfoWindow?; expect(window?.title, object3.infoWindow.title); expect(window?.snippet, object3.infoWindow.snippet); From e0209d30553cf5c3331dbbd916e1e4b5efa7d86e Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 9 Aug 2024 08:57:37 -0400 Subject: [PATCH 23/35] Remove TODOs --- .../lib/src/google_maps_flutter_android.dart | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart index b0c3d0c9852..b7051ca679e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart @@ -696,9 +696,6 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { } static PlatformCircle _platformCircleFromCircle(Circle circle) { - // This cast is not ideal, but the Java code already assumes this format. - // See the TODOs at the top of this file and on the 'json' field in - // messages.dart. return PlatformCircle( consumeTapEvents: circle.consumeTapEvents, fillColor: circle.fillColor.value, @@ -731,9 +728,6 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { } static PlatformMarker _platformMarkerFromMarker(Marker marker) { - // This cast is not ideal, but the Java code already assumes this format. - // See the TODOs at the top of this file and on the 'json' field in - // messages.dart. return PlatformMarker( alpha: marker.alpha, anchor: _platformOffsetFromOffset(marker.anchor), From 782173043c22dcf8dee0471d3caf74e629e2a94c Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 9 Aug 2024 13:12:31 -0400 Subject: [PATCH 24/35] Remove json paths --- .../plugins/googlemaps/CirclesController.java | 25 ----------- .../flutter/plugins/googlemaps/Convert.java | 41 ------------------- .../plugins/googlemaps/MarkersController.java | 22 ---------- 3 files changed, 88 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java index c1f8562565e..bd746cdcb2c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java @@ -67,16 +67,6 @@ boolean onCircleTap(String googleCircleId) { return false; } - private void addJsonCircle(Map circle) { - if (circle == null) { - return; - } - CircleBuilder circleBuilder = new CircleBuilder(density); - String circleId = Convert.interpretCircleOptions(circle, circleBuilder); - CircleOptions options = circleBuilder.build(); - addCircle(circleId, options, circleBuilder.consumeTapEvents()); - } - void addCircle(Messages.PlatformCircle circle) { CircleBuilder circleBuilder = new CircleBuilder(density); String circleId = Convert.interpretCircleOptions(circle, circleBuilder); @@ -91,17 +81,6 @@ private void addCircle(String circleId, CircleOptions circleOptions, boolean con googleMapsCircleIdToDartCircleId.put(circle.getId(), circleId); } - private void changeJsonCircle(Map circle) { - if (circle == null) { - return; - } - String circleId = getCircleId(circle); - CircleController circleController = circleIdToController.get(circleId); - if (circleController != null) { - Convert.interpretCircleOptions(circle, circleController); - } - } - private void changeCircle(Messages.PlatformCircle circle) { if (circle == null) { return; @@ -112,8 +91,4 @@ private void changeCircle(Messages.PlatformCircle circle) { Convert.interpretCircleOptions(circle, circleController); } } - - private static String getCircleId(Map circle) { - return (String) circle.get("circleId"); - } } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index 13c50a43a41..d16f239b3fd 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -868,47 +868,6 @@ static String interpretCircleOptions(Messages.PlatformCircle circle, CircleOptio return circle.getCircleId(); } - static String interpretCircleOptions(Map data, CircleOptionsSink sink) { - final Object consumeTapEvents = data.get("consumeTapEvents"); - if (consumeTapEvents != null) { - sink.setConsumeTapEvents(toBoolean(consumeTapEvents)); - } - final Object fillColor = data.get("fillColor"); - if (fillColor != null) { - sink.setFillColor(toInt(fillColor)); - } - final Object strokeColor = data.get("strokeColor"); - if (strokeColor != null) { - sink.setStrokeColor(toInt(strokeColor)); - } - final Object visible = data.get("visible"); - if (visible != null) { - sink.setVisible(toBoolean(visible)); - } - final Object strokeWidth = data.get("strokeWidth"); - if (strokeWidth != null) { - sink.setStrokeWidth(toInt(strokeWidth)); - } - final Object zIndex = data.get("zIndex"); - if (zIndex != null) { - sink.setZIndex(toFloat(zIndex)); - } - final Object center = data.get("center"); - if (center != null) { - sink.setCenter(toLatLng(center)); - } - final Object radius = data.get("radius"); - if (radius != null) { - sink.setRadius(toDouble(radius)); - } - final String circleId = (String) data.get("circleId"); - if (circleId == null) { - throw new IllegalArgumentException("circleId was null"); - } else { - return circleId; - } - } - /** * Set the options in the given heatmap object to the given sink. * diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java index c4b109a7633..87842f69b65 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java @@ -169,20 +169,6 @@ public void onClusterItemRendered(MarkerBuilder markerBuilder, Marker marker) { } } - private void addJsonMarker(Map marker) { - if (marker == null) { - return; - } - String markerId = getMarkerId(marker); - if (markerId == null) { - throw new IllegalArgumentException("markerId was null"); - } - String clusterManagerId = getClusterManagerId(marker); - MarkerBuilder markerBuilder = new MarkerBuilder(markerId, clusterManagerId); - Convert.interpretMarkerOptions(marker, markerBuilder, assetManager, density); - addMarker(markerBuilder); - } - private void addMarker(Messages.PlatformMarker marker) { if (marker == null) { return; @@ -257,12 +243,4 @@ private void changeMarker(Messages.PlatformMarker marker) { Convert.interpretMarkerOptions(marker, markerController, assetManager, density); } } - - private static String getMarkerId(Map marker) { - return (String) marker.get("markerId"); - } - - private static String getClusterManagerId(Map marker) { - return (String) marker.get("clusterManagerId"); - } } From 03b9e182586286e21d2e652b0113382336fe7d2a Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 9 Aug 2024 13:19:10 -0400 Subject: [PATCH 25/35] Remove json path in test --- .../flutter/plugins/googlemaps/Convert.java | 67 +------------------ .../ClusterManagersControllerTest.java | 22 ++++-- 2 files changed, 19 insertions(+), 70 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index d16f239b3fd..5a8508ef3d3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -659,6 +659,7 @@ static void interpretMapConfiguration( } } + /** Set the options in the given object to marker options sink. */ static void interpretMarkerOptions( Messages.PlatformMarker marker, MarkerOptionsSink sink, @@ -678,57 +679,6 @@ static void interpretMarkerOptions( sink.setZIndex(marker.getZIndex().floatValue()); } - /** Set the options in the given object to marker options sink. */ - static void interpretMarkerOptions( - Map data, MarkerOptionsSink sink, AssetManager assetManager, float density) { - final Object alpha = data.get("alpha"); - if (alpha != null) { - sink.setAlpha(toFloat(alpha)); - } - final Object anchor = data.get("anchor"); - if (anchor != null) { - final List anchorData = toList(anchor); - sink.setAnchor(toFloat(anchorData.get(0)), toFloat(anchorData.get(1))); - } - final Object consumeTapEvents = data.get("consumeTapEvents"); - if (consumeTapEvents != null) { - sink.setConsumeTapEvents(toBoolean(consumeTapEvents)); - } - final Object draggable = data.get("draggable"); - if (draggable != null) { - sink.setDraggable(toBoolean(draggable)); - } - final Object flat = data.get("flat"); - if (flat != null) { - sink.setFlat(toBoolean(flat)); - } - final Object icon = data.get("icon"); - if (icon != null) { - sink.setIcon(toBitmapDescriptor(icon, assetManager, density)); - } - - final Object infoWindow = data.get("infoWindow"); - if (infoWindow != null) { - interpretInfoWindowOptions(sink, toObjectMap(infoWindow)); - } - final Object position = data.get("position"); - if (position != null) { - sink.setPosition(toLatLng(position)); - } - final Object rotation = data.get("rotation"); - if (rotation != null) { - sink.setRotation(toFloat(rotation)); - } - final Object visible = data.get("visible"); - if (visible != null) { - sink.setVisible(toBoolean(visible)); - } - final Object zIndex = data.get("zIndex"); - if (zIndex != null) { - sink.setZIndex(toFloat(zIndex)); - } - } - private static void interpretInfoWindowOptions( MarkerOptionsSink sink, Messages.PlatformInfoWindow infoWindow) { String title = infoWindow.getTitle(); @@ -742,21 +692,6 @@ private static void interpretInfoWindowOptions( infoWindowAnchor.getDx().floatValue(), infoWindowAnchor.getDy().floatValue()); } - private static void interpretInfoWindowOptions( - MarkerOptionsSink sink, Map infoWindow) { - String title = (String) infoWindow.get("title"); - String snippet = (String) infoWindow.get("snippet"); - // snippet is nullable. - if (title != null) { - sink.setInfoWindowText(title, snippet); - } - Object infoWindowAnchor = infoWindow.get("anchor"); - if (infoWindowAnchor != null) { - final List anchorData = toList(infoWindowAnchor); - sink.setInfoWindowAnchor(toFloat(anchorData.get(0)), toFloat(anchorData.get(1))); - } - } - static String interpretPolygonOptions(Map data, PolygonOptionsSink sink) { final Object consumeTapEvents = data.get("consumeTapEvents"); if (consumeTapEvents != null) { diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java index cee54cb685b..145da01e372 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java @@ -90,9 +90,9 @@ public void AddClusterManagersAndMarkers() { MarkerBuilder markerBuilder1 = new MarkerBuilder(markerId1, clusterManagerId); MarkerBuilder markerBuilder2 = new MarkerBuilder(markerId2, clusterManagerId); - final Map markerData1 = + final Messages.PlatformMarker markerData1 = createMarkerData(markerId1, location1, clusterManagerId); - final Map markerData2 = + final Messages.PlatformMarker markerData2 = createMarkerData(markerId2, location2, clusterManagerId); Convert.interpretMarkerOptions(markerData1, markerBuilder1, assetManager, density); @@ -161,12 +161,26 @@ public void RemoveClusterManagers() { () -> controller.getClustersWithClusterManagerId(clusterManagerId)); } - private Map createMarkerData( + private Messages.PlatformMarker createMarkerData( String markerId, List location, String clusterManagerId) { Map markerData = new HashMap<>(); markerData.put("markerId", markerId); markerData.put("position", location); markerData.put("clusterManagerId", clusterManagerId); - return markerData; + return new Messages.PlatformMarker.Builder() + .setMarkerId(markerId) + .setConsumeTapEvents(false) + .setIcon(Collections.singletonList("null")) + .setAlpha(1.0) + .setDraggable(false) + .setFlat(false) + .setVisible(true) + .setRotation(0.0) + .setZIndex(0.0) + .setPosition(new Messages.PlatformLatLng.Builder().setLatitude(location.get(0)).setLongitude(location.get(1)).build()) + .setClusterManagerId(clusterManagerId) + .setAnchor(new Messages.PlatformOffset()) + .setInfoWindow(new Messages.PlatformInfoWindow()) + .build(); } } From 786dab49448e15d7e9640a7ed2a15d79d2c8e06f Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 9 Aug 2024 14:25:27 -0400 Subject: [PATCH 26/35] Java feedback --- .../plugins/googlemaps/CirclesController.java | 7 ++----- .../plugins/googlemaps/MarkersController.java | 5 +---- .../ClusterManagersControllerTest.java | 12 +++--------- .../googlemaps/MarkersControllerTest.java | 16 ++++++++-------- 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java index bd746cdcb2c..d768b7da857 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java @@ -67,7 +67,7 @@ boolean onCircleTap(String googleCircleId) { return false; } - void addCircle(Messages.PlatformCircle circle) { + void addCircle(@NonNull Messages.PlatformCircle circle) { CircleBuilder circleBuilder = new CircleBuilder(density); String circleId = Convert.interpretCircleOptions(circle, circleBuilder); CircleOptions options = circleBuilder.build(); @@ -81,10 +81,7 @@ private void addCircle(String circleId, CircleOptions circleOptions, boolean con googleMapsCircleIdToDartCircleId.put(circle.getId(), circleId); } - private void changeCircle(Messages.PlatformCircle circle) { - if (circle == null) { - return; - } + private void changeCircle(@NonNull Messages.PlatformCircle circle) { String circleId = circle.getCircleId(); CircleController circleController = circleIdToController.get(circleId); if (circleController != null) { diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java index 87842f69b65..f6ef044de71 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java @@ -212,10 +212,7 @@ private void createControllerForMarker(String markerId, Marker marker, boolean c googleMapsMarkerIdToDartMarkerId.put(marker.getId(), markerId); } - private void changeMarker(Messages.PlatformMarker marker) { - if (marker == null) { - return; - } + private void changeMarker(@NonNull Messages.PlatformMarker marker) { String markerId = marker.getMarkerId(); MarkerBuilder markerBuilder = markerIdToMarkerBuilder.get(markerId); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java index 145da01e372..a2db89c24fb 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java @@ -27,10 +27,8 @@ import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; import org.junit.Before; import org.junit.Test; @@ -91,9 +89,9 @@ public void AddClusterManagersAndMarkers() { MarkerBuilder markerBuilder2 = new MarkerBuilder(markerId2, clusterManagerId); final Messages.PlatformMarker markerData1 = - createMarkerData(markerId1, location1, clusterManagerId); + createPlatformMarker(markerId1, location1, clusterManagerId); final Messages.PlatformMarker markerData2 = - createMarkerData(markerId2, location2, clusterManagerId); + createPlatformMarker(markerId2, location2, clusterManagerId); Convert.interpretMarkerOptions(markerData1, markerBuilder1, assetManager, density); Convert.interpretMarkerOptions(markerData2, markerBuilder2, assetManager, density); @@ -161,12 +159,8 @@ public void RemoveClusterManagers() { () -> controller.getClustersWithClusterManagerId(clusterManagerId)); } - private Messages.PlatformMarker createMarkerData( + private Messages.PlatformMarker createPlatformMarker( String markerId, List location, String clusterManagerId) { - Map markerData = new HashMap<>(); - markerData.put("markerId", markerId); - markerData.put("position", location); - markerData.put("clusterManagerId", clusterManagerId); return new Messages.PlatformMarker.Builder() .setMarkerId(markerId) .setConsumeTapEvents(false) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index 6f016f21933..d0f5134c145 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -46,7 +46,7 @@ public class MarkersControllerTest { private AssetManager assetManager; private final float density = 1; - private static Messages.PlatformMarker.Builder defaultBuilder() { + private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { Messages.PlatformOffset anchor = new Messages.PlatformOffset.Builder().setDx(0.5).setDy(0.0).build(); Messages.PlatformInfoWindow infoWindow = @@ -93,7 +93,7 @@ public void controller_OnMarkerDragStart() { final LatLng latLng = new LatLng(1.1, 2.2); final List markers = - Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); + Collections.singletonList(defaultMarkerBuilder().setMarkerId(googleMarkerId).build()); controller.addMarkers(markers); controller.onMarkerDragStart(googleMarkerId, latLng); @@ -113,7 +113,7 @@ public void controller_OnMarkerDragEnd() { final LatLng latLng = new LatLng(1.1, 2.2); final List markers = - Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); + Collections.singletonList(defaultMarkerBuilder().setMarkerId(googleMarkerId).build()); controller.addMarkers(markers); controller.onMarkerDragEnd(googleMarkerId, latLng); @@ -133,7 +133,7 @@ public void controller_OnMarkerDrag() { final LatLng latLng = new LatLng(1.1, 2.2); final List markers = - Collections.singletonList(defaultBuilder().setMarkerId(googleMarkerId).build()); + Collections.singletonList(defaultMarkerBuilder().setMarkerId(googleMarkerId).build()); controller.addMarkers(markers); controller.onMarkerDrag(googleMarkerId, latLng); @@ -145,7 +145,7 @@ public void controller_OnMarkerDrag() { @Test(expected = IllegalStateException.class) public void controller_AddMarkerThrowsErrorIfMarkerIdIsNull() { final List markers = - Collections.singletonList(defaultBuilder().build()); + Collections.singletonList(defaultMarkerBuilder().build()); try { controller.addMarkers(markers); } catch (IllegalStateException e) { @@ -161,7 +161,7 @@ public void controller_AddChangeAndRemoveMarkerWithClusterManagerId() { final String googleMarkerId = "abc123"; final String clusterManagerId = "cm123"; - final Messages.PlatformMarker.Builder builder = defaultBuilder(); + final Messages.PlatformMarker.Builder builder = defaultMarkerBuilder(); builder .setMarkerId(googleMarkerId) .setClusterManagerId(clusterManagerId) @@ -184,7 +184,7 @@ public void controller_AddChangeAndRemoveMarkerWithClusterManagerId() { final LatLng latLng2 = new LatLng(3.3, 4.4); builder.setPosition( - new Messages.PlatformLatLng.Builder().setLatitude(3.3).setLongitude(4.4).build()); + new Messages.PlatformLatLng.Builder().setLatitude(latLng2.latitude).setLongitude(latLng2.longitude).build()); final List updatedMarkers = Collections.singletonList(builder.build()); controller.changeMarkers(updatedMarkers); @@ -211,7 +211,7 @@ public void controller_AddChangeAndRemoveMarkerWithoutClusterManagerId() { when(marker.getId()).thenReturn(googleMarkerId); when(googleMap.addMarker(any(MarkerOptions.class))).thenReturn(marker); - final Messages.PlatformMarker.Builder builder = defaultBuilder(); + final Messages.PlatformMarker.Builder builder = defaultMarkerBuilder(); builder.setMarkerId(googleMarkerId); controller.addMarkers(Collections.singletonList(builder.build())); From e7e96e304293d74bdf95d24a1f34be736f48ade2 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 9 Aug 2024 14:54:12 -0400 Subject: [PATCH 27/35] Preparing for mocking --- .../io/flutter/plugins/googlemaps/Convert.java | 16 ++++++++++------ .../plugins/googlemaps/GoogleMapController.java | 2 +- .../plugins/googlemaps/MarkersController.java | 17 ++++++++++------- .../googlemaps/MarkersControllerTest.java | 15 ++++++++++++++- 4 files changed, 35 insertions(+), 15 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index 5a8508ef3d3..cbfb6ba76ce 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -60,8 +60,12 @@ class Convert { public static final String HEATMAP_GRADIENT_START_POINTS_KEY = "startPoints"; public static final String HEATMAP_GRADIENT_COLOR_MAP_SIZE_KEY = "colorMapSize"; + private static BitmapDescriptor toBitmapDescriptor(Object o, AssetManager assetManager, float density) { + return toBitmapDescriptor(o, assetManager, density, new BitmapDescriptorFactoryWrapper()); + } + private static BitmapDescriptor toBitmapDescriptor( - Object o, AssetManager assetManager, float density) { + Object o, AssetManager assetManager, float density, BitmapDescriptorFactoryWrapper wrapper) { final List data = toList(o); final String descriptorType = toString(data.get(0)); switch (descriptorType) { @@ -104,14 +108,14 @@ private static BitmapDescriptor toBitmapDescriptor( assetData, assetManager, density, - new BitmapDescriptorFactoryWrapper(), + wrapper, new FlutterInjectorWrapper()); case "bytes": if (!(data.get(1) instanceof Map)) { throw new IllegalArgumentException("'bytes' expected a map as the second parameter"); } final Map byteData = toMap(data.get(1)); - return getBitmapFromBytes(byteData, density, new BitmapDescriptorFactoryWrapper()); + return getBitmapFromBytes(byteData, density, wrapper); case "null": return null; default: @@ -664,14 +668,15 @@ static void interpretMarkerOptions( Messages.PlatformMarker marker, MarkerOptionsSink sink, AssetManager assetManager, - float density) { + float density, + BitmapDescriptorFactoryWrapper wrapper) { sink.setAlpha(marker.getAlpha().floatValue()); sink.setAnchor( marker.getAnchor().getDx().floatValue(), marker.getAnchor().getDy().floatValue()); sink.setConsumeTapEvents(marker.getConsumeTapEvents()); sink.setDraggable(marker.getDraggable()); sink.setFlat(marker.getFlat()); - sink.setIcon(toBitmapDescriptor(marker.getIcon(), assetManager, density)); + sink.setIcon(toBitmapDescriptor(marker.getIcon(), assetManager, density, wrapper)); interpretInfoWindowOptions(sink, marker.getInfoWindow()); sink.setPosition(toLatLng(marker.getPosition().toList())); sink.setRotation(marker.getRotation().floatValue()); @@ -1009,7 +1014,6 @@ static Tile tileFromPigeon(Messages.PlatformTile tile) { return new Tile(tile.getWidth().intValue(), tile.getHeight().intValue(), tile.getData()); } - @VisibleForTesting static class BitmapDescriptorFactoryWrapper { /** * Creates a BitmapDescriptor from the provided asset key using the {@link diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java index 9327669e927..33f6492c8c8 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java @@ -126,7 +126,7 @@ class GoogleMapController this.lifecycleProvider = lifecycleProvider; this.clusterManagersController = new ClusterManagersController(flutterApi, context); this.markersController = - new MarkersController(flutterApi, clusterManagersController, assetManager, density); + new MarkersController(flutterApi, clusterManagersController, assetManager, density, new Convert.BitmapDescriptorFactoryWrapper()); this.polygonsController = new PolygonsController(flutterApi, density); this.polylinesController = new PolylinesController(flutterApi, assetManager, density); this.circlesController = new CirclesController(flutterApi, density); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java index f6ef044de71..96e022b03e3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java @@ -25,12 +25,14 @@ class MarkersController { private final ClusterManagersController clusterManagersController; private final AssetManager assetManager; private final float density; + private final Convert.BitmapDescriptorFactoryWrapper bitmapDescriptorFactoryWrapper; MarkersController( - @NonNull MapsCallbackApi flutterApi, - ClusterManagersController clusterManagersController, - AssetManager assetManager, - float density) { + @NonNull MapsCallbackApi flutterApi, + ClusterManagersController clusterManagersController, + AssetManager assetManager, + float density, + Convert.BitmapDescriptorFactoryWrapper bitmapDescriptorFactoryWrapper) { this.markerIdToMarkerBuilder = new HashMap<>(); this.markerIdToController = new HashMap<>(); this.googleMapsMarkerIdToDartMarkerId = new HashMap<>(); @@ -38,6 +40,7 @@ class MarkersController { this.clusterManagersController = clusterManagersController; this.assetManager = assetManager; this.density = density; + this.bitmapDescriptorFactoryWrapper = bitmapDescriptorFactoryWrapper; } void setCollection(MarkerManager.Collection markerCollection) { @@ -176,7 +179,7 @@ private void addMarker(Messages.PlatformMarker marker) { String markerId = marker.getMarkerId(); String clusterManagerId = marker.getClusterManagerId(); MarkerBuilder markerBuilder = new MarkerBuilder(markerId, clusterManagerId); - Convert.interpretMarkerOptions(marker, markerBuilder, assetManager, density); + Convert.interpretMarkerOptions(marker, markerBuilder, assetManager, density, bitmapDescriptorFactoryWrapper); addMarker(markerBuilder); } @@ -232,12 +235,12 @@ private void changeMarker(@NonNull Messages.PlatformMarker marker) { } // Update marker builder. - Convert.interpretMarkerOptions(marker, markerBuilder, assetManager, density); + Convert.interpretMarkerOptions(marker, markerBuilder, assetManager, density, bitmapDescriptorFactoryWrapper); // Update existing marker on map. MarkerController markerController = markerIdToController.get(markerId); if (markerController != null) { - Convert.interpretMarkerOptions(marker, markerController, assetManager, density); + Convert.interpretMarkerOptions(marker, markerController, assetManager, density, bitmapDescriptorFactoryWrapper); } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index d0f5134c145..50377faeb90 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -25,11 +25,15 @@ import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; import java.util.Collections; import java.util.List; + +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.Mock; import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; @@ -45,6 +49,9 @@ public class MarkersControllerTest { private MarkerManager.Collection markerCollection; private AssetManager assetManager; private final float density = 1; + private AutoCloseable mocksClosable; + + @Mock private final Convert.BitmapDescriptorFactoryWrapper bitmapDescriptorFactoryWrapper; private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { Messages.PlatformOffset anchor = @@ -68,12 +75,13 @@ private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { @Before public void setUp() { + mocksClosable = MockitoAnnotations.openMocks(this); assetManager = ApplicationProvider.getApplicationContext().getAssets(); context = ApplicationProvider.getApplicationContext(); flutterApi = spy(new MapsCallbackApi(mock(BinaryMessenger.class))); clusterManagersController = spy(new ClusterManagersController(flutterApi, context)); controller = - new MarkersController(flutterApi, clusterManagersController, assetManager, density); + new MarkersController(flutterApi, clusterManagersController, assetManager, density, bitmapDescriptorFactoryWrapper); googleMap = mock(GoogleMap.class); markerManager = new MarkerManager(googleMap); markerCollection = markerManager.newCollection(); @@ -81,6 +89,11 @@ public void setUp() { clusterManagersController.init(googleMap, markerManager); } + @After + public void close() { + mocksClosable.close(); + } + @Test public void controller_OnMarkerDragStart() { final Marker marker = mock(Marker.class); From 6a4605068ee1f4347786c857316b61c2649c6d5b Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 9 Aug 2024 15:40:43 -0400 Subject: [PATCH 28/35] Dummy bitmap --- .../ClusterManagersControllerTest.java | 16 +++++++++++++++- .../googlemaps/MarkersControllerTest.java | 18 ++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java index a2db89c24fb..c91412bb286 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java @@ -15,6 +15,7 @@ import android.content.Context; import android.content.res.AssetManager; +import android.graphics.Bitmap; import android.os.Build; import androidx.test.core.app.ApplicationProvider; import com.google.android.gms.maps.GoogleMap; @@ -25,10 +26,15 @@ import com.google.maps.android.collections.MarkerManager; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; + +import java.io.ByteArrayOutputStream; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import org.junit.Before; import org.junit.Test; @@ -161,10 +167,18 @@ public void RemoveClusterManagers() { private Messages.PlatformMarker createPlatformMarker( String markerId, List location, String clusterManagerId) { + Bitmap fakeBitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + fakeBitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); + byte[] byteArray = byteArrayOutputStream.toByteArray(); + Map byteData = new HashMap<>(); + byteData.put("byteData", byteArray); + byteData.put("bitmapScaling", "none"); + byteData.put("imagePixelRatio", ""); return new Messages.PlatformMarker.Builder() .setMarkerId(markerId) .setConsumeTapEvents(false) - .setIcon(Collections.singletonList("null")) + .setIcon(Arrays.asList("bytes", byteData)) .setAlpha(1.0) .setDraggable(false) .setFlat(false) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index 50377faeb90..02fce95acf5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -14,6 +14,7 @@ import android.content.Context; import android.content.res.AssetManager; +import android.graphics.Bitmap; import android.os.Build; import androidx.test.core.app.ApplicationProvider; import com.google.android.gms.maps.GoogleMap; @@ -23,10 +24,15 @@ import com.google.maps.android.collections.MarkerManager; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.List; - import org.junit.After; +import java.util.Map; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -54,6 +60,14 @@ public class MarkersControllerTest { @Mock private final Convert.BitmapDescriptorFactoryWrapper bitmapDescriptorFactoryWrapper; private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { + Bitmap fakeBitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + fakeBitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); + byte[] byteArray = byteArrayOutputStream.toByteArray(); + Map byteData = new HashMap<>(); + byteData.put("byteData", byteArray); + byteData.put("bitmapScaling", "none"); + byteData.put("imagePixelRatio", ""); Messages.PlatformOffset anchor = new Messages.PlatformOffset.Builder().setDx(0.5).setDy(0.0).build(); Messages.PlatformInfoWindow infoWindow = @@ -69,7 +83,7 @@ private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { .setRotation(0.0) .setZIndex(0.0) .setConsumeTapEvents(false) - .setIcon(Collections.singletonList("null")) + .setIcon(Arrays.asList("bytes", byteData)) .setInfoWindow(infoWindow); } From 40e465107d56a765319870bac90bd53625ea4b2a Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 9 Aug 2024 16:14:57 -0400 Subject: [PATCH 29/35] Supply anchor --- .../plugins/googlemaps/ClusterManagersControllerTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java index c91412bb286..71d665a8010 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java @@ -175,6 +175,7 @@ private Messages.PlatformMarker createPlatformMarker( byteData.put("byteData", byteArray); byteData.put("bitmapScaling", "none"); byteData.put("imagePixelRatio", ""); + Messages.PlatformOffset anchor = new Messages.PlatformOffset.Builder().setDx(0.0).setDy(0.0).build(); return new Messages.PlatformMarker.Builder() .setMarkerId(markerId) .setConsumeTapEvents(false) @@ -187,8 +188,8 @@ private Messages.PlatformMarker createPlatformMarker( .setZIndex(0.0) .setPosition(new Messages.PlatformLatLng.Builder().setLatitude(location.get(0)).setLongitude(location.get(1)).build()) .setClusterManagerId(clusterManagerId) - .setAnchor(new Messages.PlatformOffset()) - .setInfoWindow(new Messages.PlatformInfoWindow()) + .setAnchor(anchor) + .setInfoWindow(new Messages.PlatformInfoWindow.Builder().setAnchor(anchor).build()) .build(); } } From 04452e3f53ffaa913aca67602dbfdda6304b6bd3 Mon Sep 17 00:00:00 2001 From: yaakovschectman <109111084+yaakovschectman@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:15:52 -0400 Subject: [PATCH 30/35] Update packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java Co-authored-by: Reid Baker --- .../src/main/java/io/flutter/plugins/googlemaps/Convert.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index cbfb6ba76ce..f11dc81aec8 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -687,10 +687,8 @@ static void interpretMarkerOptions( private static void interpretInfoWindowOptions( MarkerOptionsSink sink, Messages.PlatformInfoWindow infoWindow) { String title = infoWindow.getTitle(); - String snippet = infoWindow.getSnippet(); - // snippet is nullable. if (title != null) { - sink.setInfoWindowText(title, snippet); + sink.setInfoWindowText(title, infoWindow.getSnippet()); } Messages.PlatformOffset infoWindowAnchor = infoWindow.getAnchor(); sink.setInfoWindowAnchor( From 39a0369b870e3b3f75cf18f72f5d709d909a9735 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 9 Aug 2024 16:26:33 -0400 Subject: [PATCH 31/35] Mock BitmapDescriptorFactoryWrapper --- .../flutter/plugins/googlemaps/Convert.java | 2 -- .../ClusterManagersControllerTest.java | 19 +++++++++++++++++-- .../googlemaps/MarkersControllerTest.java | 5 ++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index f11dc81aec8..0ebec610241 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -116,8 +116,6 @@ private static BitmapDescriptor toBitmapDescriptor( } final Map byteData = toMap(data.get(1)); return getBitmapFromBytes(byteData, density, wrapper); - case "null": - return null; default: throw new IllegalArgumentException("Cannot interpret " + o + " as BitmapDescriptor"); } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java index 71d665a8010..e491441b0bc 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java @@ -36,11 +36,15 @@ import java.util.List; import java.util.Map; import java.util.Set; + +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentMatchers; +import org.mockito.Mock; import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; @@ -55,8 +59,14 @@ public class ClusterManagersControllerTest { private AssetManager assetManager; private final float density = 1; + @Mock + Convert.BitmapDescriptorFactoryWrapper bitmapFactory; + + private AutoCloseable mocksClosable; + @Before public void setUp() { + mocksClosable = MockitoAnnotations.openMocks(this); context = ApplicationProvider.getApplicationContext(); assetManager = context.getAssets(); flutterApi = spy(new MapsCallbackApi(mock(BinaryMessenger.class))); @@ -66,6 +76,11 @@ public void setUp() { controller.init(googleMap, markerManager); } + @After + public void close() throws Exception { + mocksClosable.close(); + } + @Test public void AddClusterManagersAndMarkers() { final String clusterManagerId = "cm_1"; @@ -99,8 +114,8 @@ public void AddClusterManagersAndMarkers() { final Messages.PlatformMarker markerData2 = createPlatformMarker(markerId2, location2, clusterManagerId); - Convert.interpretMarkerOptions(markerData1, markerBuilder1, assetManager, density); - Convert.interpretMarkerOptions(markerData2, markerBuilder2, assetManager, density); + Convert.interpretMarkerOptions(markerData1, markerBuilder1, assetManager, density, bitmapFactory); + Convert.interpretMarkerOptions(markerData2, markerBuilder2, assetManager, density, bitmapFactory); controller.addItem(markerBuilder1); controller.addItem(markerBuilder2); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index 02fce95acf5..9aa7969e077 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -25,7 +25,6 @@ import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.Arrays; import java.util.Collections; @@ -57,7 +56,7 @@ public class MarkersControllerTest { private final float density = 1; private AutoCloseable mocksClosable; - @Mock private final Convert.BitmapDescriptorFactoryWrapper bitmapDescriptorFactoryWrapper; + @Mock private Convert.BitmapDescriptorFactoryWrapper bitmapDescriptorFactoryWrapper; private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { Bitmap fakeBitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); @@ -104,7 +103,7 @@ public void setUp() { } @After - public void close() { + public void close() throws Exception { mocksClosable.close(); } From a4425a55c31038206096786ace34c79257ad4e5b Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 9 Aug 2024 17:21:55 -0400 Subject: [PATCH 32/35] Formatting --- .../flutter/plugins/googlemaps/Convert.java | 9 ++-- .../googlemaps/GoogleMapController.java | 7 ++- .../plugins/googlemaps/MarkersController.java | 20 ++++---- .../ClusterManagersControllerTest.java | 46 ++++++++++--------- .../googlemaps/MarkersControllerTest.java | 15 ++++-- 5 files changed, 56 insertions(+), 41 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index 0ebec610241..91c039e2537 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -60,7 +60,8 @@ class Convert { public static final String HEATMAP_GRADIENT_START_POINTS_KEY = "startPoints"; public static final String HEATMAP_GRADIENT_COLOR_MAP_SIZE_KEY = "colorMapSize"; - private static BitmapDescriptor toBitmapDescriptor(Object o, AssetManager assetManager, float density) { + private static BitmapDescriptor toBitmapDescriptor( + Object o, AssetManager assetManager, float density) { return toBitmapDescriptor(o, assetManager, density, new BitmapDescriptorFactoryWrapper()); } @@ -105,11 +106,7 @@ private static BitmapDescriptor toBitmapDescriptor( } final Map assetData = toMap(data.get(1)); return getBitmapFromAsset( - assetData, - assetManager, - density, - wrapper, - new FlutterInjectorWrapper()); + assetData, assetManager, density, wrapper, new FlutterInjectorWrapper()); case "bytes": if (!(data.get(1) instanceof Map)) { throw new IllegalArgumentException("'bytes' expected a map as the second parameter"); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java index 33f6492c8c8..56120671786 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java @@ -126,7 +126,12 @@ class GoogleMapController this.lifecycleProvider = lifecycleProvider; this.clusterManagersController = new ClusterManagersController(flutterApi, context); this.markersController = - new MarkersController(flutterApi, clusterManagersController, assetManager, density, new Convert.BitmapDescriptorFactoryWrapper()); + new MarkersController( + flutterApi, + clusterManagersController, + assetManager, + density, + new Convert.BitmapDescriptorFactoryWrapper()); this.polygonsController = new PolygonsController(flutterApi, density); this.polylinesController = new PolylinesController(flutterApi, assetManager, density); this.circlesController = new CirclesController(flutterApi, density); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java index 96e022b03e3..c040b5a8cae 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java @@ -13,7 +13,6 @@ import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; class MarkersController { @@ -28,11 +27,11 @@ class MarkersController { private final Convert.BitmapDescriptorFactoryWrapper bitmapDescriptorFactoryWrapper; MarkersController( - @NonNull MapsCallbackApi flutterApi, - ClusterManagersController clusterManagersController, - AssetManager assetManager, - float density, - Convert.BitmapDescriptorFactoryWrapper bitmapDescriptorFactoryWrapper) { + @NonNull MapsCallbackApi flutterApi, + ClusterManagersController clusterManagersController, + AssetManager assetManager, + float density, + Convert.BitmapDescriptorFactoryWrapper bitmapDescriptorFactoryWrapper) { this.markerIdToMarkerBuilder = new HashMap<>(); this.markerIdToController = new HashMap<>(); this.googleMapsMarkerIdToDartMarkerId = new HashMap<>(); @@ -179,7 +178,8 @@ private void addMarker(Messages.PlatformMarker marker) { String markerId = marker.getMarkerId(); String clusterManagerId = marker.getClusterManagerId(); MarkerBuilder markerBuilder = new MarkerBuilder(markerId, clusterManagerId); - Convert.interpretMarkerOptions(marker, markerBuilder, assetManager, density, bitmapDescriptorFactoryWrapper); + Convert.interpretMarkerOptions( + marker, markerBuilder, assetManager, density, bitmapDescriptorFactoryWrapper); addMarker(markerBuilder); } @@ -235,12 +235,14 @@ private void changeMarker(@NonNull Messages.PlatformMarker marker) { } // Update marker builder. - Convert.interpretMarkerOptions(marker, markerBuilder, assetManager, density, bitmapDescriptorFactoryWrapper); + Convert.interpretMarkerOptions( + marker, markerBuilder, assetManager, density, bitmapDescriptorFactoryWrapper); // Update existing marker on map. MarkerController markerController = markerIdToController.get(markerId); if (markerController != null) { - Convert.interpretMarkerOptions(marker, markerController, assetManager, density, bitmapDescriptorFactoryWrapper); + Convert.interpretMarkerOptions( + marker, markerController, assetManager, density, bitmapDescriptorFactoryWrapper); } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java index e491441b0bc..dd41a3fbd02 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java @@ -26,7 +26,6 @@ import com.google.maps.android.collections.MarkerManager; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; - import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.Arrays; @@ -36,7 +35,6 @@ import java.util.List; import java.util.Map; import java.util.Set; - import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -59,8 +57,7 @@ public class ClusterManagersControllerTest { private AssetManager assetManager; private final float density = 1; - @Mock - Convert.BitmapDescriptorFactoryWrapper bitmapFactory; + @Mock Convert.BitmapDescriptorFactoryWrapper bitmapFactory; private AutoCloseable mocksClosable; @@ -114,8 +111,10 @@ public void AddClusterManagersAndMarkers() { final Messages.PlatformMarker markerData2 = createPlatformMarker(markerId2, location2, clusterManagerId); - Convert.interpretMarkerOptions(markerData1, markerBuilder1, assetManager, density, bitmapFactory); - Convert.interpretMarkerOptions(markerData2, markerBuilder2, assetManager, density, bitmapFactory); + Convert.interpretMarkerOptions( + markerData1, markerBuilder1, assetManager, density, bitmapFactory); + Convert.interpretMarkerOptions( + markerData2, markerBuilder2, assetManager, density, bitmapFactory); controller.addItem(markerBuilder1); controller.addItem(markerBuilder2); @@ -190,21 +189,26 @@ private Messages.PlatformMarker createPlatformMarker( byteData.put("byteData", byteArray); byteData.put("bitmapScaling", "none"); byteData.put("imagePixelRatio", ""); - Messages.PlatformOffset anchor = new Messages.PlatformOffset.Builder().setDx(0.0).setDy(0.0).build(); + Messages.PlatformOffset anchor = + new Messages.PlatformOffset.Builder().setDx(0.0).setDy(0.0).build(); return new Messages.PlatformMarker.Builder() - .setMarkerId(markerId) - .setConsumeTapEvents(false) - .setIcon(Arrays.asList("bytes", byteData)) - .setAlpha(1.0) - .setDraggable(false) - .setFlat(false) - .setVisible(true) - .setRotation(0.0) - .setZIndex(0.0) - .setPosition(new Messages.PlatformLatLng.Builder().setLatitude(location.get(0)).setLongitude(location.get(1)).build()) - .setClusterManagerId(clusterManagerId) - .setAnchor(anchor) - .setInfoWindow(new Messages.PlatformInfoWindow.Builder().setAnchor(anchor).build()) - .build(); + .setMarkerId(markerId) + .setConsumeTapEvents(false) + .setIcon(Arrays.asList("bytes", byteData)) + .setAlpha(1.0) + .setDraggable(false) + .setFlat(false) + .setVisible(true) + .setRotation(0.0) + .setZIndex(0.0) + .setPosition( + new Messages.PlatformLatLng.Builder() + .setLatitude(location.get(0)) + .setLongitude(location.get(1)) + .build()) + .setClusterManagerId(clusterManagerId) + .setAnchor(anchor) + .setInfoWindow(new Messages.PlatformInfoWindow.Builder().setAnchor(anchor).build()) + .build(); } } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index 9aa7969e077..9df0b8d523d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -24,14 +24,13 @@ import com.google.maps.android.collections.MarkerManager; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; - import java.io.ByteArrayOutputStream; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; -import org.junit.After; import java.util.Map; +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -94,7 +93,12 @@ public void setUp() { flutterApi = spy(new MapsCallbackApi(mock(BinaryMessenger.class))); clusterManagersController = spy(new ClusterManagersController(flutterApi, context)); controller = - new MarkersController(flutterApi, clusterManagersController, assetManager, density, bitmapDescriptorFactoryWrapper); + new MarkersController( + flutterApi, + clusterManagersController, + assetManager, + density, + bitmapDescriptorFactoryWrapper); googleMap = mock(GoogleMap.class); markerManager = new MarkerManager(googleMap); markerCollection = markerManager.newCollection(); @@ -210,7 +214,10 @@ public void controller_AddChangeAndRemoveMarkerWithClusterManagerId() { final LatLng latLng2 = new LatLng(3.3, 4.4); builder.setPosition( - new Messages.PlatformLatLng.Builder().setLatitude(latLng2.latitude).setLongitude(latLng2.longitude).build()); + new Messages.PlatformLatLng.Builder() + .setLatitude(latLng2.latitude) + .setLongitude(latLng2.longitude) + .build()); final List updatedMarkers = Collections.singletonList(builder.build()); controller.changeMarkers(updatedMarkers); From 2f2d85f007520bd9ccc78449e9458359185d6071 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Mon, 12 Aug 2024 16:10:54 -0400 Subject: [PATCH 33/35] NonNull --- .../io/flutter/plugins/googlemaps/MarkersController.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java index c040b5a8cae..24326fe5305 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java @@ -171,10 +171,7 @@ public void onClusterItemRendered(MarkerBuilder markerBuilder, Marker marker) { } } - private void addMarker(Messages.PlatformMarker marker) { - if (marker == null) { - return; - } + private void addMarker(@NonNull Messages.PlatformMarker marker) { String markerId = marker.getMarkerId(); String clusterManagerId = marker.getClusterManagerId(); MarkerBuilder markerBuilder = new MarkerBuilder(markerId, clusterManagerId); From aab39e81eedd9b970cd4d78a0163afadae43c4ca Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Tue, 13 Aug 2024 11:16:05 -0400 Subject: [PATCH 34/35] Comment --- .../google_maps_flutter_android/pigeons/messages.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart index a89ebc48074..56c05925074 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart @@ -141,6 +141,8 @@ class PlatformMarker { final bool consumeTapEvents; final bool draggable; final bool flat; + /// The icon as JSON data. + /// TODO(schectman): replace this with structured data. final Object icon; final PlatformInfoWindow infoWindow; final PlatformLatLng position; From 68f69b4ff53fafd19bb629c8ab769150dd94353b Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Tue, 13 Aug 2024 14:30:07 -0400 Subject: [PATCH 35/35] Format --- .../google_maps_flutter_android/pigeons/messages.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart index 56c05925074..778aa17f547 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart @@ -141,8 +141,9 @@ class PlatformMarker { final bool consumeTapEvents; final bool draggable; final bool flat; + /// The icon as JSON data. - /// TODO(schectman): replace this with structured data. + // TODO(schectman): replace this with structured data. final Object icon; final PlatformInfoWindow infoWindow; final PlatformLatLng position;