From fe89b66137a2d21824dacfc59f6b91bc1b707fcf Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 4 Oct 2024 13:59:31 -0400 Subject: [PATCH 01/15] Update PI Dep --- .../google_maps_flutter_android/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8232903259fa..cc126a212b66 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.2 + google_maps_flutter_platform_interface: ^2.9.5 stream_transform: ^2.0.0 dev_dependencies: From 5cd45fa25fbb0cf356074d4a2b269b4ee930bb0d Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 4 Oct 2024 14:27:39 -0400 Subject: [PATCH 02/15] Dart conversion --- .../flutter/plugins/googlemaps/Messages.java | 2493 +++++++++-------- .../lib/src/google_maps_flutter_android.dart | 36 +- .../lib/src/messages.g.dart | 970 ++++--- .../pigeons/messages.dart | 62 +- 4 files changed, 2015 insertions(+), 1546 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 a258aea0cfce..b6af3f690baf 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v22.3.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.0), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.googlemaps; @@ -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) @@ -126,10 +127,21 @@ public enum PlatformPatternItemType { } } + public enum PlatformMapBitmapScaling { + AUTO(0), + NONE(1); + + final int index; + + PlatformMapBitmapScaling(final int index) { + this.index = 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; @@ -189,17 +201,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 @@ -278,14 +283,16 @@ 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 { /** - * This Object shall be any of the below classes prefixed with PlatformCameraUpdate. Each such - * class represents a different type of camera update, and each holds a different set of data, - * preventing the use of a single unified class. Pigeon does not support inheritance, which - * prevents a more strict type bound. See https://github.com/flutter/flutter/issues/117819. + * This Object shall be any of the below classes prefixed with + * PlatformCameraUpdate. Each such class represents a different type of + * camera update, and each holds a different set of data, preventing the + * use of a single unified class. Pigeon does not support inheritance, which + * prevents a more strict type bound. + * See https://github.com/flutter/flutter/issues/117819. */ private @NonNull Object cameraUpdate; @@ -305,12 +312,8 @@ public void setCameraUpdate(@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 cameraUpdate.equals(that.cameraUpdate); } @@ -355,7 +358,7 @@ ArrayList toList() { /** * Pigeon equivalent of NewCameraPosition * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateNewCameraPosition { private @NonNull PlatformCameraPosition cameraPosition; @@ -376,12 +379,8 @@ public void setCameraPosition(@NonNull PlatformCameraPosition 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; } PlatformCameraUpdateNewCameraPosition that = (PlatformCameraUpdateNewCameraPosition) o; return cameraPosition.equals(that.cameraPosition); } @@ -402,8 +401,7 @@ public static final class Builder { } public @NonNull PlatformCameraUpdateNewCameraPosition build() { - PlatformCameraUpdateNewCameraPosition pigeonReturn = - new PlatformCameraUpdateNewCameraPosition(); + PlatformCameraUpdateNewCameraPosition pigeonReturn = new PlatformCameraUpdateNewCameraPosition(); pigeonReturn.setCameraPosition(cameraPosition); return pigeonReturn; } @@ -416,10 +414,8 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraUpdateNewCameraPosition fromList( - @NonNull ArrayList pigeonVar_list) { - PlatformCameraUpdateNewCameraPosition pigeonResult = - new PlatformCameraUpdateNewCameraPosition(); + static @NonNull PlatformCameraUpdateNewCameraPosition fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCameraUpdateNewCameraPosition pigeonResult = new PlatformCameraUpdateNewCameraPosition(); Object cameraPosition = pigeonVar_list.get(0); pigeonResult.setCameraPosition((PlatformCameraPosition) cameraPosition); return pigeonResult; @@ -429,7 +425,7 @@ ArrayList toList() { /** * Pigeon equivalent of NewLatLng * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateNewLatLng { private @NonNull PlatformLatLng latLng; @@ -450,12 +446,8 @@ public void setLatLng(@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; } PlatformCameraUpdateNewLatLng that = (PlatformCameraUpdateNewLatLng) o; return latLng.equals(that.latLng); } @@ -489,8 +481,7 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraUpdateNewLatLng fromList( - @NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformCameraUpdateNewLatLng fromList(@NonNull ArrayList pigeonVar_list) { PlatformCameraUpdateNewLatLng pigeonResult = new PlatformCameraUpdateNewLatLng(); Object latLng = pigeonVar_list.get(0); pigeonResult.setLatLng((PlatformLatLng) latLng); @@ -501,7 +492,7 @@ ArrayList toList() { /** * Pigeon equivalent of NewLatLngBounds * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateNewLatLngBounds { private @NonNull PlatformLatLngBounds bounds; @@ -535,12 +526,8 @@ public void setPadding(@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; } PlatformCameraUpdateNewLatLngBounds that = (PlatformCameraUpdateNewLatLngBounds) o; return bounds.equals(that.bounds) && padding.equals(that.padding); } @@ -569,8 +556,7 @@ public static final class Builder { } public @NonNull PlatformCameraUpdateNewLatLngBounds build() { - PlatformCameraUpdateNewLatLngBounds pigeonReturn = - new PlatformCameraUpdateNewLatLngBounds(); + PlatformCameraUpdateNewLatLngBounds pigeonReturn = new PlatformCameraUpdateNewLatLngBounds(); pigeonReturn.setBounds(bounds); pigeonReturn.setPadding(padding); return pigeonReturn; @@ -585,8 +571,7 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraUpdateNewLatLngBounds fromList( - @NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformCameraUpdateNewLatLngBounds fromList(@NonNull ArrayList pigeonVar_list) { PlatformCameraUpdateNewLatLngBounds pigeonResult = new PlatformCameraUpdateNewLatLngBounds(); Object bounds = pigeonVar_list.get(0); pigeonResult.setBounds((PlatformLatLngBounds) bounds); @@ -599,7 +584,7 @@ ArrayList toList() { /** * Pigeon equivalent of NewLatLngZoom * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateNewLatLngZoom { private @NonNull PlatformLatLng latLng; @@ -633,12 +618,8 @@ 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; } PlatformCameraUpdateNewLatLngZoom that = (PlatformCameraUpdateNewLatLngZoom) o; return latLng.equals(that.latLng) && zoom.equals(that.zoom); } @@ -682,8 +663,7 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraUpdateNewLatLngZoom fromList( - @NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformCameraUpdateNewLatLngZoom fromList(@NonNull ArrayList pigeonVar_list) { PlatformCameraUpdateNewLatLngZoom pigeonResult = new PlatformCameraUpdateNewLatLngZoom(); Object latLng = pigeonVar_list.get(0); pigeonResult.setLatLng((PlatformLatLng) latLng); @@ -696,7 +676,7 @@ ArrayList toList() { /** * Pigeon equivalent of ScrollBy * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateScrollBy { private @NonNull Double dx; @@ -730,12 +710,8 @@ 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; } PlatformCameraUpdateScrollBy that = (PlatformCameraUpdateScrollBy) o; return dx.equals(that.dx) && dy.equals(that.dy); } @@ -779,8 +755,7 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraUpdateScrollBy fromList( - @NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformCameraUpdateScrollBy fromList(@NonNull ArrayList pigeonVar_list) { PlatformCameraUpdateScrollBy pigeonResult = new PlatformCameraUpdateScrollBy(); Object dx = pigeonVar_list.get(0); pigeonResult.setDx((Double) dx); @@ -793,7 +768,7 @@ ArrayList toList() { /** * Pigeon equivalent of ZoomBy * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateZoomBy { private @NonNull Double amount; @@ -824,12 +799,8 @@ public void setFocus(@Nullable 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; } PlatformCameraUpdateZoomBy that = (PlatformCameraUpdateZoomBy) o; return amount.equals(that.amount) && Objects.equals(focus, that.focus); } @@ -886,7 +857,7 @@ ArrayList toList() { /** * Pigeon equivalent of ZoomIn/ZoomOut * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateZoom { private @NonNull Boolean out; @@ -907,12 +878,8 @@ public void setOut(@NonNull Boolean 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; } PlatformCameraUpdateZoom that = (PlatformCameraUpdateZoom) o; return out.equals(that.out); } @@ -957,7 +924,7 @@ ArrayList toList() { /** * Pigeon equivalent of ZoomTo * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateZoomTo { private @NonNull Double zoom; @@ -978,12 +945,8 @@ 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; } PlatformCameraUpdateZoomTo that = (PlatformCameraUpdateZoomTo) o; return zoom.equals(that.zoom); } @@ -1028,7 +991,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; @@ -1153,36 +1116,15 @@ 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 { @@ -1316,12 +1258,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; @@ -1341,12 +1284,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); } @@ -1391,7 +1330,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; @@ -1412,12 +1351,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); } @@ -1462,7 +1397,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; @@ -1496,12 +1431,8 @@ 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); } @@ -1558,7 +1489,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; @@ -1599,16 +1530,10 @@ 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 @@ -1675,7 +1600,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; @@ -1743,14 +1668,13 @@ public void setFlat(@NonNull Boolean setterArg) { this.flat = setterArg; } - /** The icon as JSON data. */ - private @NonNull Object icon; + private @NonNull PlatformBitmap icon; - public @NonNull Object getIcon() { + public @NonNull PlatformBitmap getIcon() { return icon; } - public void setIcon(@NonNull Object setterArg) { + public void setIcon(@NonNull PlatformBitmap setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"icon\" is null."); } @@ -1850,44 +1774,15 @@ 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 { @@ -1932,10 +1827,10 @@ public static final class Builder { return this; } - private @Nullable Object icon; + private @Nullable PlatformBitmap icon; @CanIgnoreReturnValue - public @NonNull Builder setIcon(@NonNull Object setterArg) { + public @NonNull Builder setIcon(@NonNull PlatformBitmap setterArg) { this.icon = setterArg; return this; } @@ -2047,7 +1942,7 @@ ArrayList toList() { Object flat = pigeonVar_list.get(4); pigeonResult.setFlat((Boolean) flat); Object icon = pigeonVar_list.get(5); - pigeonResult.setIcon(icon); + pigeonResult.setIcon((PlatformBitmap) icon); Object infoWindow = pigeonVar_list.get(6); pigeonResult.setInfoWindow((PlatformInfoWindow) infoWindow); Object position = pigeonVar_list.get(7); @@ -2069,7 +1964,7 @@ 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 { private @NonNull String polygonId; @@ -2207,38 +2102,15 @@ public void setZIndex(@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; } PlatformPolygon that = (PlatformPolygon) o; - return polygonId.equals(that.polygonId) - && consumesTapEvents.equals(that.consumesTapEvents) - && fillColor.equals(that.fillColor) - && geodesic.equals(that.geodesic) - && points.equals(that.points) - && holes.equals(that.holes) - && visible.equals(that.visible) - && strokeColor.equals(that.strokeColor) - && strokeWidth.equals(that.strokeWidth) - && zIndex.equals(that.zIndex); + return polygonId.equals(that.polygonId) && consumesTapEvents.equals(that.consumesTapEvents) && fillColor.equals(that.fillColor) && geodesic.equals(that.geodesic) && points.equals(that.points) && holes.equals(that.holes) && visible.equals(that.visible) && strokeColor.equals(that.strokeColor) && strokeWidth.equals(that.strokeWidth) && zIndex.equals(that.zIndex); } @Override public int hashCode() { - return Objects.hash( - polygonId, - consumesTapEvents, - fillColor, - geodesic, - points, - holes, - visible, - strokeColor, - strokeWidth, - zIndex); + return Objects.hash(polygonId, consumesTapEvents, fillColor, geodesic, points, holes, visible, strokeColor, strokeWidth, zIndex); } public static final class Builder { @@ -2384,7 +2256,7 @@ 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 { private @NonNull String polylineId; @@ -2480,10 +2352,7 @@ public void setPoints(@NonNull List setterArg) { this.points = setterArg; } - /** - * The start and end cap data, as JSON. These should be set only from Cap.toJson, and the native - * code must interpret it according to the internal implementation details of that method. - */ + /** The start and end cap data, as JSON. These should be set only from Cap.toJson, and the native code must interpret it according to the internal implementation details of that method. */ private @NonNull Object startCap; public @NonNull Object getStartCap() { @@ -2554,42 +2423,15 @@ public void setZIndex(@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; } PlatformPolyline that = (PlatformPolyline) o; - return polylineId.equals(that.polylineId) - && consumesTapEvents.equals(that.consumesTapEvents) - && color.equals(that.color) - && geodesic.equals(that.geodesic) - && jointType.equals(that.jointType) - && patterns.equals(that.patterns) - && points.equals(that.points) - && startCap.equals(that.startCap) - && endCap.equals(that.endCap) - && visible.equals(that.visible) - && width.equals(that.width) - && zIndex.equals(that.zIndex); + return polylineId.equals(that.polylineId) && consumesTapEvents.equals(that.consumesTapEvents) && color.equals(that.color) && geodesic.equals(that.geodesic) && jointType.equals(that.jointType) && patterns.equals(that.patterns) && points.equals(that.points) && startCap.equals(that.startCap) && endCap.equals(that.endCap) && visible.equals(that.visible) && width.equals(that.width) && zIndex.equals(that.zIndex); } @Override public int hashCode() { - return Objects.hash( - polylineId, - consumesTapEvents, - color, - geodesic, - jointType, - patterns, - points, - startCap, - endCap, - visible, - width, - zIndex); + return Objects.hash(polylineId, consumesTapEvents, color, geodesic, jointType, patterns, points, startCap, endCap, visible, width, zIndex); } public static final class Builder { @@ -2759,7 +2601,7 @@ ArrayList toList() { /** * Pigeon equivalent of the PatternItem 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 PlatformPatternItem { private @NonNull PlatformPatternItemType type; @@ -2790,12 +2632,8 @@ public void setLength(@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; } PlatformPatternItem that = (PlatformPatternItem) o; return type.equals(that.type) && Objects.equals(length, that.length); } @@ -2852,7 +2690,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; @@ -2896,16 +2734,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 @@ -2974,7 +2806,7 @@ 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 { private @NonNull String tileOverlayId; @@ -3060,19 +2892,10 @@ public void setTileSize(@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; } PlatformTileOverlay that = (PlatformTileOverlay) o; - return tileOverlayId.equals(that.tileOverlayId) - && fadeIn.equals(that.fadeIn) - && transparency.equals(that.transparency) - && zIndex.equals(that.zIndex) - && visible.equals(that.visible) - && tileSize.equals(that.tileSize); + return tileOverlayId.equals(that.tileOverlayId) && fadeIn.equals(that.fadeIn) && transparency.equals(that.transparency) && zIndex.equals(that.zIndex) && visible.equals(that.visible) && tileSize.equals(that.tileSize); } @Override @@ -3175,7 +2998,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; @@ -3235,17 +3058,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 @@ -3324,7 +3140,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; @@ -3358,12 +3174,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); } @@ -3420,7 +3232,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; @@ -3454,12 +3266,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); } @@ -3516,7 +3324,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; @@ -3576,17 +3384,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 @@ -3665,10 +3466,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; @@ -3683,12 +3484,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); } @@ -3733,7 +3530,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; @@ -3858,36 +3655,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 { @@ -3959,8 +3735,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; } @@ -3995,8 +3770,7 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformMapViewCreationParams fromList( - @NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformMapViewCreationParams fromList(@NonNull ArrayList pigeonVar_list) { PlatformMapViewCreationParams pigeonResult = new PlatformMapViewCreationParams(); Object initialCameraPosition = pigeonVar_list.get(0); pigeonResult.setInitialCameraPosition((PlatformCameraPosition) initialCameraPosition); @@ -4023,7 +3797,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; @@ -4228,58 +4002,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 { @@ -4295,8 +4026,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; } @@ -4546,7 +4276,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; @@ -4580,12 +4310,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); } @@ -4642,7 +4368,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; @@ -4702,17 +4428,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 @@ -4791,7 +4510,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; @@ -4816,12 +4535,8 @@ 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); } @@ -4875,221 +4590,974 @@ ArrayList toList() { } } - private static class PigeonCodec extends StandardMessageCodec { - public static final PigeonCodec INSTANCE = new PigeonCodec(); + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmap { + private @NonNull Object bitmap; - private PigeonCodec() {} + public @NonNull Object getBitmap() { + return bitmap; + } - @Override - protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { - switch (type) { - case (byte) 129: - { - Object value = readValue(buffer); - return value == null ? null : PlatformMapType.values()[((Long) value).intValue()]; - } - case (byte) 130: - { - Object value = readValue(buffer); - return value == null ? null : PlatformRendererType.values()[((Long) value).intValue()]; - } - case (byte) 131: - { - Object value = readValue(buffer); - return value == null ? null : PlatformJointType.values()[((Long) value).intValue()]; - } - case (byte) 132: - { - Object value = readValue(buffer); - return value == null - ? null - : PlatformPatternItemType.values()[((Long) value).intValue()]; - } - case (byte) 133: - return PlatformCameraPosition.fromList((ArrayList) readValue(buffer)); - case (byte) 134: - return PlatformCameraUpdate.fromList((ArrayList) readValue(buffer)); - case (byte) 135: - return PlatformCameraUpdateNewCameraPosition.fromList( - (ArrayList) readValue(buffer)); - case (byte) 136: - return PlatformCameraUpdateNewLatLng.fromList((ArrayList) readValue(buffer)); - case (byte) 137: - return PlatformCameraUpdateNewLatLngBounds.fromList( - (ArrayList) readValue(buffer)); - case (byte) 138: - return PlatformCameraUpdateNewLatLngZoom.fromList((ArrayList) readValue(buffer)); - case (byte) 139: - return PlatformCameraUpdateScrollBy.fromList((ArrayList) readValue(buffer)); - case (byte) 140: - return PlatformCameraUpdateZoomBy.fromList((ArrayList) readValue(buffer)); - case (byte) 141: - return PlatformCameraUpdateZoom.fromList((ArrayList) readValue(buffer)); - case (byte) 142: - return PlatformCameraUpdateZoomTo.fromList((ArrayList) readValue(buffer)); - case (byte) 143: - return PlatformCircle.fromList((ArrayList) readValue(buffer)); - case (byte) 144: - return PlatformHeatmap.fromList((ArrayList) readValue(buffer)); - case (byte) 145: - return PlatformClusterManager.fromList((ArrayList) readValue(buffer)); - case (byte) 146: - return PlatformOffset.fromList((ArrayList) readValue(buffer)); - case (byte) 147: - return PlatformInfoWindow.fromList((ArrayList) readValue(buffer)); - case (byte) 148: - return PlatformMarker.fromList((ArrayList) readValue(buffer)); - case (byte) 149: - return PlatformPolygon.fromList((ArrayList) readValue(buffer)); - case (byte) 150: - return PlatformPolyline.fromList((ArrayList) readValue(buffer)); - case (byte) 151: - return PlatformPatternItem.fromList((ArrayList) readValue(buffer)); - case (byte) 152: - return PlatformTile.fromList((ArrayList) readValue(buffer)); - case (byte) 153: - return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); - case (byte) 154: - return PlatformEdgeInsets.fromList((ArrayList) readValue(buffer)); - case (byte) 155: - return PlatformLatLng.fromList((ArrayList) readValue(buffer)); - case (byte) 156: - return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); - case (byte) 157: - return PlatformCluster.fromList((ArrayList) readValue(buffer)); - case (byte) 158: - return PlatformCameraTargetBounds.fromList((ArrayList) readValue(buffer)); - case (byte) 159: - return PlatformMapViewCreationParams.fromList((ArrayList) readValue(buffer)); - case (byte) 160: - return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); - case (byte) 161: - return PlatformPoint.fromList((ArrayList) readValue(buffer)); - case (byte) 162: - return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); - case (byte) 163: - return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); - default: - return super.readValueOfType(type, buffer); + public void setBitmap(@NonNull Object setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"bitmap\" is null."); } + this.bitmap = setterArg; } + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmap() {} + @Override - protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof PlatformMapType) { - stream.write(129); - writeValue(stream, value == null ? null : ((PlatformMapType) value).index); - } else if (value instanceof PlatformRendererType) { - stream.write(130); - writeValue(stream, value == null ? null : ((PlatformRendererType) value).index); - } else if (value instanceof PlatformJointType) { - stream.write(131); - writeValue(stream, value == null ? null : ((PlatformJointType) value).index); - } else if (value instanceof PlatformPatternItemType) { - stream.write(132); - writeValue(stream, value == null ? null : ((PlatformPatternItemType) value).index); - } else if (value instanceof PlatformCameraPosition) { - stream.write(133); - writeValue(stream, ((PlatformCameraPosition) value).toList()); - } else if (value instanceof PlatformCameraUpdate) { - stream.write(134); - writeValue(stream, ((PlatformCameraUpdate) value).toList()); - } else if (value instanceof PlatformCameraUpdateNewCameraPosition) { - stream.write(135); - writeValue(stream, ((PlatformCameraUpdateNewCameraPosition) value).toList()); - } else if (value instanceof PlatformCameraUpdateNewLatLng) { - stream.write(136); - writeValue(stream, ((PlatformCameraUpdateNewLatLng) value).toList()); - } else if (value instanceof PlatformCameraUpdateNewLatLngBounds) { - stream.write(137); - writeValue(stream, ((PlatformCameraUpdateNewLatLngBounds) value).toList()); - } else if (value instanceof PlatformCameraUpdateNewLatLngZoom) { - stream.write(138); - writeValue(stream, ((PlatformCameraUpdateNewLatLngZoom) value).toList()); - } else if (value instanceof PlatformCameraUpdateScrollBy) { - stream.write(139); - writeValue(stream, ((PlatformCameraUpdateScrollBy) value).toList()); - } else if (value instanceof PlatformCameraUpdateZoomBy) { - stream.write(140); - writeValue(stream, ((PlatformCameraUpdateZoomBy) value).toList()); - } else if (value instanceof PlatformCameraUpdateZoom) { - stream.write(141); - writeValue(stream, ((PlatformCameraUpdateZoom) value).toList()); - } else if (value instanceof PlatformCameraUpdateZoomTo) { - stream.write(142); - writeValue(stream, ((PlatformCameraUpdateZoomTo) value).toList()); - } else if (value instanceof PlatformCircle) { - stream.write(143); - writeValue(stream, ((PlatformCircle) value).toList()); - } else if (value instanceof PlatformHeatmap) { - stream.write(144); - writeValue(stream, ((PlatformHeatmap) value).toList()); - } else if (value instanceof PlatformClusterManager) { - stream.write(145); - writeValue(stream, ((PlatformClusterManager) value).toList()); - } else if (value instanceof PlatformOffset) { - stream.write(146); - writeValue(stream, ((PlatformOffset) value).toList()); - } else if (value instanceof PlatformInfoWindow) { - stream.write(147); - writeValue(stream, ((PlatformInfoWindow) value).toList()); - } else if (value instanceof PlatformMarker) { - stream.write(148); - writeValue(stream, ((PlatformMarker) value).toList()); - } else if (value instanceof PlatformPolygon) { - stream.write(149); - writeValue(stream, ((PlatformPolygon) value).toList()); - } else if (value instanceof PlatformPolyline) { - stream.write(150); - writeValue(stream, ((PlatformPolyline) value).toList()); - } else if (value instanceof PlatformPatternItem) { - stream.write(151); - writeValue(stream, ((PlatformPatternItem) value).toList()); - } else if (value instanceof PlatformTile) { - stream.write(152); - writeValue(stream, ((PlatformTile) value).toList()); - } else if (value instanceof PlatformTileOverlay) { - stream.write(153); - writeValue(stream, ((PlatformTileOverlay) value).toList()); - } else if (value instanceof PlatformEdgeInsets) { - stream.write(154); - writeValue(stream, ((PlatformEdgeInsets) value).toList()); - } else if (value instanceof PlatformLatLng) { - stream.write(155); - writeValue(stream, ((PlatformLatLng) value).toList()); - } else if (value instanceof PlatformLatLngBounds) { - stream.write(156); - writeValue(stream, ((PlatformLatLngBounds) value).toList()); - } else if (value instanceof PlatformCluster) { - stream.write(157); - writeValue(stream, ((PlatformCluster) value).toList()); - } else if (value instanceof PlatformCameraTargetBounds) { - stream.write(158); - writeValue(stream, ((PlatformCameraTargetBounds) value).toList()); - } else if (value instanceof PlatformMapViewCreationParams) { - stream.write(159); - writeValue(stream, ((PlatformMapViewCreationParams) value).toList()); - } else if (value instanceof PlatformMapConfiguration) { - stream.write(160); - writeValue(stream, ((PlatformMapConfiguration) value).toList()); - } else if (value instanceof PlatformPoint) { - stream.write(161); - writeValue(stream, ((PlatformPoint) value).toList()); - } else if (value instanceof PlatformTileLayer) { - stream.write(162); - writeValue(stream, ((PlatformTileLayer) value).toList()); - } else if (value instanceof PlatformZoomRange) { - stream.write(163); - writeValue(stream, ((PlatformZoomRange) value).toList()); - } else { - super.writeValue(stream, value); - } + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformBitmap that = (PlatformBitmap) o; + return bitmap.equals(that.bitmap); } - } - /** Asynchronous error handling return type for non-nullable API method returns. */ - public interface Result { - /** Success case callback method for handling returns. */ + @Override + public int hashCode() { + return Objects.hash(bitmap); + } + + public static final class Builder { + + private @Nullable Object bitmap; + + @CanIgnoreReturnValue + public @NonNull Builder setBitmap(@NonNull Object setterArg) { + this.bitmap = setterArg; + return this; + } + + public @NonNull PlatformBitmap build() { + PlatformBitmap pigeonReturn = new PlatformBitmap(); + pigeonReturn.setBitmap(bitmap); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(bitmap); + return toListResult; + } + + static @NonNull PlatformBitmap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmap pigeonResult = new PlatformBitmap(); + Object bitmap = pigeonVar_list.get(0); + pigeonResult.setBitmap(bitmap); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapDefaultMarker { + private @Nullable Double hue; + + public @Nullable Double getHue() { + return hue; + } + + public void setHue(@Nullable Double setterArg) { + this.hue = setterArg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformBitmapDefaultMarker that = (PlatformBitmapDefaultMarker) o; + return Objects.equals(hue, that.hue); + } + + @Override + public int hashCode() { + return Objects.hash(hue); + } + + public static final class Builder { + + private @Nullable Double hue; + + @CanIgnoreReturnValue + public @NonNull Builder setHue(@Nullable Double setterArg) { + this.hue = setterArg; + return this; + } + + public @NonNull PlatformBitmapDefaultMarker build() { + PlatformBitmapDefaultMarker pigeonReturn = new PlatformBitmapDefaultMarker(); + pigeonReturn.setHue(hue); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(hue); + return toListResult; + } + + static @NonNull PlatformBitmapDefaultMarker fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapDefaultMarker pigeonResult = new PlatformBitmapDefaultMarker(); + Object hue = pigeonVar_list.get(0); + pigeonResult.setHue((Double) hue); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapBytes { + private @NonNull byte[] byteData; + + public @NonNull byte[] getByteData() { + return byteData; + } + + public void setByteData(@NonNull byte[] setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"byteData\" is null."); + } + this.byteData = setterArg; + } + + private @Nullable PlatformOffset size; + + public @Nullable PlatformOffset getSize() { + return size; + } + + public void setSize(@Nullable PlatformOffset setterArg) { + this.size = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapBytes() {} + + @Override + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformBitmapBytes that = (PlatformBitmapBytes) o; + return Arrays.equals(byteData, that.byteData) && Objects.equals(size, that.size); + } + + @Override + public int hashCode() { + int pigeonVar_result = Objects.hash(size); + pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(byteData); + return pigeonVar_result; + } + + public static final class Builder { + + private @Nullable byte[] byteData; + + @CanIgnoreReturnValue + public @NonNull Builder setByteData(@NonNull byte[] setterArg) { + this.byteData = setterArg; + return this; + } + + private @Nullable PlatformOffset size; + + @CanIgnoreReturnValue + public @NonNull Builder setSize(@Nullable PlatformOffset setterArg) { + this.size = setterArg; + return this; + } + + public @NonNull PlatformBitmapBytes build() { + PlatformBitmapBytes pigeonReturn = new PlatformBitmapBytes(); + pigeonReturn.setByteData(byteData); + pigeonReturn.setSize(size); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(byteData); + toListResult.add(size); + return toListResult; + } + + static @NonNull PlatformBitmapBytes fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapBytes pigeonResult = new PlatformBitmapBytes(); + Object byteData = pigeonVar_list.get(0); + pigeonResult.setByteData((byte[]) byteData); + Object size = pigeonVar_list.get(1); + pigeonResult.setSize((PlatformOffset) size); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapAsset { + private @NonNull String name; + + public @NonNull String getName() { + return name; + } + + public void setName(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"name\" is null."); + } + this.name = setterArg; + } + + private @Nullable String package; + + public @Nullable String getPackage() { + return package; + } + + public void setPackage(@Nullable String setterArg) { + this.package = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapAsset() {} + + @Override + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformBitmapAsset that = (PlatformBitmapAsset) o; + return name.equals(that.name) && Objects.equals(package, that.package); + } + + @Override + public int hashCode() { + return Objects.hash(name, package); + } + + public static final class Builder { + + private @Nullable String name; + + @CanIgnoreReturnValue + public @NonNull Builder setName(@NonNull String setterArg) { + this.name = setterArg; + return this; + } + + private @Nullable String package; + + @CanIgnoreReturnValue + public @NonNull Builder setPackage(@Nullable String setterArg) { + this.package = setterArg; + return this; + } + + public @NonNull PlatformBitmapAsset build() { + PlatformBitmapAsset pigeonReturn = new PlatformBitmapAsset(); + pigeonReturn.setName(name); + pigeonReturn.setPackage(package); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(name); + toListResult.add(package); + return toListResult; + } + + static @NonNull PlatformBitmapAsset fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapAsset pigeonResult = new PlatformBitmapAsset(); + Object name = pigeonVar_list.get(0); + pigeonResult.setName((String) name); + Object package = pigeonVar_list.get(1); + pigeonResult.setPackage((String) package); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapAssetImage { + private @NonNull String name; + + public @NonNull String getName() { + return name; + } + + public void setName(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"name\" is null."); + } + this.name = setterArg; + } + + private @NonNull Double scale; + + public @NonNull Double getScale() { + return scale; + } + + public void setScale(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"scale\" is null."); + } + this.scale = setterArg; + } + + private @Nullable PlatformOffset size; + + public @Nullable PlatformOffset getSize() { + return size; + } + + public void setSize(@Nullable PlatformOffset setterArg) { + this.size = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapAssetImage() {} + + @Override + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformBitmapAssetImage that = (PlatformBitmapAssetImage) o; + return name.equals(that.name) && scale.equals(that.scale) && Objects.equals(size, that.size); + } + + @Override + public int hashCode() { + return Objects.hash(name, scale, size); + } + + public static final class Builder { + + private @Nullable String name; + + @CanIgnoreReturnValue + public @NonNull Builder setName(@NonNull String setterArg) { + this.name = setterArg; + return this; + } + + private @Nullable Double scale; + + @CanIgnoreReturnValue + public @NonNull Builder setScale(@NonNull Double setterArg) { + this.scale = setterArg; + return this; + } + + private @Nullable PlatformOffset size; + + @CanIgnoreReturnValue + public @NonNull Builder setSize(@Nullable PlatformOffset setterArg) { + this.size = setterArg; + return this; + } + + public @NonNull PlatformBitmapAssetImage build() { + PlatformBitmapAssetImage pigeonReturn = new PlatformBitmapAssetImage(); + pigeonReturn.setName(name); + pigeonReturn.setScale(scale); + pigeonReturn.setSize(size); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(3); + toListResult.add(name); + toListResult.add(scale); + toListResult.add(size); + return toListResult; + } + + static @NonNull PlatformBitmapAssetImage fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapAssetImage pigeonResult = new PlatformBitmapAssetImage(); + Object name = pigeonVar_list.get(0); + pigeonResult.setName((String) name); + Object scale = pigeonVar_list.get(1); + pigeonResult.setScale((Double) scale); + Object size = pigeonVar_list.get(2); + pigeonResult.setSize((PlatformOffset) size); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapAssetMap { + private @NonNull String assetName; + + public @NonNull String getAssetName() { + return assetName; + } + + public void setAssetName(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"assetName\" is null."); + } + this.assetName = setterArg; + } + + private @NonNull PlatformMapBitmapScaling bitmapScaling; + + public @NonNull PlatformMapBitmapScaling getBitmapScaling() { + return bitmapScaling; + } + + public void setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"bitmapScaling\" is null."); + } + this.bitmapScaling = setterArg; + } + + private @NonNull Double imagePixelRatio; + + public @NonNull Double getImagePixelRatio() { + return imagePixelRatio; + } + + public void setImagePixelRatio(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"imagePixelRatio\" is null."); + } + this.imagePixelRatio = setterArg; + } + + private @Nullable Double width; + + public @Nullable Double getWidth() { + return width; + } + + public void setWidth(@Nullable Double setterArg) { + this.width = setterArg; + } + + private @Nullable Double height; + + public @Nullable Double getHeight() { + return height; + } + + public void setHeight(@Nullable Double setterArg) { + this.height = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapAssetMap() {} + + @Override + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformBitmapAssetMap that = (PlatformBitmapAssetMap) o; + return assetName.equals(that.assetName) && bitmapScaling.equals(that.bitmapScaling) && imagePixelRatio.equals(that.imagePixelRatio) && Objects.equals(width, that.width) && Objects.equals(height, that.height); + } + + @Override + public int hashCode() { + return Objects.hash(assetName, bitmapScaling, imagePixelRatio, width, height); + } + + public static final class Builder { + + private @Nullable String assetName; + + @CanIgnoreReturnValue + public @NonNull Builder setAssetName(@NonNull String setterArg) { + this.assetName = setterArg; + return this; + } + + private @Nullable PlatformMapBitmapScaling bitmapScaling; + + @CanIgnoreReturnValue + public @NonNull Builder setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + this.bitmapScaling = setterArg; + return this; + } + + private @Nullable Double imagePixelRatio; + + @CanIgnoreReturnValue + public @NonNull Builder setImagePixelRatio(@NonNull Double setterArg) { + this.imagePixelRatio = setterArg; + return this; + } + + private @Nullable Double width; + + @CanIgnoreReturnValue + public @NonNull Builder setWidth(@Nullable Double setterArg) { + this.width = setterArg; + return this; + } + + private @Nullable Double height; + + @CanIgnoreReturnValue + public @NonNull Builder setHeight(@Nullable Double setterArg) { + this.height = setterArg; + return this; + } + + public @NonNull PlatformBitmapAssetMap build() { + PlatformBitmapAssetMap pigeonReturn = new PlatformBitmapAssetMap(); + pigeonReturn.setAssetName(assetName); + pigeonReturn.setBitmapScaling(bitmapScaling); + pigeonReturn.setImagePixelRatio(imagePixelRatio); + pigeonReturn.setWidth(width); + pigeonReturn.setHeight(height); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(5); + toListResult.add(assetName); + toListResult.add(bitmapScaling); + toListResult.add(imagePixelRatio); + toListResult.add(width); + toListResult.add(height); + return toListResult; + } + + static @NonNull PlatformBitmapAssetMap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapAssetMap pigeonResult = new PlatformBitmapAssetMap(); + Object assetName = pigeonVar_list.get(0); + pigeonResult.setAssetName((String) assetName); + Object bitmapScaling = pigeonVar_list.get(1); + pigeonResult.setBitmapScaling((PlatformMapBitmapScaling) bitmapScaling); + Object imagePixelRatio = pigeonVar_list.get(2); + pigeonResult.setImagePixelRatio((Double) imagePixelRatio); + Object width = pigeonVar_list.get(3); + pigeonResult.setWidth((Double) width); + Object height = pigeonVar_list.get(4); + pigeonResult.setHeight((Double) height); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapBytesMap { + private @NonNull byte[] byteData; + + public @NonNull byte[] getByteData() { + return byteData; + } + + public void setByteData(@NonNull byte[] setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"byteData\" is null."); + } + this.byteData = setterArg; + } + + private @NonNull PlatformMapBitmapScaling bitmapScaling; + + public @NonNull PlatformMapBitmapScaling getBitmapScaling() { + return bitmapScaling; + } + + public void setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"bitmapScaling\" is null."); + } + this.bitmapScaling = setterArg; + } + + private @NonNull Double imagePixelRatio; + + public @NonNull Double getImagePixelRatio() { + return imagePixelRatio; + } + + public void setImagePixelRatio(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"imagePixelRatio\" is null."); + } + this.imagePixelRatio = setterArg; + } + + private @Nullable Double width; + + public @Nullable Double getWidth() { + return width; + } + + public void setWidth(@Nullable Double setterArg) { + this.width = setterArg; + } + + private @Nullable Double height; + + public @Nullable Double getHeight() { + return height; + } + + public void setHeight(@Nullable Double setterArg) { + this.height = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapBytesMap() {} + + @Override + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformBitmapBytesMap that = (PlatformBitmapBytesMap) o; + return Arrays.equals(byteData, that.byteData) && bitmapScaling.equals(that.bitmapScaling) && imagePixelRatio.equals(that.imagePixelRatio) && Objects.equals(width, that.width) && Objects.equals(height, that.height); + } + + @Override + public int hashCode() { + int pigeonVar_result = Objects.hash(bitmapScaling, imagePixelRatio, width, height); + pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(byteData); + return pigeonVar_result; + } + + public static final class Builder { + + private @Nullable byte[] byteData; + + @CanIgnoreReturnValue + public @NonNull Builder setByteData(@NonNull byte[] setterArg) { + this.byteData = setterArg; + return this; + } + + private @Nullable PlatformMapBitmapScaling bitmapScaling; + + @CanIgnoreReturnValue + public @NonNull Builder setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + this.bitmapScaling = setterArg; + return this; + } + + private @Nullable Double imagePixelRatio; + + @CanIgnoreReturnValue + public @NonNull Builder setImagePixelRatio(@NonNull Double setterArg) { + this.imagePixelRatio = setterArg; + return this; + } + + private @Nullable Double width; + + @CanIgnoreReturnValue + public @NonNull Builder setWidth(@Nullable Double setterArg) { + this.width = setterArg; + return this; + } + + private @Nullable Double height; + + @CanIgnoreReturnValue + public @NonNull Builder setHeight(@Nullable Double setterArg) { + this.height = setterArg; + return this; + } + + public @NonNull PlatformBitmapBytesMap build() { + PlatformBitmapBytesMap pigeonReturn = new PlatformBitmapBytesMap(); + pigeonReturn.setByteData(byteData); + pigeonReturn.setBitmapScaling(bitmapScaling); + pigeonReturn.setImagePixelRatio(imagePixelRatio); + pigeonReturn.setWidth(width); + pigeonReturn.setHeight(height); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(5); + toListResult.add(byteData); + toListResult.add(bitmapScaling); + toListResult.add(imagePixelRatio); + toListResult.add(width); + toListResult.add(height); + return toListResult; + } + + static @NonNull PlatformBitmapBytesMap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapBytesMap pigeonResult = new PlatformBitmapBytesMap(); + Object byteData = pigeonVar_list.get(0); + pigeonResult.setByteData((byte[]) byteData); + Object bitmapScaling = pigeonVar_list.get(1); + pigeonResult.setBitmapScaling((PlatformMapBitmapScaling) bitmapScaling); + Object imagePixelRatio = pigeonVar_list.get(2); + pigeonResult.setImagePixelRatio((Double) imagePixelRatio); + Object width = pigeonVar_list.get(3); + pigeonResult.setWidth((Double) width); + Object height = pigeonVar_list.get(4); + pigeonResult.setHeight((Double) height); + return pigeonResult; + } + } + + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); + + private PigeonCodec() {} + + @Override + protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { + switch (type) { + case (byte) 129: { + Object value = readValue(buffer); + return value == null ? null : PlatformMapType.values()[((Long) value).intValue()]; + } + case (byte) 130: { + Object value = readValue(buffer); + return value == null ? null : PlatformRendererType.values()[((Long) value).intValue()]; + } + case (byte) 131: { + Object value = readValue(buffer); + return value == null ? null : PlatformJointType.values()[((Long) value).intValue()]; + } + case (byte) 132: { + Object value = readValue(buffer); + return value == null ? null : PlatformPatternItemType.values()[((Long) value).intValue()]; + } + case (byte) 133: { + Object value = readValue(buffer); + return value == null ? null : PlatformMapBitmapScaling.values()[((Long) value).intValue()]; + } + case (byte) 134: + return PlatformCameraPosition.fromList((ArrayList) readValue(buffer)); + case (byte) 135: + return PlatformCameraUpdate.fromList((ArrayList) readValue(buffer)); + case (byte) 136: + return PlatformCameraUpdateNewCameraPosition.fromList((ArrayList) readValue(buffer)); + case (byte) 137: + return PlatformCameraUpdateNewLatLng.fromList((ArrayList) readValue(buffer)); + case (byte) 138: + return PlatformCameraUpdateNewLatLngBounds.fromList((ArrayList) readValue(buffer)); + case (byte) 139: + return PlatformCameraUpdateNewLatLngZoom.fromList((ArrayList) readValue(buffer)); + case (byte) 140: + return PlatformCameraUpdateScrollBy.fromList((ArrayList) readValue(buffer)); + case (byte) 141: + return PlatformCameraUpdateZoomBy.fromList((ArrayList) readValue(buffer)); + case (byte) 142: + return PlatformCameraUpdateZoom.fromList((ArrayList) readValue(buffer)); + case (byte) 143: + return PlatformCameraUpdateZoomTo.fromList((ArrayList) readValue(buffer)); + case (byte) 144: + return PlatformCircle.fromList((ArrayList) readValue(buffer)); + case (byte) 145: + return PlatformHeatmap.fromList((ArrayList) readValue(buffer)); + case (byte) 146: + return PlatformClusterManager.fromList((ArrayList) readValue(buffer)); + case (byte) 147: + return PlatformOffset.fromList((ArrayList) readValue(buffer)); + case (byte) 148: + return PlatformInfoWindow.fromList((ArrayList) readValue(buffer)); + case (byte) 149: + return PlatformMarker.fromList((ArrayList) readValue(buffer)); + case (byte) 150: + return PlatformPolygon.fromList((ArrayList) readValue(buffer)); + case (byte) 151: + return PlatformPolyline.fromList((ArrayList) readValue(buffer)); + case (byte) 152: + return PlatformPatternItem.fromList((ArrayList) readValue(buffer)); + case (byte) 153: + return PlatformTile.fromList((ArrayList) readValue(buffer)); + case (byte) 154: + return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); + case (byte) 155: + return PlatformEdgeInsets.fromList((ArrayList) readValue(buffer)); + case (byte) 156: + return PlatformLatLng.fromList((ArrayList) readValue(buffer)); + case (byte) 157: + return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); + case (byte) 158: + return PlatformCluster.fromList((ArrayList) readValue(buffer)); + case (byte) 159: + return PlatformCameraTargetBounds.fromList((ArrayList) readValue(buffer)); + case (byte) 160: + return PlatformMapViewCreationParams.fromList((ArrayList) readValue(buffer)); + case (byte) 161: + return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); + case (byte) 162: + return PlatformPoint.fromList((ArrayList) readValue(buffer)); + case (byte) 163: + return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); + case (byte) 164: + return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + case (byte) 165: + return PlatformBitmap.fromList((ArrayList) readValue(buffer)); + case (byte) 166: + return PlatformBitmapDefaultMarker.fromList((ArrayList) readValue(buffer)); + case (byte) 167: + return PlatformBitmapBytes.fromList((ArrayList) readValue(buffer)); + case (byte) 168: + return PlatformBitmapAsset.fromList((ArrayList) readValue(buffer)); + case (byte) 169: + return PlatformBitmapAssetImage.fromList((ArrayList) readValue(buffer)); + case (byte) 170: + return PlatformBitmapAssetMap.fromList((ArrayList) readValue(buffer)); + case (byte) 171: + return PlatformBitmapBytesMap.fromList((ArrayList) readValue(buffer)); + default: + return super.readValueOfType(type, buffer); + } + } + + @Override + protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { + if (value instanceof PlatformMapType) { + stream.write(129); + writeValue(stream, value == null ? null : ((PlatformMapType) value).index); + } else if (value instanceof PlatformRendererType) { + stream.write(130); + writeValue(stream, value == null ? null : ((PlatformRendererType) value).index); + } else if (value instanceof PlatformJointType) { + stream.write(131); + writeValue(stream, value == null ? null : ((PlatformJointType) value).index); + } else if (value instanceof PlatformPatternItemType) { + stream.write(132); + writeValue(stream, value == null ? null : ((PlatformPatternItemType) value).index); + } else if (value instanceof PlatformMapBitmapScaling) { + stream.write(133); + writeValue(stream, value == null ? null : ((PlatformMapBitmapScaling) value).index); + } else if (value instanceof PlatformCameraPosition) { + stream.write(134); + writeValue(stream, ((PlatformCameraPosition) value).toList()); + } else if (value instanceof PlatformCameraUpdate) { + stream.write(135); + writeValue(stream, ((PlatformCameraUpdate) value).toList()); + } else if (value instanceof PlatformCameraUpdateNewCameraPosition) { + stream.write(136); + writeValue(stream, ((PlatformCameraUpdateNewCameraPosition) value).toList()); + } else if (value instanceof PlatformCameraUpdateNewLatLng) { + stream.write(137); + writeValue(stream, ((PlatformCameraUpdateNewLatLng) value).toList()); + } else if (value instanceof PlatformCameraUpdateNewLatLngBounds) { + stream.write(138); + writeValue(stream, ((PlatformCameraUpdateNewLatLngBounds) value).toList()); + } else if (value instanceof PlatformCameraUpdateNewLatLngZoom) { + stream.write(139); + writeValue(stream, ((PlatformCameraUpdateNewLatLngZoom) value).toList()); + } else if (value instanceof PlatformCameraUpdateScrollBy) { + stream.write(140); + writeValue(stream, ((PlatformCameraUpdateScrollBy) value).toList()); + } else if (value instanceof PlatformCameraUpdateZoomBy) { + stream.write(141); + writeValue(stream, ((PlatformCameraUpdateZoomBy) value).toList()); + } else if (value instanceof PlatformCameraUpdateZoom) { + stream.write(142); + writeValue(stream, ((PlatformCameraUpdateZoom) value).toList()); + } else if (value instanceof PlatformCameraUpdateZoomTo) { + stream.write(143); + writeValue(stream, ((PlatformCameraUpdateZoomTo) value).toList()); + } else if (value instanceof PlatformCircle) { + stream.write(144); + writeValue(stream, ((PlatformCircle) value).toList()); + } else if (value instanceof PlatformHeatmap) { + stream.write(145); + writeValue(stream, ((PlatformHeatmap) value).toList()); + } else if (value instanceof PlatformClusterManager) { + stream.write(146); + writeValue(stream, ((PlatformClusterManager) value).toList()); + } else if (value instanceof PlatformOffset) { + stream.write(147); + writeValue(stream, ((PlatformOffset) value).toList()); + } else if (value instanceof PlatformInfoWindow) { + stream.write(148); + writeValue(stream, ((PlatformInfoWindow) value).toList()); + } else if (value instanceof PlatformMarker) { + stream.write(149); + writeValue(stream, ((PlatformMarker) value).toList()); + } else if (value instanceof PlatformPolygon) { + stream.write(150); + writeValue(stream, ((PlatformPolygon) value).toList()); + } else if (value instanceof PlatformPolyline) { + stream.write(151); + writeValue(stream, ((PlatformPolyline) value).toList()); + } else if (value instanceof PlatformPatternItem) { + stream.write(152); + writeValue(stream, ((PlatformPatternItem) value).toList()); + } else if (value instanceof PlatformTile) { + stream.write(153); + writeValue(stream, ((PlatformTile) value).toList()); + } else if (value instanceof PlatformTileOverlay) { + stream.write(154); + writeValue(stream, ((PlatformTileOverlay) value).toList()); + } else if (value instanceof PlatformEdgeInsets) { + stream.write(155); + writeValue(stream, ((PlatformEdgeInsets) value).toList()); + } else if (value instanceof PlatformLatLng) { + stream.write(156); + writeValue(stream, ((PlatformLatLng) value).toList()); + } else if (value instanceof PlatformLatLngBounds) { + stream.write(157); + writeValue(stream, ((PlatformLatLngBounds) value).toList()); + } else if (value instanceof PlatformCluster) { + stream.write(158); + writeValue(stream, ((PlatformCluster) value).toList()); + } else if (value instanceof PlatformCameraTargetBounds) { + stream.write(159); + writeValue(stream, ((PlatformCameraTargetBounds) value).toList()); + } else if (value instanceof PlatformMapViewCreationParams) { + stream.write(160); + writeValue(stream, ((PlatformMapViewCreationParams) value).toList()); + } else if (value instanceof PlatformMapConfiguration) { + stream.write(161); + writeValue(stream, ((PlatformMapConfiguration) value).toList()); + } else if (value instanceof PlatformPoint) { + stream.write(162); + writeValue(stream, ((PlatformPoint) value).toList()); + } else if (value instanceof PlatformTileLayer) { + stream.write(163); + writeValue(stream, ((PlatformTileLayer) value).toList()); + } else if (value instanceof PlatformZoomRange) { + stream.write(164); + writeValue(stream, ((PlatformZoomRange) value).toList()); + } else if (value instanceof PlatformBitmap) { + stream.write(165); + writeValue(stream, ((PlatformBitmap) value).toList()); + } else if (value instanceof PlatformBitmapDefaultMarker) { + stream.write(166); + writeValue(stream, ((PlatformBitmapDefaultMarker) value).toList()); + } else if (value instanceof PlatformBitmapBytes) { + stream.write(167); + writeValue(stream, ((PlatformBitmapBytes) value).toList()); + } else if (value instanceof PlatformBitmapAsset) { + stream.write(168); + writeValue(stream, ((PlatformBitmapAsset) value).toList()); + } else if (value instanceof PlatformBitmapAssetImage) { + stream.write(169); + writeValue(stream, ((PlatformBitmapAssetImage) value).toList()); + } else if (value instanceof PlatformBitmapAssetMap) { + stream.write(170); + writeValue(stream, ((PlatformBitmapAssetMap) value).toList()); + } else if (value instanceof PlatformBitmapBytesMap) { + stream.write(171); + writeValue(stream, ((PlatformBitmapBytesMap) value).toList()); + } else { + super.writeValue(stream, value); + } + } + } + + + /** Asynchronous error handling return type for non-nullable API method returns. */ + public interface Result { + /** Success case callback method for handling returns. */ void success(@NonNull T result); /** Failure case callback method for handling errors. */ @@ -5114,9 +5582,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. */ @@ -5124,82 +5592,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); @@ -5210,23 +5666,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) -> { @@ -5253,10 +5702,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) -> { @@ -5266,7 +5712,8 @@ public void error(Throwable error) { try { api.updateMapConfiguration(configurationArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5278,10 +5725,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) -> { @@ -5293,7 +5737,8 @@ public void error(Throwable error) { try { api.updateCircles(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5305,10 +5750,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) -> { @@ -5320,7 +5762,8 @@ public void error(Throwable error) { try { api.updateHeatmaps(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5332,10 +5775,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) -> { @@ -5346,7 +5786,8 @@ public void error(Throwable error) { try { api.updateClusterManagers(toAddArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5358,10 +5799,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) -> { @@ -5373,7 +5811,8 @@ public void error(Throwable error) { try { api.updateMarkers(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5385,10 +5824,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) -> { @@ -5400,7 +5836,8 @@ public void error(Throwable error) { try { api.updatePolygons(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5412,10 +5849,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) -> { @@ -5427,7 +5861,8 @@ public void error(Throwable error) { try { api.updatePolylines(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5439,10 +5874,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) -> { @@ -5454,7 +5886,8 @@ public void error(Throwable error) { try { api.updateTileOverlays(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5466,10 +5899,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) -> { @@ -5479,7 +5909,8 @@ public void error(Throwable error) { try { PlatformPoint output = api.getScreenCoordinate(latLngArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5491,10 +5922,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) -> { @@ -5504,7 +5932,8 @@ public void error(Throwable error) { try { PlatformLatLng output = api.getLatLng(screenCoordinateArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5516,10 +5945,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) -> { @@ -5527,7 +5953,8 @@ public void error(Throwable error) { try { PlatformLatLngBounds output = api.getVisibleRegion(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5539,10 +5966,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) -> { @@ -5552,7 +5976,8 @@ public void error(Throwable error) { try { api.moveCamera(cameraUpdateArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5564,10 +5989,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) -> { @@ -5577,7 +5999,8 @@ public void error(Throwable error) { try { api.animateCamera(cameraUpdateArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5589,10 +6012,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) -> { @@ -5600,7 +6020,8 @@ public void error(Throwable error) { try { Double output = api.getZoomLevel(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5612,10 +6033,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) -> { @@ -5625,7 +6043,8 @@ public void error(Throwable error) { try { api.showInfoWindow(markerIdArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5637,10 +6056,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) -> { @@ -5650,7 +6066,8 @@ public void error(Throwable error) { try { api.hideInfoWindow(markerIdArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5662,10 +6079,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) -> { @@ -5675,7 +6089,8 @@ public void error(Throwable error) { try { Boolean output = api.isInfoWindowShown(markerIdArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5687,10 +6102,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) -> { @@ -5700,7 +6112,8 @@ public void error(Throwable error) { try { Boolean output = api.setStyle(styleArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5712,10 +6125,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) -> { @@ -5723,7 +6133,8 @@ public void error(Throwable error) { try { Boolean output = api.didLastStyleSucceed(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5735,10 +6146,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) -> { @@ -5748,7 +6156,8 @@ public void error(Throwable error) { try { api.clearTileCache(tileOverlayIdArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5760,10 +6169,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) -> { @@ -5797,439 +6203,368 @@ 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. The codec used by MapsCallbackApi. */ + /** + * 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), 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) -> { @@ -6258,10 +6593,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 { @@ -6271,26 +6607,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) -> { @@ -6300,7 +6626,8 @@ static void setUp( try { api.createView(typeArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6314,75 +6641,66 @@ static void setUp( /** * 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) -> { @@ -6390,7 +6708,8 @@ static void setUp( try { Boolean output = api.areBuildingsEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6402,10 +6721,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) -> { @@ -6413,7 +6729,8 @@ static void setUp( try { Boolean output = api.areRotateGesturesEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6425,10 +6742,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) -> { @@ -6436,7 +6750,8 @@ static void setUp( try { Boolean output = api.areZoomControlsEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6448,10 +6763,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) -> { @@ -6459,7 +6771,8 @@ static void setUp( try { Boolean output = api.areScrollGesturesEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6471,10 +6784,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) -> { @@ -6482,7 +6792,8 @@ static void setUp( try { Boolean output = api.areTiltGesturesEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6494,10 +6805,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) -> { @@ -6505,7 +6813,8 @@ static void setUp( try { Boolean output = api.areZoomGesturesEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6517,10 +6826,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) -> { @@ -6528,7 +6834,8 @@ static void setUp( try { Boolean output = api.isCompassEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6540,10 +6847,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) -> { @@ -6551,7 +6855,8 @@ static void setUp( try { Boolean output = api.isLiteModeEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6563,10 +6868,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) -> { @@ -6574,7 +6876,8 @@ static void setUp( try { Boolean output = api.isMapToolbarEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6586,10 +6889,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) -> { @@ -6597,7 +6897,8 @@ static void setUp( try { Boolean output = api.isMyLocationButtonEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6609,10 +6910,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) -> { @@ -6620,7 +6918,8 @@ static void setUp( try { Boolean output = api.isTrafficEnabled(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6632,10 +6931,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) -> { @@ -6645,7 +6941,8 @@ static void setUp( try { PlatformTileLayer output = api.getTileOverlayInfo(tileOverlayIdArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6657,10 +6954,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) -> { @@ -6668,7 +6962,8 @@ static void setUp( try { PlatformZoomRange output = api.getZoomRange(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6680,10 +6975,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) -> { @@ -6693,7 +6985,8 @@ static void setUp( try { List output = api.getClusters(clusterManagerIdArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); 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 10fb6ece7558..8b5507c704cc 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 @@ -685,6 +685,10 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { return PlatformOffset(dx: offset.dx, dy: offset.dy); } + static PlatformOffset _platformOffsetFromSize(Size size) { + return PlatformOffset(dx: size.width, dy: size.height); + } + static ScreenCoordinate _screenCoordinateFromPlatformPoint( PlatformPoint point) { return ScreenCoordinate(x: point.x, y: point.y); @@ -734,7 +738,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { consumeTapEvents: marker.consumeTapEvents, draggable: marker.draggable, flat: marker.flat, - icon: marker.icon.toJson(), + icon: platformBitmapFromBitmapDescriptor(marker.icon), infoWindow: _platformInfoWindowFromInfoWindow(marker.infoWindow), position: _platformLatLngFromLatLng(marker.position), rotation: marker.rotation, @@ -852,6 +856,36 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { PlatformCameraUpdateScrollBy(dx: update.dx, dy: update.dy)); } } + + static PlatformMapBitmapScaling platformMapBitmapScalingFromScaling(MapBitmapScaling scaling) { + switch(scaling) { + case MapBitmapScaling.auto: + return PlatformMapBitmapScaling.auto; + case MapBitmapScaling.none: + return PlatformMapBitmapScaling.none; + } + /// MapBitmapScaling is defined in the platform interface. + return PlatformMapBitmapScaling.auto; + } + + static PlatformBitmap platformBitmapFromBitmapDescriptor(BitmapDescriptor bitmap) { + switch(bitmap.runtimeType) { + case final DefaultMarker marker: + return PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble())); + case final BytesBitmap bytes: + return PlatformBitmap(bitmap: PlatformBitmapBytes(byteData: bytes.byteData, size: (bytes.size == null) ? null : _platformOffsetFromSize(bytes.size!))); + case final AssetBitmap asset: + return PlatformBitmap(bitmap: PlatformBitmapAsset(name: asset.name, package: asset.package)); + case final AssetImageBitmap asset: + return PlatformBitmap(bitmap: PlatformBitmapAssetImage(name: asset.name, scale: asset.scale, size: (asset.size == null) ? null : _platformOffsetFromSize(asset.size!))); + case final AssetMapBitmap asset: + return PlatformBitmap(bitmap: PlatformBitmapAssetMap(assetName: asset.assetName, bitmapScaling: platformMapBitmapScalingFromScaling(asset.bitmapScaling), imagePixelRatio: asset.imagePixelRatio, width: asset.width, height: asset.height)); + case final BytesMapBitmap bytes: + return PlatformBitmap(bitmap: PlatformBitmapBytesMap(byteData: bytes.byteData, bitmapScaling: platformMapBitmapScalingFromScaling(bytes.bitmapScaling), imagePixelRatio: bytes.imagePixelRatio, width: bytes.width, height: bytes.height)); + default: + throw ArgumentError('Unrecognized type of bitmap ${bitmap.runtimeType}', 'bitmap'); + } + } } /// Callback handler for map events from the platform host. 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 958e0bfdc996..ac0f4230367b 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v22.3.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.0), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -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 []; } @@ -57,6 +56,11 @@ enum PlatformPatternItemType { gap, } +enum PlatformMapBitmapScaling { + auto, + none, +} + /// Pigeon representatation of a CameraPosition. class PlatformCameraPosition { PlatformCameraPosition({ @@ -494,7 +498,7 @@ class PlatformMarker { this.consumeTapEvents = false, this.draggable = false, this.flat = false, - this.icon = const ['defaultMarker'], + required this.icon, required this.infoWindow, required this.position, this.rotation = 0.0, @@ -514,8 +518,7 @@ class PlatformMarker { bool flat; - /// The icon as JSON data. - Object icon; + PlatformBitmap icon; PlatformInfoWindow infoWindow; @@ -557,7 +560,7 @@ class PlatformMarker { consumeTapEvents: result[2]! as bool, draggable: result[3]! as bool, flat: result[4]! as bool, - icon: result[5]!, + icon: result[5]! as PlatformBitmap, infoWindow: result[6]! as PlatformInfoWindow, position: result[7]! as PlatformLatLng, rotation: result[8]! as double, @@ -1029,13 +1032,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(), ); } } @@ -1248,6 +1248,214 @@ class PlatformZoomRange { } } +class PlatformBitmap { + PlatformBitmap({ + required this.bitmap, + }); + + Object bitmap; + + Object encode() { + return [ + bitmap, + ]; + } + + static PlatformBitmap decode(Object result) { + result as List; + return PlatformBitmap( + bitmap: result[0]!, + ); + } +} + +class PlatformBitmapDefaultMarker { + PlatformBitmapDefaultMarker({ + this.hue, + }); + + double? hue; + + Object encode() { + return [ + hue, + ]; + } + + static PlatformBitmapDefaultMarker decode(Object result) { + result as List; + return PlatformBitmapDefaultMarker( + hue: result[0] as double?, + ); + } +} + +class PlatformBitmapBytes { + PlatformBitmapBytes({ + required this.byteData, + this.size, + }); + + Uint8List byteData; + + PlatformOffset? size; + + Object encode() { + return [ + byteData, + size, + ]; + } + + static PlatformBitmapBytes decode(Object result) { + result as List; + return PlatformBitmapBytes( + byteData: result[0]! as Uint8List, + size: result[1] as PlatformOffset?, + ); + } +} + +class PlatformBitmapAsset { + PlatformBitmapAsset({ + required this.name, + this.package, + }); + + String name; + + String? package; + + Object encode() { + return [ + name, + package, + ]; + } + + static PlatformBitmapAsset decode(Object result) { + result as List; + return PlatformBitmapAsset( + name: result[0]! as String, + package: result[1] as String?, + ); + } +} + +class PlatformBitmapAssetImage { + PlatformBitmapAssetImage({ + required this.name, + required this.scale, + this.size, + }); + + String name; + + double scale; + + PlatformOffset? size; + + Object encode() { + return [ + name, + scale, + size, + ]; + } + + static PlatformBitmapAssetImage decode(Object result) { + result as List; + return PlatformBitmapAssetImage( + name: result[0]! as String, + scale: result[1]! as double, + size: result[2] as PlatformOffset?, + ); + } +} + +class PlatformBitmapAssetMap { + PlatformBitmapAssetMap({ + required this.assetName, + required this.bitmapScaling, + required this.imagePixelRatio, + this.width, + this.height, + }); + + String assetName; + + PlatformMapBitmapScaling bitmapScaling; + + double imagePixelRatio; + + double? width; + + double? height; + + Object encode() { + return [ + assetName, + bitmapScaling, + imagePixelRatio, + width, + height, + ]; + } + + static PlatformBitmapAssetMap decode(Object result) { + result as List; + return PlatformBitmapAssetMap( + assetName: result[0]! as String, + bitmapScaling: result[1]! as PlatformMapBitmapScaling, + imagePixelRatio: result[2]! as double, + width: result[3] as double?, + height: result[4] as double?, + ); + } +} + +class PlatformBitmapBytesMap { + PlatformBitmapBytesMap({ + required this.byteData, + required this.bitmapScaling, + required this.imagePixelRatio, + this.width, + this.height, + }); + + Uint8List byteData; + + PlatformMapBitmapScaling bitmapScaling; + + double imagePixelRatio; + + double? width; + + double? height; + + Object encode() { + return [ + byteData, + bitmapScaling, + imagePixelRatio, + width, + height, + ]; + } + + static PlatformBitmapBytesMap decode(Object result) { + result as List; + return PlatformBitmapBytesMap( + byteData: result[0]! as Uint8List, + bitmapScaling: result[1]! as PlatformMapBitmapScaling, + imagePixelRatio: result[2]! as double, + width: result[3] as double?, + height: result[4] as double?, + ); + } +} + + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -1255,111 +1463,135 @@ class _PigeonCodec extends StandardMessageCodec { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is PlatformMapType) { + } else if (value is PlatformMapType) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is PlatformRendererType) { + } else if (value is PlatformRendererType) { buffer.putUint8(130); writeValue(buffer, value.index); - } else if (value is PlatformJointType) { + } else if (value is PlatformJointType) { buffer.putUint8(131); writeValue(buffer, value.index); - } else if (value is PlatformPatternItemType) { + } else if (value is PlatformPatternItemType) { buffer.putUint8(132); writeValue(buffer, value.index); - } else if (value is PlatformCameraPosition) { + } else if (value is PlatformMapBitmapScaling) { buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdate) { + writeValue(buffer, value.index); + } else if (value is PlatformCameraPosition) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateNewCameraPosition) { + } else if (value is PlatformCameraUpdate) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateNewLatLng) { + } else if (value is PlatformCameraUpdateNewCameraPosition) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateNewLatLngBounds) { + } else if (value is PlatformCameraUpdateNewLatLng) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateNewLatLngZoom) { + } else if (value is PlatformCameraUpdateNewLatLngBounds) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateScrollBy) { + } else if (value is PlatformCameraUpdateNewLatLngZoom) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateZoomBy) { + } else if (value is PlatformCameraUpdateScrollBy) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateZoom) { + } else if (value is PlatformCameraUpdateZoomBy) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateZoomTo) { + } else if (value is PlatformCameraUpdateZoom) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PlatformCircle) { + } else if (value is PlatformCameraUpdateZoomTo) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PlatformHeatmap) { + } else if (value is PlatformCircle) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PlatformClusterManager) { + } else if (value is PlatformHeatmap) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is PlatformOffset) { + } else if (value is PlatformClusterManager) { buffer.putUint8(146); writeValue(buffer, value.encode()); - } else if (value is PlatformInfoWindow) { + } else if (value is PlatformOffset) { buffer.putUint8(147); writeValue(buffer, value.encode()); - } else if (value is PlatformMarker) { + } else if (value is PlatformInfoWindow) { buffer.putUint8(148); writeValue(buffer, value.encode()); - } else if (value is PlatformPolygon) { + } else if (value is PlatformMarker) { buffer.putUint8(149); writeValue(buffer, value.encode()); - } else if (value is PlatformPolyline) { + } else if (value is PlatformPolygon) { buffer.putUint8(150); writeValue(buffer, value.encode()); - } else if (value is PlatformPatternItem) { + } else if (value is PlatformPolyline) { buffer.putUint8(151); writeValue(buffer, value.encode()); - } else if (value is PlatformTile) { + } else if (value is PlatformPatternItem) { buffer.putUint8(152); writeValue(buffer, value.encode()); - } else if (value is PlatformTileOverlay) { + } else if (value is PlatformTile) { buffer.putUint8(153); writeValue(buffer, value.encode()); - } else if (value is PlatformEdgeInsets) { + } else if (value is PlatformTileOverlay) { buffer.putUint8(154); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLng) { + } else if (value is PlatformEdgeInsets) { buffer.putUint8(155); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLngBounds) { + } else if (value is PlatformLatLng) { buffer.putUint8(156); writeValue(buffer, value.encode()); - } else if (value is PlatformCluster) { + } else if (value is PlatformLatLngBounds) { buffer.putUint8(157); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraTargetBounds) { + } else if (value is PlatformCluster) { buffer.putUint8(158); writeValue(buffer, value.encode()); - } else if (value is PlatformMapViewCreationParams) { + } else if (value is PlatformCameraTargetBounds) { buffer.putUint8(159); writeValue(buffer, value.encode()); - } else if (value is PlatformMapConfiguration) { + } else if (value is PlatformMapViewCreationParams) { buffer.putUint8(160); writeValue(buffer, value.encode()); - } else if (value is PlatformPoint) { + } else if (value is PlatformMapConfiguration) { buffer.putUint8(161); writeValue(buffer, value.encode()); - } else if (value is PlatformTileLayer) { + } else if (value is PlatformPoint) { buffer.putUint8(162); writeValue(buffer, value.encode()); - } else if (value is PlatformZoomRange) { + } else if (value is PlatformTileLayer) { buffer.putUint8(163); writeValue(buffer, value.encode()); + } else if (value is PlatformZoomRange) { + buffer.putUint8(164); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmap) { + buffer.putUint8(165); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapDefaultMarker) { + buffer.putUint8(166); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapBytes) { + buffer.putUint8(167); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapAsset) { + buffer.putUint8(168); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapAssetImage) { + buffer.putUint8(169); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapAssetMap) { + buffer.putUint8(170); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapBytesMap) { + buffer.putUint8(171); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -1368,80 +1600,97 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformMapType.values[value]; - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformRendererType.values[value]; - case 131: + case 131: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformJointType.values[value]; - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformPatternItemType.values[value]; - case 133: + case 133: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformMapBitmapScaling.values[value]; + case 134: return PlatformCameraPosition.decode(readValue(buffer)!); - case 134: + case 135: return PlatformCameraUpdate.decode(readValue(buffer)!); - case 135: + case 136: return PlatformCameraUpdateNewCameraPosition.decode(readValue(buffer)!); - case 136: + case 137: return PlatformCameraUpdateNewLatLng.decode(readValue(buffer)!); - case 137: + case 138: return PlatformCameraUpdateNewLatLngBounds.decode(readValue(buffer)!); - case 138: + case 139: return PlatformCameraUpdateNewLatLngZoom.decode(readValue(buffer)!); - case 139: + case 140: return PlatformCameraUpdateScrollBy.decode(readValue(buffer)!); - case 140: + case 141: return PlatformCameraUpdateZoomBy.decode(readValue(buffer)!); - case 141: + case 142: return PlatformCameraUpdateZoom.decode(readValue(buffer)!); - case 142: + case 143: return PlatformCameraUpdateZoomTo.decode(readValue(buffer)!); - case 143: + case 144: return PlatformCircle.decode(readValue(buffer)!); - case 144: + case 145: return PlatformHeatmap.decode(readValue(buffer)!); - case 145: + case 146: return PlatformClusterManager.decode(readValue(buffer)!); - case 146: + case 147: return PlatformOffset.decode(readValue(buffer)!); - case 147: + case 148: return PlatformInfoWindow.decode(readValue(buffer)!); - case 148: + case 149: return PlatformMarker.decode(readValue(buffer)!); - case 149: + case 150: return PlatformPolygon.decode(readValue(buffer)!); - case 150: + case 151: return PlatformPolyline.decode(readValue(buffer)!); - case 151: + case 152: return PlatformPatternItem.decode(readValue(buffer)!); - case 152: + case 153: return PlatformTile.decode(readValue(buffer)!); - case 153: + case 154: return PlatformTileOverlay.decode(readValue(buffer)!); - case 154: + case 155: return PlatformEdgeInsets.decode(readValue(buffer)!); - case 155: + case 156: return PlatformLatLng.decode(readValue(buffer)!); - case 156: + case 157: return PlatformLatLngBounds.decode(readValue(buffer)!); - case 157: + case 158: return PlatformCluster.decode(readValue(buffer)!); - case 158: + case 159: return PlatformCameraTargetBounds.decode(readValue(buffer)!); - case 159: + case 160: return PlatformMapViewCreationParams.decode(readValue(buffer)!); - case 160: + case 161: return PlatformMapConfiguration.decode(readValue(buffer)!); - case 161: + case 162: return PlatformPoint.decode(readValue(buffer)!); - case 162: + case 163: return PlatformTileLayer.decode(readValue(buffer)!); - case 163: + case 164: return PlatformZoomRange.decode(readValue(buffer)!); + case 165: + return PlatformBitmap.decode(readValue(buffer)!); + case 166: + return PlatformBitmapDefaultMarker.decode(readValue(buffer)!); + case 167: + return PlatformBitmapBytes.decode(readValue(buffer)!); + case 168: + return PlatformBitmapAsset.decode(readValue(buffer)!); + case 169: + return PlatformBitmapAssetImage.decode(readValue(buffer)!); + case 170: + return PlatformBitmapAssetMap.decode(readValue(buffer)!); + case 171: + return PlatformBitmapBytesMap.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -1457,8 +1706,7 @@ class MapsApi { /// BinaryMessenger will be used which routes to the host platform. MapsApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -1467,10 +1715,8 @@ class MapsApi { /// Returns once the map instance is available. Future waitForMap() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1494,18 +1740,15 @@ 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 pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + Future updateMapConfiguration(PlatformMapConfiguration configuration) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([configuration]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([configuration]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1520,18 +1763,15 @@ class MapsApi { } /// Updates the set of circles on the map. - Future updateCircles(List toAdd, - List toChange, List idsToRemove) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + Future updateCircles(List toAdd, List toChange, List idsToRemove) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1546,18 +1786,15 @@ class MapsApi { } /// Updates the set of heatmaps on the map. - Future updateHeatmaps(List toAdd, - List toChange, List idsToRemove) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + Future updateHeatmaps(List toAdd, List toChange, List idsToRemove) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1572,18 +1809,15 @@ class MapsApi { } /// Updates the set of custer managers for clusters on the map. - Future updateClusterManagers( - List toAdd, List idsToRemove) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + Future updateClusterManagers(List toAdd, List idsToRemove) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([toAdd, idsToRemove]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([toAdd, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1598,18 +1832,15 @@ class MapsApi { } /// Updates the set of markers on the map. - Future updateMarkers(List toAdd, - List toChange, List idsToRemove) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + Future updateMarkers(List toAdd, List toChange, List idsToRemove) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1624,18 +1855,15 @@ class MapsApi { } /// Updates the set of polygonss on the map. - Future updatePolygons(List toAdd, - List toChange, List idsToRemove) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + Future updatePolygons(List toAdd, List toChange, List idsToRemove) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1650,18 +1878,15 @@ class MapsApi { } /// Updates the set of polylines on the map. - Future updatePolylines(List toAdd, - List toChange, List idsToRemove) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + Future updatePolylines(List toAdd, List toChange, List idsToRemove) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1676,18 +1901,15 @@ class MapsApi { } /// Updates the set of tile overlays on the map. - Future updateTileOverlays(List toAdd, - List toChange, List idsToRemove) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + Future updateTileOverlays(List toAdd, List toChange, List idsToRemove) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1703,10 +1925,8 @@ class MapsApi { /// Gets the screen coordinate for the given map location. Future getScreenCoordinate(PlatformLatLng latLng) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1733,16 +1953,14 @@ class MapsApi { /// Gets the map location for the given screen coordinate. Future getLatLng(PlatformPoint screenCoordinate) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([screenCoordinate]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([screenCoordinate]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1763,10 +1981,8 @@ class MapsApi { /// Gets the map region currently displayed on the map. Future getVisibleRegion() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1794,10 +2010,8 @@ class MapsApi { /// Moves the camera according to [cameraUpdate] immediately, with no /// animation. Future moveCamera(PlatformCameraUpdate cameraUpdate) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1819,10 +2033,8 @@ class MapsApi { /// Moves the camera according to [cameraUpdate], animating the update. Future animateCamera(PlatformCameraUpdate cameraUpdate) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1844,10 +2056,8 @@ class MapsApi { /// Gets the current map zoom level. Future getZoomLevel() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1874,10 +2084,8 @@ class MapsApi { /// Show the info window for the marker with the given ID. Future showInfoWindow(String markerId) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1899,10 +2107,8 @@ class MapsApi { /// Hide the info window for the marker with the given ID. Future hideInfoWindow(String markerId) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1925,10 +2131,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 pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1959,10 +2163,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 pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1993,10 +2195,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 pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2023,16 +2223,14 @@ class MapsApi { /// Clears the cache of tiles previously requseted from the tile provider. Future clearTileCache(String tileOverlayId) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([tileOverlayId]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([tileOverlayId]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2048,10 +2246,8 @@ class MapsApi { /// Takes a snapshot of the map and returns its image data. Future takeSnapshot() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2123,22 +2319,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); @@ -2149,29 +2336,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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 { @@ -2179,19 +2361,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); @@ -2202,26 +2380,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2231,26 +2405,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2260,26 +2430,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2289,26 +2455,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2321,26 +2483,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2353,26 +2511,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2385,26 +2539,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2414,26 +2564,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2443,26 +2589,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2472,26 +2614,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2501,26 +2639,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2530,26 +2664,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< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2561,14 +2691,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())); } }); } @@ -2581,11 +2709,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 = ''}) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -2598,12 +2724,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 pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + Future initializeWithPreferredRenderer(PlatformRendererType? type) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2636,11 +2759,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 = ''}) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -2648,10 +2769,8 @@ class MapsPlatformViewApi { final String pigeonVar_messageChannelSuffix; Future createView(PlatformMapViewCreationParams? type) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2677,11 +2796,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 = ''}) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -2689,10 +2806,8 @@ class MapsInspectorApi { final String pigeonVar_messageChannelSuffix; Future areBuildingsEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2718,10 +2833,8 @@ class MapsInspectorApi { } Future areRotateGesturesEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2747,10 +2860,8 @@ class MapsInspectorApi { } Future areZoomControlsEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2776,10 +2887,8 @@ class MapsInspectorApi { } Future areScrollGesturesEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2805,10 +2914,8 @@ class MapsInspectorApi { } Future areTiltGesturesEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2834,10 +2941,8 @@ class MapsInspectorApi { } Future areZoomGesturesEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2863,10 +2968,8 @@ class MapsInspectorApi { } Future isCompassEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2892,10 +2995,8 @@ class MapsInspectorApi { } Future isLiteModeEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2916,10 +3017,8 @@ class MapsInspectorApi { } Future isMapToolbarEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2945,10 +3044,8 @@ class MapsInspectorApi { } Future isMyLocationButtonEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2974,10 +3071,8 @@ class MapsInspectorApi { } Future isTrafficEnabled() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -3003,16 +3098,14 @@ class MapsInspectorApi { } Future getTileOverlayInfo(String tileOverlayId) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([tileOverlayId]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([tileOverlayId]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -3027,10 +3120,8 @@ class MapsInspectorApi { } Future getZoomRange() async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -3056,16 +3147,14 @@ class MapsInspectorApi { } Future> getClusters(String clusterManagerId) async { - final String pigeonVar_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([clusterManagerId]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([clusterManagerId]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -3080,8 +3169,7 @@ class MapsInspectorApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as List?)! - .cast(); + return (pigeonVar_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 8ed6ebb061e1..e88e62dc349f 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 @@ -172,12 +172,12 @@ class PlatformInfoWindow { class PlatformMarker { PlatformMarker({ required this.markerId, + required this.icon, this.alpha = 1.0, required this.anchor, this.consumeTapEvents = false, this.draggable = false, this.flat = false, - this.icon = const ['defaultMarker'], required this.infoWindow, required this.position, this.rotation = 0.0, @@ -192,9 +192,7 @@ class PlatformMarker { final bool draggable; final bool flat; - /// The icon as JSON data. - // TODO(schectman): replace this with structured data. - final Object icon; + final PlatformBitmap icon; final PlatformInfoWindow infoWindow; final PlatformLatLng position; final double rotation; @@ -484,6 +482,62 @@ class PlatformZoomRange { final double? max; } +class PlatformBitmap { + PlatformBitmap({required this.bitmap}); + + final Object bitmap; +} + +class PlatformBitmapDefaultMarker { + PlatformBitmapDefaultMarker({this.hue}); + + final double? hue; +} + +class PlatformBitmapBytes { + PlatformBitmapBytes({required this.byteData, this.size}); + + final Uint8List byteData; + final PlatformOffset? size; +} + +class PlatformBitmapAsset { + PlatformBitmapAsset({required this.name, this.package}); + + final String name; + final String? package; +} + +class PlatformBitmapAssetImage{ + PlatformBitmapAssetImage({required this.name, required this.scale, this.size}); + final String name; + final double scale; + final PlatformOffset? size; +} + +enum PlatformMapBitmapScaling { + auto, + none, +} + +class PlatformBitmapAssetMap { + PlatformBitmapAssetMap({required this.assetName, required this.bitmapScaling, required this.imagePixelRatio, this.width, this.height}); + final String assetName; + final PlatformMapBitmapScaling bitmapScaling; + final double imagePixelRatio; + final double? width; + final double? height; +} + +class PlatformBitmapBytesMap { + PlatformBitmapBytesMap({required this.byteData, required this.bitmapScaling, required this.imagePixelRatio, this.width, this.height}); + final Uint8List byteData; + final PlatformMapBitmapScaling bitmapScaling; + final double imagePixelRatio; + final double? width; + final double? height; +} + /// Interface for non-test interactions with the native SDK. /// /// For test-only state queries, see [MapsInspectorApi]. From 0f9687759e529a74ff223f65322b5eeca2974ee7 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 4 Oct 2024 14:48:22 -0400 Subject: [PATCH 03/15] Convert.java --- .../flutter/plugins/googlemaps/Convert.java | 178 +++++++----------- 1 file changed, 63 insertions(+), 115 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 6c7c103e4bdd..1e8d867a6e9f 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 @@ -66,73 +66,62 @@ private static BitmapDescriptor toBitmapDescriptor( } private static BitmapDescriptor toBitmapDescriptor( - Object o, AssetManager assetManager, float density, BitmapDescriptorFactoryWrapper wrapper) { - final List data = toList(o); - final String descriptorType = toString(data.get(0)); - switch (descriptorType) { - case "defaultMarker": - if (data.size() == 1) { + Messages.PlatformBitmap platformBitmap, AssetManager assetManager, float density, BitmapDescriptorFactoryWrapper wrapper) { + Object bitmap = platformBitmap.getBitmap(); + if (bitmap instanceof Messages.PlatformBitmapDefaultMarker) { + Messages.PlatformBitmapDefaultMarker typedBitmap = (Messages.PlatformBitmapDefaultMarker) bitmap; + if (typedBitmap.getHue() == null) { return BitmapDescriptorFactory.defaultMarker(); } else { - final float hue = toFloat(data.get(1)); + final float hue = typedBitmap.getHue().floatValue(); return BitmapDescriptorFactory.defaultMarker(hue); } - case "fromAsset": - final String assetPath = toString(data.get(1)); - if (data.size() == 2) { - return BitmapDescriptorFactory.fromAsset( - FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetPath)); - } else { - final String assetPackage = toString(data.get(2)); - return BitmapDescriptorFactory.fromAsset( - FlutterInjector.instance() - .flutterLoader() - .getLookupKeyForAsset(assetPath, assetPackage)); } - case "fromAssetImage": - final String assetImagePath = toString(data.get(1)); - if (data.size() == 3) { - return BitmapDescriptorFactory.fromAsset( + if (bitmap instanceof Messages.PlatformBitmapAsset) { + Messages.PlatformBitmapAsset typedBitmap = (Messages.PlatformBitmapAsset) bitmap; + final String assetPath = typedBitmap.getName(); + final String assetPackage = typedBitmap.getPackage(); + if (assetPackage == null) { + return BitmapDescriptorFactory.fromAsset( + FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetPath)); + } else { + return BitmapDescriptorFactory.fromAsset( + FlutterInjector.instance() + .flutterLoader() + .getLookupKeyForAsset(assetPath, assetPackage)); + } + } + if (bitmap instanceof Messages.PlatformBitmapAssetImage) { + Messages.PlatformBitmapAssetImage typedBitmap = (Messages.PlatformBitmapAssetImage) bitmap; + final String assetImagePath = typedBitmap.getName(); + return BitmapDescriptorFactory.fromAsset( FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetImagePath)); - } else { - throw new IllegalArgumentException( - "'fromAssetImage' Expected exactly 3 arguments, got: " + data.size()); - } - case "fromBytes": - return getBitmapFromBytesLegacy(data); - case "asset": - if (!(data.get(1) instanceof Map)) { - throw new IllegalArgumentException("'asset' expected a map as the second parameter"); - } - final Map assetData = toMap(data.get(1)); - return getBitmapFromAsset( - 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"); - } - final Map byteData = toMap(data.get(1)); - return getBitmapFromBytes(byteData, density, wrapper); - default: - throw new IllegalArgumentException("Cannot interpret " + o + " as BitmapDescriptor"); } + if (bitmap instanceof Messages.PlatformBitmapBytes) { + Messages.PlatformBitmapBytes typedBitmap = (Messages.PlatformBitmapBytes) bitmap; + return getBitmapFromBytesLegacy(typedBitmap); + } + if (bitmap instanceof Messages.PlatformBitmapAssetMap) { + Messages.PlatformBitmapAssetMap typedBitmap = (Messages.PlatformBitmapAssetMap) bitmap; + return getBitmapFromAsset( + typedBitmap, assetManager, density, wrapper, new FlutterInjectorWrapper()); + } + if (bitmap instanceof Messages.PlatformBitmapBytesMap) { + Messages.PlatformBitmapBytesMap typedBitmap = (Messages.PlatformBitmapBytesMap) bitmap; + return getBitmapFromBytes(typedBitmap, density, wrapper); + } + throw new IllegalArgumentException("PlatformBitmap did not contain a supported subtype."); } // Used for deprecated fromBytes bitmap descriptor. // Can be removed after support for "fromBytes" bitmap descriptor type is // removed. - private static BitmapDescriptor getBitmapFromBytesLegacy(List data) { - if (data.size() == 2) { - try { - Bitmap bitmap = toBitmap(data.get(1)); - return BitmapDescriptorFactory.fromBitmap(bitmap); - } catch (Exception e) { - throw new IllegalArgumentException("Unable to interpret bytes as a valid image.", e); - } - } else { - throw new IllegalArgumentException( - "fromBytes should have exactly one argument, interpretTileOverlayOptions the bytes. Got: " - + data.size()); + private static BitmapDescriptor getBitmapFromBytesLegacy(Messages.PlatformBitmapBytes bitmapBytes) { + try { + Bitmap bitmap = toBitmap(bitmapBytes.getByteData()); + return BitmapDescriptorFactory.fromBitmap(bitmap); + } catch (Exception e) { + throw new IllegalArgumentException("Unable to interpret bytes as a valid image.", e); } } @@ -143,7 +132,7 @@ private static BitmapDescriptor getBitmapFromBytesLegacy(List data) { * bytes, 'bitmapScaling' for scaling mode, and 'imagePixelRatio' for scale ratio. It may * optionally include 'width' and/or 'height' for explicit image dimensions. * - * @param byteData a map containing the byte data and scaling instructions. Expected keys are: + * @param bytesMap a map containing the byte data and scaling instructions. Expected keys are: * 'byteData': the actual bytes of the image, 'bitmapScaling': the scaling mode, either 'auto' * or 'none', 'imagePixelRatio': used with 'auto' bitmapScaling if width or height are not * provided, 'width' (optional): the desired width, which affects scaling if 'height' is not @@ -157,34 +146,14 @@ private static BitmapDescriptor getBitmapFromBytesLegacy(List data) { */ @VisibleForTesting public static BitmapDescriptor getBitmapFromBytes( - Map byteData, float density, BitmapDescriptorFactoryWrapper bitmapDescriptorFactory) { - - final String byteDataKey = "byteData"; - final String bitmapScalingKey = "bitmapScaling"; - final String imagePixelRatioKey = "imagePixelRatio"; - - if (!byteData.containsKey(byteDataKey)) { - throw new IllegalArgumentException("'bytes' requires '" + byteDataKey + "' key."); - } - if (!byteData.containsKey(bitmapScalingKey)) { - throw new IllegalArgumentException("'bytes' requires '" + bitmapScalingKey + "' key."); - } - if (!byteData.containsKey(imagePixelRatioKey)) { - throw new IllegalArgumentException("'bytes' requires '" + imagePixelRatioKey + "' key."); - } - + Messages.PlatformBitmapBytesMap bytesMap, float density, BitmapDescriptorFactoryWrapper bitmapDescriptorFactory) { try { - Bitmap bitmap = toBitmap(byteData.get(byteDataKey)); - String scalingMode = toString(byteData.get(bitmapScalingKey)); + Bitmap bitmap = toBitmap(bytesMap.getByteData()); + Messages.PlatformMapBitmapScaling scalingMode = bytesMap.getBitmapScaling(); switch (scalingMode) { - case "auto": - final String widthKey = "width"; - final String heightKey = "height"; - - final Double width = - byteData.containsKey(widthKey) ? toDouble(byteData.get(widthKey)) : null; - final Double height = - byteData.containsKey(heightKey) ? toDouble(byteData.get(heightKey)) : null; + case AUTO: + final Double width = bytesMap.getWidth(); + final Double height = bytesMap.getHeight(); if (width != null || height != null) { int targetWidth = width != null ? toInt(width * density) : bitmap.getWidth(); @@ -203,10 +172,10 @@ public static BitmapDescriptor getBitmapFromBytes( toScaledBitmap(bitmap, targetWidth, targetHeight)); } else { // Scale image using given scale ratio - final float scale = density / toFloat(byteData.get(imagePixelRatioKey)); + final float scale = density / bytesMap.getImagePixelRatio().floatValue(); return bitmapDescriptorFactory.fromBitmap(toScaledBitmap(bitmap, scale)); } - case "none": + case NONE: break; } return bitmapDescriptorFactory.fromBitmap(bitmap); @@ -223,7 +192,7 @@ public static BitmapDescriptor getBitmapFromBytes( * 'imagePixelRatio', and may optionally include 'width' and/or 'height' to explicitly set the * dimensions of the output image. * - * @param assetDetails a map containing the asset details and scaling instructions, with keys + * @param assetMap a map containing the asset details and scaling instructions, with keys * 'assetName': the name of the asset file, 'bitmapScaling': the scaling mode, either 'auto' * or 'none', 'imagePixelRatio': used with 'auto' scaling to compute the scale ratio, 'width' * (optional): the desired width, which affects scaling if 'height' is not provided, 'height' @@ -239,39 +208,19 @@ public static BitmapDescriptor getBitmapFromBytes( */ @VisibleForTesting public static BitmapDescriptor getBitmapFromAsset( - Map assetDetails, + Messages.PlatformBitmapAssetMap assetMap, AssetManager assetManager, float density, BitmapDescriptorFactoryWrapper bitmapDescriptorFactory, FlutterInjectorWrapper flutterInjector) { - - final String assetNameKey = "assetName"; - final String bitmapScalingKey = "bitmapScaling"; - final String imagePixelRatioKey = "imagePixelRatio"; - - if (!assetDetails.containsKey(assetNameKey)) { - throw new IllegalArgumentException("'asset' requires '" + assetNameKey + "' key."); - } - if (!assetDetails.containsKey(bitmapScalingKey)) { - throw new IllegalArgumentException("'asset' requires '" + bitmapScalingKey + "' key."); - } - if (!assetDetails.containsKey(imagePixelRatioKey)) { - throw new IllegalArgumentException("'asset' requires '" + imagePixelRatioKey + "' key."); - } - - final String assetName = toString(assetDetails.get(assetNameKey)); + final String assetName = assetMap.getAssetName(); final String assetKey = flutterInjector.getLookupKeyForAsset(assetName); - String scalingMode = toString(assetDetails.get(bitmapScalingKey)); + Messages.PlatformMapBitmapScaling scalingMode = assetMap.getBitmapScaling(); switch (scalingMode) { - case "auto": - final String widthKey = "width"; - final String heightKey = "height"; - - final Double width = - assetDetails.containsKey(widthKey) ? toDouble(assetDetails.get(widthKey)) : null; - final Double height = - assetDetails.containsKey(heightKey) ? toDouble(assetDetails.get(heightKey)) : null; + case AUTO: + final Double width = assetMap.getWidth(); + final Double height = assetMap.getHeight(); InputStream inputStream = null; try { inputStream = assetManager.open(assetKey); @@ -294,7 +243,7 @@ public static BitmapDescriptor getBitmapFromAsset( toScaledBitmap(bitmap, targetWidth, targetHeight)); } else { // Scale image using given scale. - final float scale = density / toFloat(assetDetails.get(imagePixelRatioKey)); + final float scale = density / assetMap.getImagePixelRatio().floatValue(); return bitmapDescriptorFactory.fromBitmap(toScaledBitmap(bitmap, scale)); } } catch (Exception e) { @@ -308,7 +257,7 @@ public static BitmapDescriptor getBitmapFromAsset( } } } - case "none": + case NONE: break; } @@ -519,8 +468,7 @@ private static List toList(Object o) { return (Map) o; } - private static Bitmap toBitmap(Object o) { - byte[] bmpData = (byte[]) o; + private static Bitmap toBitmap(byte[] bmpData) { Bitmap bitmap = BitmapFactory.decodeByteArray(bmpData, 0, bmpData.length); if (bitmap == null) { throw new IllegalArgumentException("Unable to decode bytes as a valid bitmap."); From 8172143aded76965b3d4d058ec36a9ae295bb2b2 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 4 Oct 2024 16:17:29 -0400 Subject: [PATCH 04/15] Probably need to include caps --- .../flutter/plugins/googlemaps/Convert.java | 9 +++--- .../flutter/plugins/googlemaps/Messages.java | 28 +++++++++---------- .../ClusterManagersControllerTest.java | 2 +- .../plugins/googlemaps/ConvertTest.java | 20 +++++++------ .../googlemaps/MarkersControllerTest.java | 3 +- .../lib/src/google_maps_flutter_android.dart | 2 +- .../lib/src/messages.g.dart | 8 +++--- .../pigeons/messages.dart | 4 +-- 8 files changed, 40 insertions(+), 36 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 1e8d867a6e9f..f3d285724bb8 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 @@ -61,7 +61,7 @@ class Convert { public static final String HEATMAP_GRADIENT_COLOR_MAP_SIZE_KEY = "colorMapSize"; private static BitmapDescriptor toBitmapDescriptor( - Object o, AssetManager assetManager, float density) { + Messages.PlatformBitmap o, AssetManager assetManager, float density) { return toBitmapDescriptor(o, assetManager, density, new BitmapDescriptorFactoryWrapper()); } @@ -80,7 +80,7 @@ private static BitmapDescriptor toBitmapDescriptor( if (bitmap instanceof Messages.PlatformBitmapAsset) { Messages.PlatformBitmapAsset typedBitmap = (Messages.PlatformBitmapAsset) bitmap; final String assetPath = typedBitmap.getName(); - final String assetPackage = typedBitmap.getPackage(); + final String assetPackage = typedBitmap.getPkg(); if (assetPackage == null) { return BitmapDescriptorFactory.fromAsset( FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetPath)); @@ -833,10 +833,11 @@ private static Cap toCap(Object o, AssetManager assetManager, float density) { return new SquareCap(); case "customCap": if (data.size() == 2) { - return new CustomCap(toBitmapDescriptor(data.get(1), assetManager, density)); + // TODO needs new types + return new CustomCap(toBitmapDescriptor((Messages.PlatformBitmap) data.get(1), assetManager, density)); } else { return new CustomCap( - toBitmapDescriptor(data.get(1), assetManager, density), toFloat(data.get(2))); + toBitmapDescriptor((Messages.PlatformBitmap)data.get(1), assetManager, density), toFloat(data.get(2))); } default: throw new IllegalArgumentException("Cannot interpret " + o + " as Cap"); 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 b6af3f690baf..3ca361ec31c1 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 @@ -4812,14 +4812,14 @@ public void setName(@NonNull String setterArg) { this.name = setterArg; } - private @Nullable String package; + private @Nullable String pkg; - public @Nullable String getPackage() { - return package; + public @Nullable String getPkg() { + return pkg; } - public void setPackage(@Nullable String setterArg) { - this.package = setterArg; + public void setPkg(@Nullable String setterArg) { + this.pkg = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ @@ -4830,12 +4830,12 @@ public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PlatformBitmapAsset that = (PlatformBitmapAsset) o; - return name.equals(that.name) && Objects.equals(package, that.package); + return name.equals(that.name) && Objects.equals(pkg, that.pkg); } @Override public int hashCode() { - return Objects.hash(name, package); + return Objects.hash(name, pkg); } public static final class Builder { @@ -4848,18 +4848,18 @@ public static final class Builder { return this; } - private @Nullable String package; + private @Nullable String pkg; @CanIgnoreReturnValue - public @NonNull Builder setPackage(@Nullable String setterArg) { - this.package = setterArg; + public @NonNull Builder setPkg(@Nullable String setterArg) { + this.pkg = setterArg; return this; } public @NonNull PlatformBitmapAsset build() { PlatformBitmapAsset pigeonReturn = new PlatformBitmapAsset(); pigeonReturn.setName(name); - pigeonReturn.setPackage(package); + pigeonReturn.setPkg(pkg); return pigeonReturn; } } @@ -4868,7 +4868,7 @@ public static final class Builder { ArrayList toList() { ArrayList toListResult = new ArrayList<>(2); toListResult.add(name); - toListResult.add(package); + toListResult.add(pkg); return toListResult; } @@ -4876,8 +4876,8 @@ ArrayList toList() { PlatformBitmapAsset pigeonResult = new PlatformBitmapAsset(); Object name = pigeonVar_list.get(0); pigeonResult.setName((String) name); - Object package = pigeonVar_list.get(1); - pigeonResult.setPackage((String) package); + Object pkg = pigeonVar_list.get(1); + pigeonResult.setPkg((String) pkg); return pigeonResult; } } 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 dd41a3fbd027..cf9c943ce8a3 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 @@ -194,7 +194,7 @@ private Messages.PlatformMarker createPlatformMarker( return new Messages.PlatformMarker.Builder() .setMarkerId(markerId) .setConsumeTapEvents(false) - .setIcon(Arrays.asList("bytes", byteData)) + .setIcon(null)//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/ConvertTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java index a7331b89f798..12acd2735b3d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java @@ -155,7 +155,7 @@ public void GetBitmapFromAssetAuto() throws Exception { BitmapDescriptor result = Convert.getBitmapFromAsset( - assetDetails, + null, //assetDetails, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, @@ -175,6 +175,8 @@ public void GetBitmapFromAssetAutoAndWidth() throws Exception { assetDetails.put("width", 15.0f); assetDetails.put("imagePixelRatio", 2.0f); + Messages.PlatformBitmapAssetMap platformBitmap = new Messages.PlatformBitmapAssetMap.Builder().setAssetName(fakeAssetName).setWidth(15.0).setImagePixelRatio(2.0).setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO).build(); + when(flutterInjectorWrapper.getLookupKeyForAsset(fakeAssetName)).thenReturn(fakeAssetKey); when(assetManager.open(fakeAssetKey)).thenReturn(buildImageInputStream()); @@ -183,7 +185,7 @@ public void GetBitmapFromAssetAutoAndWidth() throws Exception { BitmapDescriptor result = Convert.getBitmapFromAsset( - assetDetails, + platformBitmap, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, @@ -211,7 +213,7 @@ public void GetBitmapFromAssetAutoAndHeight() throws Exception { BitmapDescriptor result = Convert.getBitmapFromAsset( - assetDetails, + null, //assetDetails, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, @@ -240,7 +242,7 @@ public void GetBitmapFromAssetNoScaling() throws Exception { BitmapDescriptor result = Convert.getBitmapFromAsset( - assetDetails, + null, //assetDetails, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, @@ -261,7 +263,7 @@ public void GetBitmapFromBytesAuto() { when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); BitmapDescriptor result = - Convert.getBitmapFromBytes(assetDetails, 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(null, /*assetDetails, */1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -279,7 +281,7 @@ public void GetBitmapFromBytesAutoAndWidth() { when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); BitmapDescriptor result = - Convert.getBitmapFromBytes(assetDetails, 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(null, /*assetDetails, */ 1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -297,7 +299,7 @@ public void GetBitmapFromBytesAutoAndHeight() { when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); BitmapDescriptor result = - Convert.getBitmapFromBytes(assetDetails, 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(null, /*assetDetails, */1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -314,7 +316,7 @@ public void GetBitmapFromBytesNoScaling() { when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); BitmapDescriptor result = - Convert.getBitmapFromBytes(assetDetails, 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(null, /*assetDetails, */1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -332,7 +334,7 @@ public void GetBitmapFromBytesThrowsErrorIfInvalidImageData() { verify(bitmapDescriptorFactoryWrapper, never()).fromBitmap(any()); try { - Convert.getBitmapFromBytes(assetDetails, 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(null, /*assetDetails, */1f, bitmapDescriptorFactoryWrapper); } catch (IllegalArgumentException e) { Assert.assertEquals(e.getMessage(), "Unable to interpret bytes as a valid image."); throw e; // rethrow the exception 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 9df0b8d523db..bbbe883ef8a5 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 @@ -81,7 +81,8 @@ private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { .setRotation(0.0) .setZIndex(0.0) .setConsumeTapEvents(false) - .setIcon(Arrays.asList("bytes", byteData)) + // TODO construct bitmap + .setIcon(null)//Arrays.asList("bytes", byteData)) .setInfoWindow(infoWindow); } 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 8b5507c704cc..d2a0bde71325 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 @@ -875,7 +875,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { case final BytesBitmap bytes: return PlatformBitmap(bitmap: PlatformBitmapBytes(byteData: bytes.byteData, size: (bytes.size == null) ? null : _platformOffsetFromSize(bytes.size!))); case final AssetBitmap asset: - return PlatformBitmap(bitmap: PlatformBitmapAsset(name: asset.name, package: asset.package)); + return PlatformBitmap(bitmap: PlatformBitmapAsset(name: asset.name, pkg: asset.package)); case final AssetImageBitmap asset: return PlatformBitmap(bitmap: PlatformBitmapAssetImage(name: asset.name, scale: asset.scale, size: (asset.size == null) ? null : _platformOffsetFromSize(asset.size!))); case final AssetMapBitmap asset: 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 ac0f4230367b..087f0119dd0a 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 @@ -1319,17 +1319,17 @@ class PlatformBitmapBytes { class PlatformBitmapAsset { PlatformBitmapAsset({ required this.name, - this.package, + this.pkg, }); String name; - String? package; + String? pkg; Object encode() { return [ name, - package, + pkg, ]; } @@ -1337,7 +1337,7 @@ class PlatformBitmapAsset { result as List; return PlatformBitmapAsset( name: result[0]! as String, - package: result[1] as String?, + pkg: result[1] 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 e88e62dc349f..ea0e6d5d163f 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 @@ -502,10 +502,10 @@ class PlatformBitmapBytes { } class PlatformBitmapAsset { - PlatformBitmapAsset({required this.name, this.package}); + PlatformBitmapAsset({required this.name, this.pkg}); final String name; - final String? package; + final String? pkg; } class PlatformBitmapAssetImage{ From 9d8cdb24e51f7f9803d0667565225a6e12a7e35a Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Mon, 7 Oct 2024 10:50:35 -0400 Subject: [PATCH 05/15] Add PlatformCap --- .../flutter/plugins/googlemaps/Messages.java | 386 +++++++++++++----- .../lib/src/google_maps_flutter_android.dart | 19 +- .../lib/src/messages.g.dart | 242 +++++++---- .../pigeons/messages.dart | 28 +- 4 files changed, 492 insertions(+), 183 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 3ca361ec31c1..78e9b8f0b8d8 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 @@ -114,6 +114,19 @@ public enum PlatformJointType { } } + public enum PlatformCapType { + BUTT(0), + SQUARE(1), + ROUND(2), + CUSTOM(3); + + final int index; + + PlatformCapType(final int index) { + this.index = index; + } + } + /** Enumeration of possible types for PatternItem. */ public enum PlatformPatternItemType { DOT(0), @@ -2352,27 +2365,26 @@ public void setPoints(@NonNull List setterArg) { this.points = setterArg; } - /** The start and end cap data, as JSON. These should be set only from Cap.toJson, and the native code must interpret it according to the internal implementation details of that method. */ - private @NonNull Object startCap; + private @NonNull PlatformCap startCap; - public @NonNull Object getStartCap() { + public @NonNull PlatformCap getStartCap() { return startCap; } - public void setStartCap(@NonNull Object setterArg) { + public void setStartCap(@NonNull PlatformCap setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"startCap\" is null."); } this.startCap = setterArg; } - private @NonNull Object endCap; + private @NonNull PlatformCap endCap; - public @NonNull Object getEndCap() { + public @NonNull PlatformCap getEndCap() { return endCap; } - public void setEndCap(@NonNull Object setterArg) { + public void setEndCap(@NonNull PlatformCap setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"endCap\" is null."); } @@ -2492,18 +2504,18 @@ public static final class Builder { return this; } - private @Nullable Object startCap; + private @Nullable PlatformCap startCap; @CanIgnoreReturnValue - public @NonNull Builder setStartCap(@NonNull Object setterArg) { + public @NonNull Builder setStartCap(@NonNull PlatformCap setterArg) { this.startCap = setterArg; return this; } - private @Nullable Object endCap; + private @Nullable PlatformCap endCap; @CanIgnoreReturnValue - public @NonNull Builder setEndCap(@NonNull Object setterArg) { + public @NonNull Builder setEndCap(@NonNull PlatformCap setterArg) { this.endCap = setterArg; return this; } @@ -2585,9 +2597,9 @@ ArrayList toList() { Object points = pigeonVar_list.get(6); pigeonResult.setPoints((List) points); Object startCap = pigeonVar_list.get(7); - pigeonResult.setStartCap(startCap); + pigeonResult.setStartCap((PlatformCap) startCap); Object endCap = pigeonVar_list.get(8); - pigeonResult.setEndCap(endCap); + pigeonResult.setEndCap((PlatformCap) endCap); Object visible = pigeonVar_list.get(9); pigeonResult.setVisible((Boolean) visible); Object width = pigeonVar_list.get(10); @@ -2598,6 +2610,179 @@ ArrayList toList() { } } + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformCap { + private @NonNull PlatformCapType type; + + public @NonNull PlatformCapType getType() { + return type; + } + + public void setType(@NonNull PlatformCapType setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"type\" is null."); + } + this.type = setterArg; + } + + private @Nullable PlatformCustomCap customCap; + + public @Nullable PlatformCustomCap getCustomCap() { + return customCap; + } + + public void setCustomCap(@Nullable PlatformCustomCap setterArg) { + this.customCap = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformCap() {} + + @Override + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformCap that = (PlatformCap) o; + return type.equals(that.type) && Objects.equals(customCap, that.customCap); + } + + @Override + public int hashCode() { + return Objects.hash(type, customCap); + } + + public static final class Builder { + + private @Nullable PlatformCapType type; + + @CanIgnoreReturnValue + public @NonNull Builder setType(@NonNull PlatformCapType setterArg) { + this.type = setterArg; + return this; + } + + private @Nullable PlatformCustomCap customCap; + + @CanIgnoreReturnValue + public @NonNull Builder setCustomCap(@Nullable PlatformCustomCap setterArg) { + this.customCap = setterArg; + return this; + } + + public @NonNull PlatformCap build() { + PlatformCap pigeonReturn = new PlatformCap(); + pigeonReturn.setType(type); + pigeonReturn.setCustomCap(customCap); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(type); + toListResult.add(customCap); + return toListResult; + } + + static @NonNull PlatformCap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCap pigeonResult = new PlatformCap(); + Object type = pigeonVar_list.get(0); + pigeonResult.setType((PlatformCapType) type); + Object customCap = pigeonVar_list.get(1); + pigeonResult.setCustomCap((PlatformCustomCap) customCap); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformCustomCap { + private @NonNull PlatformBitmap bitmapDescriptor; + + public @NonNull PlatformBitmap getBitmapDescriptor() { + return bitmapDescriptor; + } + + public void setBitmapDescriptor(@NonNull PlatformBitmap setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"bitmapDescriptor\" is null."); + } + this.bitmapDescriptor = setterArg; + } + + private @NonNull Double refWidth; + + public @NonNull Double getRefWidth() { + return refWidth; + } + + public void setRefWidth(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"refWidth\" is null."); + } + this.refWidth = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformCustomCap() {} + + @Override + public boolean equals(Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + PlatformCustomCap that = (PlatformCustomCap) o; + return bitmapDescriptor.equals(that.bitmapDescriptor) && refWidth.equals(that.refWidth); + } + + @Override + public int hashCode() { + return Objects.hash(bitmapDescriptor, refWidth); + } + + public static final class Builder { + + private @Nullable PlatformBitmap bitmapDescriptor; + + @CanIgnoreReturnValue + public @NonNull Builder setBitmapDescriptor(@NonNull PlatformBitmap setterArg) { + this.bitmapDescriptor = setterArg; + return this; + } + + private @Nullable Double refWidth; + + @CanIgnoreReturnValue + public @NonNull Builder setRefWidth(@NonNull Double setterArg) { + this.refWidth = setterArg; + return this; + } + + public @NonNull PlatformCustomCap build() { + PlatformCustomCap pigeonReturn = new PlatformCustomCap(); + pigeonReturn.setBitmapDescriptor(bitmapDescriptor); + pigeonReturn.setRefWidth(refWidth); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(bitmapDescriptor); + toListResult.add(refWidth); + return toListResult; + } + + static @NonNull PlatformCustomCap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCustomCap pigeonResult = new PlatformCustomCap(); + Object bitmapDescriptor = pigeonVar_list.get(0); + pigeonResult.setBitmapDescriptor((PlatformBitmap) bitmapDescriptor); + Object refWidth = pigeonVar_list.get(1); + pigeonResult.setRefWidth((Double) refWidth); + return pigeonResult; + } + } + /** * Pigeon equivalent of the PatternItem class. * @@ -5330,87 +5515,95 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { } case (byte) 132: { Object value = readValue(buffer); - return value == null ? null : PlatformPatternItemType.values()[((Long) value).intValue()]; + return value == null ? null : PlatformCapType.values()[((Long) value).intValue()]; } case (byte) 133: { + Object value = readValue(buffer); + return value == null ? null : PlatformPatternItemType.values()[((Long) value).intValue()]; + } + case (byte) 134: { Object value = readValue(buffer); return value == null ? null : PlatformMapBitmapScaling.values()[((Long) value).intValue()]; } - case (byte) 134: - return PlatformCameraPosition.fromList((ArrayList) readValue(buffer)); case (byte) 135: - return PlatformCameraUpdate.fromList((ArrayList) readValue(buffer)); + return PlatformCameraPosition.fromList((ArrayList) readValue(buffer)); case (byte) 136: - return PlatformCameraUpdateNewCameraPosition.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdate.fromList((ArrayList) readValue(buffer)); case (byte) 137: - return PlatformCameraUpdateNewLatLng.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateNewCameraPosition.fromList((ArrayList) readValue(buffer)); case (byte) 138: - return PlatformCameraUpdateNewLatLngBounds.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateNewLatLng.fromList((ArrayList) readValue(buffer)); case (byte) 139: - return PlatformCameraUpdateNewLatLngZoom.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateNewLatLngBounds.fromList((ArrayList) readValue(buffer)); case (byte) 140: - return PlatformCameraUpdateScrollBy.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateNewLatLngZoom.fromList((ArrayList) readValue(buffer)); case (byte) 141: - return PlatformCameraUpdateZoomBy.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateScrollBy.fromList((ArrayList) readValue(buffer)); case (byte) 142: - return PlatformCameraUpdateZoom.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateZoomBy.fromList((ArrayList) readValue(buffer)); case (byte) 143: - return PlatformCameraUpdateZoomTo.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateZoom.fromList((ArrayList) readValue(buffer)); case (byte) 144: - return PlatformCircle.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateZoomTo.fromList((ArrayList) readValue(buffer)); case (byte) 145: - return PlatformHeatmap.fromList((ArrayList) readValue(buffer)); + return PlatformCircle.fromList((ArrayList) readValue(buffer)); case (byte) 146: - return PlatformClusterManager.fromList((ArrayList) readValue(buffer)); + return PlatformHeatmap.fromList((ArrayList) readValue(buffer)); case (byte) 147: - return PlatformOffset.fromList((ArrayList) readValue(buffer)); + return PlatformClusterManager.fromList((ArrayList) readValue(buffer)); case (byte) 148: - return PlatformInfoWindow.fromList((ArrayList) readValue(buffer)); + return PlatformOffset.fromList((ArrayList) readValue(buffer)); case (byte) 149: - return PlatformMarker.fromList((ArrayList) readValue(buffer)); + return PlatformInfoWindow.fromList((ArrayList) readValue(buffer)); case (byte) 150: - return PlatformPolygon.fromList((ArrayList) readValue(buffer)); + return PlatformMarker.fromList((ArrayList) readValue(buffer)); case (byte) 151: - return PlatformPolyline.fromList((ArrayList) readValue(buffer)); + return PlatformPolygon.fromList((ArrayList) readValue(buffer)); case (byte) 152: - return PlatformPatternItem.fromList((ArrayList) readValue(buffer)); + return PlatformPolyline.fromList((ArrayList) readValue(buffer)); case (byte) 153: - return PlatformTile.fromList((ArrayList) readValue(buffer)); + return PlatformCap.fromList((ArrayList) readValue(buffer)); case (byte) 154: - return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); + return PlatformCustomCap.fromList((ArrayList) readValue(buffer)); case (byte) 155: - return PlatformEdgeInsets.fromList((ArrayList) readValue(buffer)); + return PlatformPatternItem.fromList((ArrayList) readValue(buffer)); case (byte) 156: - return PlatformLatLng.fromList((ArrayList) readValue(buffer)); + return PlatformTile.fromList((ArrayList) readValue(buffer)); case (byte) 157: - return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); + return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); case (byte) 158: - return PlatformCluster.fromList((ArrayList) readValue(buffer)); + return PlatformEdgeInsets.fromList((ArrayList) readValue(buffer)); case (byte) 159: - return PlatformCameraTargetBounds.fromList((ArrayList) readValue(buffer)); + return PlatformLatLng.fromList((ArrayList) readValue(buffer)); case (byte) 160: - return PlatformMapViewCreationParams.fromList((ArrayList) readValue(buffer)); + return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); case (byte) 161: - return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); + return PlatformCluster.fromList((ArrayList) readValue(buffer)); case (byte) 162: - return PlatformPoint.fromList((ArrayList) readValue(buffer)); + return PlatformCameraTargetBounds.fromList((ArrayList) readValue(buffer)); case (byte) 163: - return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); + return PlatformMapViewCreationParams.fromList((ArrayList) readValue(buffer)); case (byte) 164: - return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); case (byte) 165: - return PlatformBitmap.fromList((ArrayList) readValue(buffer)); + return PlatformPoint.fromList((ArrayList) readValue(buffer)); case (byte) 166: - return PlatformBitmapDefaultMarker.fromList((ArrayList) readValue(buffer)); + return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); case (byte) 167: - return PlatformBitmapBytes.fromList((ArrayList) readValue(buffer)); + return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); case (byte) 168: - return PlatformBitmapAsset.fromList((ArrayList) readValue(buffer)); + return PlatformBitmap.fromList((ArrayList) readValue(buffer)); case (byte) 169: - return PlatformBitmapAssetImage.fromList((ArrayList) readValue(buffer)); + return PlatformBitmapDefaultMarker.fromList((ArrayList) readValue(buffer)); case (byte) 170: - return PlatformBitmapAssetMap.fromList((ArrayList) readValue(buffer)); + return PlatformBitmapBytes.fromList((ArrayList) readValue(buffer)); case (byte) 171: + return PlatformBitmapAsset.fromList((ArrayList) readValue(buffer)); + case (byte) 172: + return PlatformBitmapAssetImage.fromList((ArrayList) readValue(buffer)); + case (byte) 173: + return PlatformBitmapAssetMap.fromList((ArrayList) readValue(buffer)); + case (byte) 174: return PlatformBitmapBytesMap.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); @@ -5428,125 +5621,134 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } else if (value instanceof PlatformJointType) { stream.write(131); writeValue(stream, value == null ? null : ((PlatformJointType) value).index); - } else if (value instanceof PlatformPatternItemType) { + } else if (value instanceof PlatformCapType) { stream.write(132); + writeValue(stream, value == null ? null : ((PlatformCapType) value).index); + } else if (value instanceof PlatformPatternItemType) { + stream.write(133); writeValue(stream, value == null ? null : ((PlatformPatternItemType) value).index); } else if (value instanceof PlatformMapBitmapScaling) { - stream.write(133); + stream.write(134); writeValue(stream, value == null ? null : ((PlatformMapBitmapScaling) value).index); } else if (value instanceof PlatformCameraPosition) { - stream.write(134); + stream.write(135); writeValue(stream, ((PlatformCameraPosition) value).toList()); } else if (value instanceof PlatformCameraUpdate) { - stream.write(135); + stream.write(136); writeValue(stream, ((PlatformCameraUpdate) value).toList()); } else if (value instanceof PlatformCameraUpdateNewCameraPosition) { - stream.write(136); + stream.write(137); writeValue(stream, ((PlatformCameraUpdateNewCameraPosition) value).toList()); } else if (value instanceof PlatformCameraUpdateNewLatLng) { - stream.write(137); + stream.write(138); writeValue(stream, ((PlatformCameraUpdateNewLatLng) value).toList()); } else if (value instanceof PlatformCameraUpdateNewLatLngBounds) { - stream.write(138); + stream.write(139); writeValue(stream, ((PlatformCameraUpdateNewLatLngBounds) value).toList()); } else if (value instanceof PlatformCameraUpdateNewLatLngZoom) { - stream.write(139); + stream.write(140); writeValue(stream, ((PlatformCameraUpdateNewLatLngZoom) value).toList()); } else if (value instanceof PlatformCameraUpdateScrollBy) { - stream.write(140); + stream.write(141); writeValue(stream, ((PlatformCameraUpdateScrollBy) value).toList()); } else if (value instanceof PlatformCameraUpdateZoomBy) { - stream.write(141); + stream.write(142); writeValue(stream, ((PlatformCameraUpdateZoomBy) value).toList()); } else if (value instanceof PlatformCameraUpdateZoom) { - stream.write(142); + stream.write(143); writeValue(stream, ((PlatformCameraUpdateZoom) value).toList()); } else if (value instanceof PlatformCameraUpdateZoomTo) { - stream.write(143); + stream.write(144); writeValue(stream, ((PlatformCameraUpdateZoomTo) value).toList()); } else if (value instanceof PlatformCircle) { - stream.write(144); + stream.write(145); writeValue(stream, ((PlatformCircle) value).toList()); } else if (value instanceof PlatformHeatmap) { - stream.write(145); + stream.write(146); writeValue(stream, ((PlatformHeatmap) value).toList()); } else if (value instanceof PlatformClusterManager) { - stream.write(146); + stream.write(147); writeValue(stream, ((PlatformClusterManager) value).toList()); } else if (value instanceof PlatformOffset) { - stream.write(147); + stream.write(148); writeValue(stream, ((PlatformOffset) value).toList()); } else if (value instanceof PlatformInfoWindow) { - stream.write(148); + stream.write(149); writeValue(stream, ((PlatformInfoWindow) value).toList()); } else if (value instanceof PlatformMarker) { - stream.write(149); + stream.write(150); writeValue(stream, ((PlatformMarker) value).toList()); } else if (value instanceof PlatformPolygon) { - stream.write(150); + stream.write(151); writeValue(stream, ((PlatformPolygon) value).toList()); } else if (value instanceof PlatformPolyline) { - stream.write(151); + stream.write(152); writeValue(stream, ((PlatformPolyline) value).toList()); + } else if (value instanceof PlatformCap) { + stream.write(153); + writeValue(stream, ((PlatformCap) value).toList()); + } else if (value instanceof PlatformCustomCap) { + stream.write(154); + writeValue(stream, ((PlatformCustomCap) value).toList()); } else if (value instanceof PlatformPatternItem) { - stream.write(152); + stream.write(155); writeValue(stream, ((PlatformPatternItem) value).toList()); } else if (value instanceof PlatformTile) { - stream.write(153); + stream.write(156); writeValue(stream, ((PlatformTile) value).toList()); } else if (value instanceof PlatformTileOverlay) { - stream.write(154); + stream.write(157); writeValue(stream, ((PlatformTileOverlay) value).toList()); } else if (value instanceof PlatformEdgeInsets) { - stream.write(155); + stream.write(158); writeValue(stream, ((PlatformEdgeInsets) value).toList()); } else if (value instanceof PlatformLatLng) { - stream.write(156); + stream.write(159); writeValue(stream, ((PlatformLatLng) value).toList()); } else if (value instanceof PlatformLatLngBounds) { - stream.write(157); + stream.write(160); writeValue(stream, ((PlatformLatLngBounds) value).toList()); } else if (value instanceof PlatformCluster) { - stream.write(158); + stream.write(161); writeValue(stream, ((PlatformCluster) value).toList()); } else if (value instanceof PlatformCameraTargetBounds) { - stream.write(159); + stream.write(162); writeValue(stream, ((PlatformCameraTargetBounds) value).toList()); } else if (value instanceof PlatformMapViewCreationParams) { - stream.write(160); + stream.write(163); writeValue(stream, ((PlatformMapViewCreationParams) value).toList()); } else if (value instanceof PlatformMapConfiguration) { - stream.write(161); + stream.write(164); writeValue(stream, ((PlatformMapConfiguration) value).toList()); } else if (value instanceof PlatformPoint) { - stream.write(162); + stream.write(165); writeValue(stream, ((PlatformPoint) value).toList()); } else if (value instanceof PlatformTileLayer) { - stream.write(163); + stream.write(166); writeValue(stream, ((PlatformTileLayer) value).toList()); } else if (value instanceof PlatformZoomRange) { - stream.write(164); + stream.write(167); writeValue(stream, ((PlatformZoomRange) value).toList()); } else if (value instanceof PlatformBitmap) { - stream.write(165); + stream.write(168); writeValue(stream, ((PlatformBitmap) value).toList()); } else if (value instanceof PlatformBitmapDefaultMarker) { - stream.write(166); + stream.write(169); writeValue(stream, ((PlatformBitmapDefaultMarker) value).toList()); } else if (value instanceof PlatformBitmapBytes) { - stream.write(167); + stream.write(170); writeValue(stream, ((PlatformBitmapBytes) value).toList()); } else if (value instanceof PlatformBitmapAsset) { - stream.write(168); + stream.write(171); writeValue(stream, ((PlatformBitmapAsset) value).toList()); } else if (value instanceof PlatformBitmapAssetImage) { - stream.write(169); + stream.write(172); writeValue(stream, ((PlatformBitmapAssetImage) value).toList()); } else if (value instanceof PlatformBitmapAssetMap) { - stream.write(170); + stream.write(173); writeValue(stream, ((PlatformBitmapAssetMap) value).toList()); } else if (value instanceof PlatformBitmapBytesMap) { - stream.write(171); + stream.write(174); writeValue(stream, ((PlatformBitmapBytesMap) value).toList()); } 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 d2a0bde71325..56a3a7a69615 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 @@ -779,8 +779,8 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { polylineId: polyline.polylineId.value, consumesTapEvents: polyline.consumeTapEvents, color: polyline.color.value, - startCap: polyline.startCap.toJson(), - endCap: polyline.endCap.toJson(), + startCap: platformCapFromCap(polyline.startCap), + endCap: platformCapFromCap(polyline.endCap), geodesic: polyline.geodesic, visible: polyline.visible, width: polyline.width, @@ -886,6 +886,21 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { throw ArgumentError('Unrecognized type of bitmap ${bitmap.runtimeType}', 'bitmap'); } } + + @visibleForTesting + static PlatformCap platformCapFromCap(Cap cap) { + switch (cap.type) { + case CapType.butt: + return PlatformCap(type: PlatformCapType.butt); + case CapType.square: + return PlatformCap(type: PlatformCapType.square); + case CapType.round: + return PlatformCap(type: PlatformCapType.round); + case CapType.custom: + cap as CustomCap; + return PlatformCap(type: PlatformCapType.custom, customCap: PlatformCustomCap(bitmapDescriptor: platformBitmapFromBitmapDescriptor(cap.bitmapDescriptor), refWidth: cap.refWidth)); + } + } } /// Callback handler for map events from the platform host. 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 087f0119dd0a..a8eca3741d02 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 @@ -49,6 +49,13 @@ enum PlatformJointType { round, } +enum PlatformCapType { + butt, + square, + round, + custom, +} + /// Enumeration of possible types for PatternItem. enum PlatformPatternItemType { dot, @@ -672,10 +679,9 @@ class PlatformPolyline { List points; - /// The start and end cap data, as JSON. These should be set only from Cap.toJson, and the native code must interpret it according to the internal implementation details of that method. - Object startCap; + PlatformCap startCap; - Object endCap; + PlatformCap endCap; bool visible; @@ -710,8 +716,8 @@ class PlatformPolyline { jointType: result[4]! as PlatformJointType, patterns: (result[5] as List?)!.cast(), points: (result[6] as List?)!.cast(), - startCap: result[7]!, - endCap: result[8]!, + startCap: result[7]! as PlatformCap, + endCap: result[8]! as PlatformCap, visible: result[9]! as bool, width: result[10]! as int, zIndex: result[11]! as int, @@ -719,6 +725,58 @@ class PlatformPolyline { } } +class PlatformCap { + PlatformCap({ + required this.type, + this.customCap, + }); + + PlatformCapType type; + + PlatformCustomCap? customCap; + + Object encode() { + return [ + type, + customCap, + ]; + } + + static PlatformCap decode(Object result) { + result as List; + return PlatformCap( + type: result[0]! as PlatformCapType, + customCap: result[1] as PlatformCustomCap?, + ); + } +} + +class PlatformCustomCap { + PlatformCustomCap({ + required this.bitmapDescriptor, + required this.refWidth, + }); + + PlatformBitmap bitmapDescriptor; + + double refWidth; + + Object encode() { + return [ + bitmapDescriptor, + refWidth, + ]; + } + + static PlatformCustomCap decode(Object result) { + result as List; + return PlatformCustomCap( + bitmapDescriptor: result[0]! as PlatformBitmap, + refWidth: result[1]! as double, + ); + } +} + /// Pigeon equivalent of the PatternItem class. class PlatformPatternItem { PlatformPatternItem({ @@ -1472,125 +1530,134 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is PlatformJointType) { buffer.putUint8(131); writeValue(buffer, value.index); - } else if (value is PlatformPatternItemType) { + } else if (value is PlatformCapType) { buffer.putUint8(132); writeValue(buffer, value.index); - } else if (value is PlatformMapBitmapScaling) { + } else if (value is PlatformPatternItemType) { buffer.putUint8(133); writeValue(buffer, value.index); - } else if (value is PlatformCameraPosition) { + } else if (value is PlatformMapBitmapScaling) { buffer.putUint8(134); + writeValue(buffer, value.index); + } else if (value is PlatformCameraPosition) { + buffer.putUint8(135); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdate) { - buffer.putUint8(135); + buffer.putUint8(136); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewCameraPosition) { - buffer.putUint8(136); + buffer.putUint8(137); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLng) { - buffer.putUint8(137); + buffer.putUint8(138); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLngBounds) { - buffer.putUint8(138); + buffer.putUint8(139); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLngZoom) { - buffer.putUint8(139); + buffer.putUint8(140); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateScrollBy) { - buffer.putUint8(140); + buffer.putUint8(141); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoomBy) { - buffer.putUint8(141); + buffer.putUint8(142); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoom) { - buffer.putUint8(142); + buffer.putUint8(143); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoomTo) { - buffer.putUint8(143); + buffer.putUint8(144); writeValue(buffer, value.encode()); } else if (value is PlatformCircle) { - buffer.putUint8(144); + buffer.putUint8(145); writeValue(buffer, value.encode()); } else if (value is PlatformHeatmap) { - buffer.putUint8(145); + buffer.putUint8(146); writeValue(buffer, value.encode()); } else if (value is PlatformClusterManager) { - buffer.putUint8(146); + buffer.putUint8(147); writeValue(buffer, value.encode()); } else if (value is PlatformOffset) { - buffer.putUint8(147); + buffer.putUint8(148); writeValue(buffer, value.encode()); } else if (value is PlatformInfoWindow) { - buffer.putUint8(148); + buffer.putUint8(149); writeValue(buffer, value.encode()); } else if (value is PlatformMarker) { - buffer.putUint8(149); + buffer.putUint8(150); writeValue(buffer, value.encode()); } else if (value is PlatformPolygon) { - buffer.putUint8(150); + buffer.putUint8(151); writeValue(buffer, value.encode()); } else if (value is PlatformPolyline) { - buffer.putUint8(151); + buffer.putUint8(152); + writeValue(buffer, value.encode()); + } else if (value is PlatformCap) { + buffer.putUint8(153); + writeValue(buffer, value.encode()); + } else if (value is PlatformCustomCap) { + buffer.putUint8(154); writeValue(buffer, value.encode()); } else if (value is PlatformPatternItem) { - buffer.putUint8(152); + buffer.putUint8(155); writeValue(buffer, value.encode()); } else if (value is PlatformTile) { - buffer.putUint8(153); + buffer.putUint8(156); writeValue(buffer, value.encode()); } else if (value is PlatformTileOverlay) { - buffer.putUint8(154); + buffer.putUint8(157); writeValue(buffer, value.encode()); } else if (value is PlatformEdgeInsets) { - buffer.putUint8(155); + buffer.putUint8(158); writeValue(buffer, value.encode()); } else if (value is PlatformLatLng) { - buffer.putUint8(156); + buffer.putUint8(159); writeValue(buffer, value.encode()); } else if (value is PlatformLatLngBounds) { - buffer.putUint8(157); + buffer.putUint8(160); writeValue(buffer, value.encode()); } else if (value is PlatformCluster) { - buffer.putUint8(158); + buffer.putUint8(161); writeValue(buffer, value.encode()); } else if (value is PlatformCameraTargetBounds) { - buffer.putUint8(159); + buffer.putUint8(162); writeValue(buffer, value.encode()); } else if (value is PlatformMapViewCreationParams) { - buffer.putUint8(160); + buffer.putUint8(163); writeValue(buffer, value.encode()); } else if (value is PlatformMapConfiguration) { - buffer.putUint8(161); + buffer.putUint8(164); writeValue(buffer, value.encode()); } else if (value is PlatformPoint) { - buffer.putUint8(162); + buffer.putUint8(165); writeValue(buffer, value.encode()); } else if (value is PlatformTileLayer) { - buffer.putUint8(163); + buffer.putUint8(166); writeValue(buffer, value.encode()); } else if (value is PlatformZoomRange) { - buffer.putUint8(164); + buffer.putUint8(167); writeValue(buffer, value.encode()); } else if (value is PlatformBitmap) { - buffer.putUint8(165); + buffer.putUint8(168); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapDefaultMarker) { - buffer.putUint8(166); + buffer.putUint8(169); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapBytes) { - buffer.putUint8(167); + buffer.putUint8(170); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAsset) { - buffer.putUint8(168); + buffer.putUint8(171); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAssetImage) { - buffer.putUint8(169); + buffer.putUint8(172); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAssetMap) { - buffer.putUint8(170); + buffer.putUint8(173); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapBytesMap) { - buffer.putUint8(171); + buffer.putUint8(174); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -1611,85 +1678,92 @@ class _PigeonCodec extends StandardMessageCodec { return value == null ? null : PlatformJointType.values[value]; case 132: final int? value = readValue(buffer) as int?; - return value == null ? null : PlatformPatternItemType.values[value]; + return value == null ? null : PlatformCapType.values[value]; case 133: final int? value = readValue(buffer) as int?; - return value == null ? null : PlatformMapBitmapScaling.values[value]; + return value == null ? null : PlatformPatternItemType.values[value]; case 134: - return PlatformCameraPosition.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformMapBitmapScaling.values[value]; case 135: - return PlatformCameraUpdate.decode(readValue(buffer)!); + return PlatformCameraPosition.decode(readValue(buffer)!); case 136: - return PlatformCameraUpdateNewCameraPosition.decode(readValue(buffer)!); + return PlatformCameraUpdate.decode(readValue(buffer)!); case 137: - return PlatformCameraUpdateNewLatLng.decode(readValue(buffer)!); + return PlatformCameraUpdateNewCameraPosition.decode(readValue(buffer)!); case 138: - return PlatformCameraUpdateNewLatLngBounds.decode(readValue(buffer)!); + return PlatformCameraUpdateNewLatLng.decode(readValue(buffer)!); case 139: - return PlatformCameraUpdateNewLatLngZoom.decode(readValue(buffer)!); + return PlatformCameraUpdateNewLatLngBounds.decode(readValue(buffer)!); case 140: - return PlatformCameraUpdateScrollBy.decode(readValue(buffer)!); + return PlatformCameraUpdateNewLatLngZoom.decode(readValue(buffer)!); case 141: - return PlatformCameraUpdateZoomBy.decode(readValue(buffer)!); + return PlatformCameraUpdateScrollBy.decode(readValue(buffer)!); case 142: - return PlatformCameraUpdateZoom.decode(readValue(buffer)!); + return PlatformCameraUpdateZoomBy.decode(readValue(buffer)!); case 143: - return PlatformCameraUpdateZoomTo.decode(readValue(buffer)!); + return PlatformCameraUpdateZoom.decode(readValue(buffer)!); case 144: - return PlatformCircle.decode(readValue(buffer)!); + return PlatformCameraUpdateZoomTo.decode(readValue(buffer)!); case 145: - return PlatformHeatmap.decode(readValue(buffer)!); + return PlatformCircle.decode(readValue(buffer)!); case 146: - return PlatformClusterManager.decode(readValue(buffer)!); + return PlatformHeatmap.decode(readValue(buffer)!); case 147: - return PlatformOffset.decode(readValue(buffer)!); + return PlatformClusterManager.decode(readValue(buffer)!); case 148: - return PlatformInfoWindow.decode(readValue(buffer)!); + return PlatformOffset.decode(readValue(buffer)!); case 149: - return PlatformMarker.decode(readValue(buffer)!); + return PlatformInfoWindow.decode(readValue(buffer)!); case 150: - return PlatformPolygon.decode(readValue(buffer)!); + return PlatformMarker.decode(readValue(buffer)!); case 151: - return PlatformPolyline.decode(readValue(buffer)!); + return PlatformPolygon.decode(readValue(buffer)!); case 152: - return PlatformPatternItem.decode(readValue(buffer)!); + return PlatformPolyline.decode(readValue(buffer)!); case 153: - return PlatformTile.decode(readValue(buffer)!); + return PlatformCap.decode(readValue(buffer)!); case 154: - return PlatformTileOverlay.decode(readValue(buffer)!); + return PlatformCustomCap.decode(readValue(buffer)!); case 155: - return PlatformEdgeInsets.decode(readValue(buffer)!); + return PlatformPatternItem.decode(readValue(buffer)!); case 156: - return PlatformLatLng.decode(readValue(buffer)!); + return PlatformTile.decode(readValue(buffer)!); case 157: - return PlatformLatLngBounds.decode(readValue(buffer)!); + return PlatformTileOverlay.decode(readValue(buffer)!); case 158: - return PlatformCluster.decode(readValue(buffer)!); + return PlatformEdgeInsets.decode(readValue(buffer)!); case 159: - return PlatformCameraTargetBounds.decode(readValue(buffer)!); + return PlatformLatLng.decode(readValue(buffer)!); case 160: - return PlatformMapViewCreationParams.decode(readValue(buffer)!); + return PlatformLatLngBounds.decode(readValue(buffer)!); case 161: - return PlatformMapConfiguration.decode(readValue(buffer)!); + return PlatformCluster.decode(readValue(buffer)!); case 162: - return PlatformPoint.decode(readValue(buffer)!); + return PlatformCameraTargetBounds.decode(readValue(buffer)!); case 163: - return PlatformTileLayer.decode(readValue(buffer)!); + return PlatformMapViewCreationParams.decode(readValue(buffer)!); case 164: - return PlatformZoomRange.decode(readValue(buffer)!); + return PlatformMapConfiguration.decode(readValue(buffer)!); case 165: - return PlatformBitmap.decode(readValue(buffer)!); + return PlatformPoint.decode(readValue(buffer)!); case 166: - return PlatformBitmapDefaultMarker.decode(readValue(buffer)!); + return PlatformTileLayer.decode(readValue(buffer)!); case 167: - return PlatformBitmapBytes.decode(readValue(buffer)!); + return PlatformZoomRange.decode(readValue(buffer)!); case 168: - return PlatformBitmapAsset.decode(readValue(buffer)!); + return PlatformBitmap.decode(readValue(buffer)!); case 169: - return PlatformBitmapAssetImage.decode(readValue(buffer)!); + return PlatformBitmapDefaultMarker.decode(readValue(buffer)!); case 170: - return PlatformBitmapAssetMap.decode(readValue(buffer)!); + return PlatformBitmapBytes.decode(readValue(buffer)!); case 171: + return PlatformBitmapAsset.decode(readValue(buffer)!); + case 172: + return PlatformBitmapAssetImage.decode(readValue(buffer)!); + case 173: + return PlatformBitmapAssetMap.decode(readValue(buffer)!); + case 174: return PlatformBitmapBytesMap.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); 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 ea0e6d5d163f..495fa2fc8491 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 @@ -264,16 +264,34 @@ class PlatformPolyline { /// The pattern data, as a list of pattern items. final List patterns; final List points; - - /// The start and end cap data, as JSON. These should be set only from Cap.toJson, and the native code must interpret it according to the internal implementation details of that method. - // TODO(schectman): Convert below two fields to structured data. - final Object startCap; - final Object endCap; + final PlatformCap startCap; + final PlatformCap endCap; final bool visible; final int width; final int zIndex; } +enum PlatformCapType { + butt, + square, + round, + custom, +} + +class PlatformCap { + PlatformCap({required this.type, this.customCap}); + + final PlatformCapType type; + final PlatformCustomCap? customCap; +} + +class PlatformCustomCap { + PlatformCustomCap({required this.bitmapDescriptor, required this.refWidth}); + + final PlatformBitmap bitmapDescriptor; + final double refWidth; +} + /// Enumeration of possible types for PatternItem. enum PlatformPatternItemType { dot, From 33e1cbf7a094227ff551ba128b1c0e477a4d58ea Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Mon, 7 Oct 2024 11:01:49 -0400 Subject: [PATCH 06/15] Pass tests --- .../lib/src/google_maps_flutter_android.dart | 2 +- .../test/google_maps_flutter_android_test.dart | 8 ++++---- 2 files changed, 5 insertions(+), 5 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 56a3a7a69615..c91b109c864c 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 @@ -869,7 +869,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { } static PlatformBitmap platformBitmapFromBitmapDescriptor(BitmapDescriptor bitmap) { - switch(bitmap.runtimeType) { + switch(bitmap) { case final DefaultMarker marker: return PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble())); case final BytesBitmap bytes: 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 bd2ceb82dabe..8e1d593a95a3 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 @@ -411,12 +411,12 @@ 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, 6).toList(), [ + expect(encoded?.getRange(2, 5).toList(), [ object2new.consumeTapEvents, object2new.draggable, object2new.flat, - object2new.icon.toJson(), ]); + expect((encoded?[5] as PlatformBitmap?)?.bitmap.runtimeType, GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(object2new.icon).bitmap.runtimeType); final PlatformInfoWindow? window = encoded?[6] as PlatformInfoWindow?; expect(window?.title, object2new.infoWindow.title); expect(window?.snippet, object2new.infoWindow.snippet); @@ -441,12 +441,12 @@ 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, 6).toList(), [ + expect(encoded?.getRange(2, 5).toList(), [ object3.consumeTapEvents, object3.draggable, object3.flat, - object3.icon.toJson(), ]); + expect((encoded?[5] as PlatformBitmap?)?.bitmap.runtimeType, GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(object3.icon).bitmap.runtimeType); final PlatformInfoWindow? window = encoded?[6] as PlatformInfoWindow?; expect(window?.title, object3.infoWindow.title); expect(window?.snippet, object3.infoWindow.snippet); From a2031360c8a776be15e536b77f9250489c074d9e Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Mon, 7 Oct 2024 11:22:59 -0400 Subject: [PATCH 07/15] Update java side --- .../flutter/plugins/googlemaps/Convert.java | 82 +- .../flutter/plugins/googlemaps/Messages.java | 1447 +++++++++++------ .../ClusterManagersControllerTest.java | 18 +- .../plugins/googlemaps/ConvertTest.java | 148 +- .../googlemaps/MarkersControllerTest.java | 19 +- .../lib/src/google_maps_flutter_android.dart | 64 +- .../lib/src/messages.g.dart | 750 +++++---- .../pigeons/messages.dart | 19 +- .../google_maps_flutter_android_test.dart | 14 +- 9 files changed, 1656 insertions(+), 905 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 f3d285724bb8..a9fcedac9ae3 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 @@ -61,41 +61,45 @@ class Convert { public static final String HEATMAP_GRADIENT_COLOR_MAP_SIZE_KEY = "colorMapSize"; private static BitmapDescriptor toBitmapDescriptor( - Messages.PlatformBitmap o, AssetManager assetManager, float density) { + Messages.PlatformBitmap o, AssetManager assetManager, float density) { return toBitmapDescriptor(o, assetManager, density, new BitmapDescriptorFactoryWrapper()); } private static BitmapDescriptor toBitmapDescriptor( - Messages.PlatformBitmap platformBitmap, AssetManager assetManager, float density, BitmapDescriptorFactoryWrapper wrapper) { + Messages.PlatformBitmap platformBitmap, + AssetManager assetManager, + float density, + BitmapDescriptorFactoryWrapper wrapper) { Object bitmap = platformBitmap.getBitmap(); if (bitmap instanceof Messages.PlatformBitmapDefaultMarker) { - Messages.PlatformBitmapDefaultMarker typedBitmap = (Messages.PlatformBitmapDefaultMarker) bitmap; - if (typedBitmap.getHue() == null) { - return BitmapDescriptorFactory.defaultMarker(); - } else { - final float hue = typedBitmap.getHue().floatValue(); - return BitmapDescriptorFactory.defaultMarker(hue); - } - } + Messages.PlatformBitmapDefaultMarker typedBitmap = + (Messages.PlatformBitmapDefaultMarker) bitmap; + if (typedBitmap.getHue() == null) { + return BitmapDescriptorFactory.defaultMarker(); + } else { + final float hue = typedBitmap.getHue().floatValue(); + return BitmapDescriptorFactory.defaultMarker(hue); + } + } if (bitmap instanceof Messages.PlatformBitmapAsset) { Messages.PlatformBitmapAsset typedBitmap = (Messages.PlatformBitmapAsset) bitmap; final String assetPath = typedBitmap.getName(); final String assetPackage = typedBitmap.getPkg(); if (assetPackage == null) { return BitmapDescriptorFactory.fromAsset( - FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetPath)); + FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetPath)); } else { return BitmapDescriptorFactory.fromAsset( - FlutterInjector.instance() - .flutterLoader() - .getLookupKeyForAsset(assetPath, assetPackage)); + FlutterInjector.instance() + .flutterLoader() + .getLookupKeyForAsset(assetPath, assetPackage)); } } if (bitmap instanceof Messages.PlatformBitmapAssetImage) { Messages.PlatformBitmapAssetImage typedBitmap = (Messages.PlatformBitmapAssetImage) bitmap; final String assetImagePath = typedBitmap.getName(); return BitmapDescriptorFactory.fromAsset( - FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetImagePath)); + FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetImagePath)); } if (bitmap instanceof Messages.PlatformBitmapBytes) { Messages.PlatformBitmapBytes typedBitmap = (Messages.PlatformBitmapBytes) bitmap; @@ -104,7 +108,7 @@ private static BitmapDescriptor toBitmapDescriptor( if (bitmap instanceof Messages.PlatformBitmapAssetMap) { Messages.PlatformBitmapAssetMap typedBitmap = (Messages.PlatformBitmapAssetMap) bitmap; return getBitmapFromAsset( - typedBitmap, assetManager, density, wrapper, new FlutterInjectorWrapper()); + typedBitmap, assetManager, density, wrapper, new FlutterInjectorWrapper()); } if (bitmap instanceof Messages.PlatformBitmapBytesMap) { Messages.PlatformBitmapBytesMap typedBitmap = (Messages.PlatformBitmapBytesMap) bitmap; @@ -116,7 +120,8 @@ private static BitmapDescriptor toBitmapDescriptor( // Used for deprecated fromBytes bitmap descriptor. // Can be removed after support for "fromBytes" bitmap descriptor type is // removed. - private static BitmapDescriptor getBitmapFromBytesLegacy(Messages.PlatformBitmapBytes bitmapBytes) { + private static BitmapDescriptor getBitmapFromBytesLegacy( + Messages.PlatformBitmapBytes bitmapBytes) { try { Bitmap bitmap = toBitmap(bitmapBytes.getByteData()); return BitmapDescriptorFactory.fromBitmap(bitmap); @@ -146,7 +151,9 @@ private static BitmapDescriptor getBitmapFromBytesLegacy(Messages.PlatformBitmap */ @VisibleForTesting public static BitmapDescriptor getBitmapFromBytes( - Messages.PlatformBitmapBytesMap bytesMap, float density, BitmapDescriptorFactoryWrapper bitmapDescriptorFactory) { + Messages.PlatformBitmapBytesMap bytesMap, + float density, + BitmapDescriptorFactoryWrapper bitmapDescriptorFactory) { try { Bitmap bitmap = toBitmap(bytesMap.getByteData()); Messages.PlatformMapBitmapScaling scalingMode = bytesMap.getBitmapScaling(); @@ -651,8 +658,8 @@ static String interpretPolylineOptions( float density) { sink.setConsumeTapEvents(polyline.getConsumesTapEvents()); sink.setColor(polyline.getColor().intValue()); - sink.setEndCap(toCap(polyline.getEndCap(), assetManager, density)); - sink.setStartCap(toCap(polyline.getStartCap(), assetManager, density)); + sink.setEndCap(capFromPigeon(polyline.getEndCap(), assetManager, density)); + sink.setStartCap(capFromPigeon(polyline.getStartCap(), assetManager, density)); sink.setGeodesic(polyline.getGeodesic()); sink.setJointType(jointTypeFromPigeon(polyline.getJointType())); sink.setVisible(polyline.getVisible()); @@ -822,25 +829,30 @@ private static List patternFromPigeon( return pattern; } - private static Cap toCap(Object o, AssetManager assetManager, float density) { - final List data = toList(o); - switch (toString(data.get(0))) { - case "buttCap": + private static Cap capFromPigeon( + Messages.PlatformCap platformCap, AssetManager assetManager, float density) { + switch (platformCap.getType()) { + case BUTT: return new ButtCap(); - case "roundCap": - return new RoundCap(); - case "squareCap": + case SQUARE: return new SquareCap(); - case "customCap": - if (data.size() == 2) { - // TODO needs new types - return new CustomCap(toBitmapDescriptor((Messages.PlatformBitmap) data.get(1), assetManager, density)); - } else { - return new CustomCap( - toBitmapDescriptor((Messages.PlatformBitmap)data.get(1), assetManager, density), toFloat(data.get(2))); + case ROUND: + return new RoundCap(); + case CUSTOM: + { + Messages.PlatformCustomCap customCap = platformCap.getCustomCap(); + if (customCap == null) { + throw new IllegalArgumentException( + "PlatformCap with type CUSTOM cannot have null customCap field"); + } + BitmapDescriptor bitmap = + toBitmapDescriptor(customCap.getBitmapDescriptor(), assetManager, density); + float refWidth = customCap.getRefWidth().floatValue(); + return new CustomCap(bitmap, refWidth); } default: - throw new IllegalArgumentException("Cannot interpret " + o + " as Cap"); + throw new IllegalArgumentException( + "Unrecognized PlatformCap type " + platformCap.getType()); } } 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 78e9b8f0b8d8..b69a6e6ba7ec 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) @@ -154,7 +153,7 @@ public enum PlatformMapBitmapScaling { /** * 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; @@ -214,10 +213,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 @@ -296,16 +302,14 @@ 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 { /** - * This Object shall be any of the below classes prefixed with - * PlatformCameraUpdate. Each such class represents a different type of - * camera update, and each holds a different set of data, preventing the - * use of a single unified class. Pigeon does not support inheritance, which - * prevents a more strict type bound. - * See https://github.com/flutter/flutter/issues/117819. + * This Object shall be any of the below classes prefixed with PlatformCameraUpdate. Each such + * class represents a different type of camera update, and each holds a different set of data, + * preventing the use of a single unified class. Pigeon does not support inheritance, which + * prevents a more strict type bound. See https://github.com/flutter/flutter/issues/117819. */ private @NonNull Object cameraUpdate; @@ -325,8 +329,12 @@ public void setCameraUpdate(@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 cameraUpdate.equals(that.cameraUpdate); } @@ -371,7 +379,7 @@ ArrayList toList() { /** * Pigeon equivalent of NewCameraPosition * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateNewCameraPosition { private @NonNull PlatformCameraPosition cameraPosition; @@ -392,8 +400,12 @@ public void setCameraPosition(@NonNull PlatformCameraPosition 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; + } PlatformCameraUpdateNewCameraPosition that = (PlatformCameraUpdateNewCameraPosition) o; return cameraPosition.equals(that.cameraPosition); } @@ -414,7 +426,8 @@ public static final class Builder { } public @NonNull PlatformCameraUpdateNewCameraPosition build() { - PlatformCameraUpdateNewCameraPosition pigeonReturn = new PlatformCameraUpdateNewCameraPosition(); + PlatformCameraUpdateNewCameraPosition pigeonReturn = + new PlatformCameraUpdateNewCameraPosition(); pigeonReturn.setCameraPosition(cameraPosition); return pigeonReturn; } @@ -427,8 +440,10 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraUpdateNewCameraPosition fromList(@NonNull ArrayList pigeonVar_list) { - PlatformCameraUpdateNewCameraPosition pigeonResult = new PlatformCameraUpdateNewCameraPosition(); + static @NonNull PlatformCameraUpdateNewCameraPosition fromList( + @NonNull ArrayList pigeonVar_list) { + PlatformCameraUpdateNewCameraPosition pigeonResult = + new PlatformCameraUpdateNewCameraPosition(); Object cameraPosition = pigeonVar_list.get(0); pigeonResult.setCameraPosition((PlatformCameraPosition) cameraPosition); return pigeonResult; @@ -438,7 +453,7 @@ ArrayList toList() { /** * Pigeon equivalent of NewLatLng * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateNewLatLng { private @NonNull PlatformLatLng latLng; @@ -459,8 +474,12 @@ public void setLatLng(@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; + } PlatformCameraUpdateNewLatLng that = (PlatformCameraUpdateNewLatLng) o; return latLng.equals(that.latLng); } @@ -494,7 +513,8 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraUpdateNewLatLng fromList(@NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformCameraUpdateNewLatLng fromList( + @NonNull ArrayList pigeonVar_list) { PlatformCameraUpdateNewLatLng pigeonResult = new PlatformCameraUpdateNewLatLng(); Object latLng = pigeonVar_list.get(0); pigeonResult.setLatLng((PlatformLatLng) latLng); @@ -505,7 +525,7 @@ ArrayList toList() { /** * Pigeon equivalent of NewLatLngBounds * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateNewLatLngBounds { private @NonNull PlatformLatLngBounds bounds; @@ -539,8 +559,12 @@ public void setPadding(@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; + } PlatformCameraUpdateNewLatLngBounds that = (PlatformCameraUpdateNewLatLngBounds) o; return bounds.equals(that.bounds) && padding.equals(that.padding); } @@ -569,7 +593,8 @@ public static final class Builder { } public @NonNull PlatformCameraUpdateNewLatLngBounds build() { - PlatformCameraUpdateNewLatLngBounds pigeonReturn = new PlatformCameraUpdateNewLatLngBounds(); + PlatformCameraUpdateNewLatLngBounds pigeonReturn = + new PlatformCameraUpdateNewLatLngBounds(); pigeonReturn.setBounds(bounds); pigeonReturn.setPadding(padding); return pigeonReturn; @@ -584,7 +609,8 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraUpdateNewLatLngBounds fromList(@NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformCameraUpdateNewLatLngBounds fromList( + @NonNull ArrayList pigeonVar_list) { PlatformCameraUpdateNewLatLngBounds pigeonResult = new PlatformCameraUpdateNewLatLngBounds(); Object bounds = pigeonVar_list.get(0); pigeonResult.setBounds((PlatformLatLngBounds) bounds); @@ -597,7 +623,7 @@ ArrayList toList() { /** * Pigeon equivalent of NewLatLngZoom * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateNewLatLngZoom { private @NonNull PlatformLatLng latLng; @@ -631,8 +657,12 @@ 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; + } PlatformCameraUpdateNewLatLngZoom that = (PlatformCameraUpdateNewLatLngZoom) o; return latLng.equals(that.latLng) && zoom.equals(that.zoom); } @@ -676,7 +706,8 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraUpdateNewLatLngZoom fromList(@NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformCameraUpdateNewLatLngZoom fromList( + @NonNull ArrayList pigeonVar_list) { PlatformCameraUpdateNewLatLngZoom pigeonResult = new PlatformCameraUpdateNewLatLngZoom(); Object latLng = pigeonVar_list.get(0); pigeonResult.setLatLng((PlatformLatLng) latLng); @@ -689,7 +720,7 @@ ArrayList toList() { /** * Pigeon equivalent of ScrollBy * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateScrollBy { private @NonNull Double dx; @@ -723,8 +754,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; + } PlatformCameraUpdateScrollBy that = (PlatformCameraUpdateScrollBy) o; return dx.equals(that.dx) && dy.equals(that.dy); } @@ -768,7 +803,8 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraUpdateScrollBy fromList(@NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformCameraUpdateScrollBy fromList( + @NonNull ArrayList pigeonVar_list) { PlatformCameraUpdateScrollBy pigeonResult = new PlatformCameraUpdateScrollBy(); Object dx = pigeonVar_list.get(0); pigeonResult.setDx((Double) dx); @@ -781,7 +817,7 @@ ArrayList toList() { /** * Pigeon equivalent of ZoomBy * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateZoomBy { private @NonNull Double amount; @@ -812,8 +848,12 @@ public void setFocus(@Nullable 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; + } PlatformCameraUpdateZoomBy that = (PlatformCameraUpdateZoomBy) o; return amount.equals(that.amount) && Objects.equals(focus, that.focus); } @@ -870,7 +910,7 @@ ArrayList toList() { /** * Pigeon equivalent of ZoomIn/ZoomOut * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateZoom { private @NonNull Boolean out; @@ -891,8 +931,12 @@ public void setOut(@NonNull Boolean 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; + } PlatformCameraUpdateZoom that = (PlatformCameraUpdateZoom) o; return out.equals(that.out); } @@ -937,7 +981,7 @@ ArrayList toList() { /** * Pigeon equivalent of ZoomTo * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class PlatformCameraUpdateZoomTo { private @NonNull Double zoom; @@ -958,8 +1002,12 @@ 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; + } PlatformCameraUpdateZoomTo that = (PlatformCameraUpdateZoomTo) o; return zoom.equals(that.zoom); } @@ -1004,7 +1052,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; @@ -1129,15 +1177,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 { @@ -1271,13 +1340,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; @@ -1297,8 +1365,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); } @@ -1343,7 +1415,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; @@ -1364,8 +1436,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); } @@ -1410,7 +1486,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; @@ -1444,8 +1520,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); } @@ -1502,7 +1582,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; @@ -1543,10 +1623,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 @@ -1613,7 +1699,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; @@ -1787,15 +1873,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 { @@ -1977,7 +2092,7 @@ 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 { private @NonNull String polygonId; @@ -2115,15 +2230,38 @@ public void setZIndex(@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; + } PlatformPolygon that = (PlatformPolygon) o; - return polygonId.equals(that.polygonId) && consumesTapEvents.equals(that.consumesTapEvents) && fillColor.equals(that.fillColor) && geodesic.equals(that.geodesic) && points.equals(that.points) && holes.equals(that.holes) && visible.equals(that.visible) && strokeColor.equals(that.strokeColor) && strokeWidth.equals(that.strokeWidth) && zIndex.equals(that.zIndex); + return polygonId.equals(that.polygonId) + && consumesTapEvents.equals(that.consumesTapEvents) + && fillColor.equals(that.fillColor) + && geodesic.equals(that.geodesic) + && points.equals(that.points) + && holes.equals(that.holes) + && visible.equals(that.visible) + && strokeColor.equals(that.strokeColor) + && strokeWidth.equals(that.strokeWidth) + && zIndex.equals(that.zIndex); } @Override public int hashCode() { - return Objects.hash(polygonId, consumesTapEvents, fillColor, geodesic, points, holes, visible, strokeColor, strokeWidth, zIndex); + return Objects.hash( + polygonId, + consumesTapEvents, + fillColor, + geodesic, + points, + holes, + visible, + strokeColor, + strokeWidth, + zIndex); } public static final class Builder { @@ -2269,7 +2407,7 @@ 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 { private @NonNull String polylineId; @@ -2435,15 +2573,42 @@ public void setZIndex(@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; + } PlatformPolyline that = (PlatformPolyline) o; - return polylineId.equals(that.polylineId) && consumesTapEvents.equals(that.consumesTapEvents) && color.equals(that.color) && geodesic.equals(that.geodesic) && jointType.equals(that.jointType) && patterns.equals(that.patterns) && points.equals(that.points) && startCap.equals(that.startCap) && endCap.equals(that.endCap) && visible.equals(that.visible) && width.equals(that.width) && zIndex.equals(that.zIndex); + return polylineId.equals(that.polylineId) + && consumesTapEvents.equals(that.consumesTapEvents) + && color.equals(that.color) + && geodesic.equals(that.geodesic) + && jointType.equals(that.jointType) + && patterns.equals(that.patterns) + && points.equals(that.points) + && startCap.equals(that.startCap) + && endCap.equals(that.endCap) + && visible.equals(that.visible) + && width.equals(that.width) + && zIndex.equals(that.zIndex); } @Override public int hashCode() { - return Objects.hash(polylineId, consumesTapEvents, color, geodesic, jointType, patterns, points, startCap, endCap, visible, width, zIndex); + return Objects.hash( + polylineId, + consumesTapEvents, + color, + geodesic, + jointType, + patterns, + points, + startCap, + endCap, + visible, + width, + zIndex); } public static final class Builder { @@ -2640,8 +2805,12 @@ public void setCustomCap(@Nullable PlatformCustomCap 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; + } PlatformCap that = (PlatformCap) o; return type.equals(that.type) && Objects.equals(customCap, that.customCap); } @@ -2728,8 +2897,12 @@ public void setRefWidth(@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; + } PlatformCustomCap that = (PlatformCustomCap) o; return bitmapDescriptor.equals(that.bitmapDescriptor) && refWidth.equals(that.refWidth); } @@ -2786,7 +2959,7 @@ ArrayList toList() { /** * Pigeon equivalent of the PatternItem 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 PlatformPatternItem { private @NonNull PlatformPatternItemType type; @@ -2817,8 +2990,12 @@ public void setLength(@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; + } PlatformPatternItem that = (PlatformPatternItem) o; return type.equals(that.type) && Objects.equals(length, that.length); } @@ -2875,7 +3052,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; @@ -2919,10 +3096,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 @@ -2991,7 +3174,7 @@ 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 { private @NonNull String tileOverlayId; @@ -3077,10 +3260,19 @@ public void setTileSize(@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; + } PlatformTileOverlay that = (PlatformTileOverlay) o; - return tileOverlayId.equals(that.tileOverlayId) && fadeIn.equals(that.fadeIn) && transparency.equals(that.transparency) && zIndex.equals(that.zIndex) && visible.equals(that.visible) && tileSize.equals(that.tileSize); + return tileOverlayId.equals(that.tileOverlayId) + && fadeIn.equals(that.fadeIn) + && transparency.equals(that.transparency) + && zIndex.equals(that.zIndex) + && visible.equals(that.visible) + && tileSize.equals(that.tileSize); } @Override @@ -3183,7 +3375,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; @@ -3243,10 +3435,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 @@ -3325,7 +3524,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; @@ -3359,8 +3558,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); } @@ -3417,7 +3620,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; @@ -3451,8 +3654,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); } @@ -3509,7 +3716,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; @@ -3569,10 +3776,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 @@ -3651,10 +3865,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; @@ -3669,8 +3883,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); } @@ -3715,7 +3933,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; @@ -3840,15 +4058,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 { @@ -3920,7 +4159,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; } @@ -3955,7 +4195,8 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformMapViewCreationParams fromList(@NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformMapViewCreationParams fromList( + @NonNull ArrayList pigeonVar_list) { PlatformMapViewCreationParams pigeonResult = new PlatformMapViewCreationParams(); Object initialCameraPosition = pigeonVar_list.get(0); pigeonResult.setInitialCameraPosition((PlatformCameraPosition) initialCameraPosition); @@ -3982,7 +4223,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; @@ -4187,15 +4428,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 { @@ -4211,7 +4495,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; } @@ -4461,7 +4746,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; @@ -4495,8 +4780,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); } @@ -4553,7 +4842,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; @@ -4613,10 +4902,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 @@ -4695,7 +4991,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; @@ -4720,8 +5016,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); } @@ -4795,8 +5095,12 @@ public void setBitmap(@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; + } PlatformBitmap that = (PlatformBitmap) o; return bitmap.equals(that.bitmap); } @@ -4852,8 +5156,12 @@ public void setHue(@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; + } PlatformBitmapDefaultMarker that = (PlatformBitmapDefaultMarker) o; return Objects.equals(hue, that.hue); } @@ -4887,7 +5195,8 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformBitmapDefaultMarker fromList(@NonNull ArrayList pigeonVar_list) { + static @NonNull PlatformBitmapDefaultMarker fromList( + @NonNull ArrayList pigeonVar_list) { PlatformBitmapDefaultMarker pigeonResult = new PlatformBitmapDefaultMarker(); Object hue = pigeonVar_list.get(0); pigeonResult.setHue((Double) hue); @@ -4925,8 +5234,12 @@ public void setSize(@Nullable 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; + } PlatformBitmapBytes that = (PlatformBitmapBytes) o; return Arrays.equals(byteData, that.byteData) && Objects.equals(size, that.size); } @@ -5012,8 +5325,12 @@ public void setPkg(@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; + } PlatformBitmapAsset that = (PlatformBitmapAsset) o; return name.equals(that.name) && Objects.equals(pkg, that.pkg); } @@ -5110,8 +5427,12 @@ public void setSize(@Nullable 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; + } PlatformBitmapAssetImage that = (PlatformBitmapAssetImage) o; return name.equals(that.name) && scale.equals(that.scale) && Objects.equals(size, that.size); } @@ -5243,10 +5564,18 @@ public void setHeight(@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; + } PlatformBitmapAssetMap that = (PlatformBitmapAssetMap) o; - return assetName.equals(that.assetName) && bitmapScaling.equals(that.bitmapScaling) && imagePixelRatio.equals(that.imagePixelRatio) && Objects.equals(width, that.width) && Objects.equals(height, that.height); + return assetName.equals(that.assetName) + && bitmapScaling.equals(that.bitmapScaling) + && imagePixelRatio.equals(that.imagePixelRatio) + && Objects.equals(width, that.width) + && Objects.equals(height, that.height); } @Override @@ -5400,10 +5729,18 @@ public void setHeight(@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; + } PlatformBitmapBytesMap that = (PlatformBitmapBytesMap) o; - return Arrays.equals(byteData, that.byteData) && bitmapScaling.equals(that.bitmapScaling) && imagePixelRatio.equals(that.imagePixelRatio) && Objects.equals(width, that.width) && Objects.equals(height, that.height); + return Arrays.equals(byteData, that.byteData) + && bitmapScaling.equals(that.bitmapScaling) + && imagePixelRatio.equals(that.imagePixelRatio) + && Objects.equals(width, that.width) + && Objects.equals(height, that.height); } @Override @@ -5501,40 +5838,52 @@ private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 129: { - Object value = readValue(buffer); - return value == null ? null : PlatformMapType.values()[((Long) value).intValue()]; - } - case (byte) 130: { - Object value = readValue(buffer); - return value == null ? null : PlatformRendererType.values()[((Long) value).intValue()]; - } - case (byte) 131: { - Object value = readValue(buffer); - return value == null ? null : PlatformJointType.values()[((Long) value).intValue()]; - } - case (byte) 132: { - Object value = readValue(buffer); - return value == null ? null : PlatformCapType.values()[((Long) value).intValue()]; - } - case (byte) 133: { - Object value = readValue(buffer); - return value == null ? null : PlatformPatternItemType.values()[((Long) value).intValue()]; - } - case (byte) 134: { - Object value = readValue(buffer); - return value == null ? null : PlatformMapBitmapScaling.values()[((Long) value).intValue()]; - } + case (byte) 129: + { + Object value = readValue(buffer); + return value == null ? null : PlatformMapType.values()[((Long) value).intValue()]; + } + case (byte) 130: + { + Object value = readValue(buffer); + return value == null ? null : PlatformRendererType.values()[((Long) value).intValue()]; + } + case (byte) 131: + { + Object value = readValue(buffer); + return value == null ? null : PlatformJointType.values()[((Long) value).intValue()]; + } + case (byte) 132: + { + Object value = readValue(buffer); + return value == null ? null : PlatformCapType.values()[((Long) value).intValue()]; + } + case (byte) 133: + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformPatternItemType.values()[((Long) value).intValue()]; + } + case (byte) 134: + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformMapBitmapScaling.values()[((Long) value).intValue()]; + } case (byte) 135: return PlatformCameraPosition.fromList((ArrayList) readValue(buffer)); case (byte) 136: return PlatformCameraUpdate.fromList((ArrayList) readValue(buffer)); case (byte) 137: - return PlatformCameraUpdateNewCameraPosition.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateNewCameraPosition.fromList( + (ArrayList) readValue(buffer)); case (byte) 138: return PlatformCameraUpdateNewLatLng.fromList((ArrayList) readValue(buffer)); case (byte) 139: - return PlatformCameraUpdateNewLatLngBounds.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateNewLatLngBounds.fromList( + (ArrayList) readValue(buffer)); case (byte) 140: return PlatformCameraUpdateNewLatLngZoom.fromList((ArrayList) readValue(buffer)); case (byte) 141: @@ -5756,7 +6105,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. */ @@ -5784,9 +6132,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. */ @@ -5794,70 +6142,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); @@ -5868,16 +6228,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) -> { @@ -5904,7 +6271,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) -> { @@ -5914,8 +6284,7 @@ public void error(Throwable error) { try { api.updateMapConfiguration(configurationArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5927,7 +6296,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) -> { @@ -5939,8 +6311,7 @@ public void error(Throwable error) { try { api.updateCircles(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5952,7 +6323,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) -> { @@ -5964,8 +6338,7 @@ public void error(Throwable error) { try { api.updateHeatmaps(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -5977,7 +6350,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) -> { @@ -5988,8 +6364,7 @@ public void error(Throwable error) { try { api.updateClusterManagers(toAddArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6001,7 +6376,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) -> { @@ -6013,8 +6391,7 @@ public void error(Throwable error) { try { api.updateMarkers(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6026,7 +6403,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) -> { @@ -6038,8 +6418,7 @@ public void error(Throwable error) { try { api.updatePolygons(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6051,7 +6430,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) -> { @@ -6063,8 +6445,7 @@ public void error(Throwable error) { try { api.updatePolylines(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6076,7 +6457,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) -> { @@ -6088,8 +6472,7 @@ public void error(Throwable error) { try { api.updateTileOverlays(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6101,7 +6484,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) -> { @@ -6111,8 +6497,7 @@ public void error(Throwable error) { try { PlatformPoint output = api.getScreenCoordinate(latLngArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6124,7 +6509,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) -> { @@ -6134,8 +6522,7 @@ public void error(Throwable error) { try { PlatformLatLng output = api.getLatLng(screenCoordinateArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6147,7 +6534,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) -> { @@ -6155,8 +6545,7 @@ public void error(Throwable error) { try { PlatformLatLngBounds output = api.getVisibleRegion(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6168,7 +6557,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) -> { @@ -6178,8 +6570,7 @@ public void error(Throwable error) { try { api.moveCamera(cameraUpdateArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6191,7 +6582,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) -> { @@ -6201,8 +6595,7 @@ public void error(Throwable error) { try { api.animateCamera(cameraUpdateArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6214,7 +6607,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) -> { @@ -6222,8 +6618,7 @@ public void error(Throwable error) { try { Double output = api.getZoomLevel(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6235,7 +6630,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) -> { @@ -6245,8 +6643,7 @@ public void error(Throwable error) { try { api.showInfoWindow(markerIdArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6258,7 +6655,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) -> { @@ -6268,8 +6668,7 @@ public void error(Throwable error) { try { api.hideInfoWindow(markerIdArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6281,7 +6680,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) -> { @@ -6291,8 +6693,7 @@ public void error(Throwable error) { try { Boolean output = api.isInfoWindowShown(markerIdArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6304,7 +6705,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) -> { @@ -6314,8 +6718,7 @@ public void error(Throwable error) { try { Boolean output = api.setStyle(styleArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6327,7 +6730,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) -> { @@ -6335,8 +6741,7 @@ public void error(Throwable error) { try { Boolean output = api.didLastStyleSucceed(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6348,7 +6753,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) -> { @@ -6358,8 +6766,7 @@ public void error(Throwable error) { try { api.clearTileCache(tileOverlayIdArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6371,7 +6778,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) -> { @@ -6405,368 +6815,439 @@ 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. - * The codec used by MapsCallbackApi. - */ + /** 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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), listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), 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) -> { @@ -6795,11 +7276,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 { @@ -6809,16 +7289,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) -> { @@ -6828,8 +7318,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { api.createView(typeArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6843,66 +7332,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) -> { @@ -6910,8 +7408,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6923,7 +7420,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) -> { @@ -6931,8 +7431,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6944,7 +7443,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) -> { @@ -6952,8 +7454,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6965,7 +7466,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) -> { @@ -6973,8 +7477,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -6986,7 +7489,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) -> { @@ -6994,8 +7500,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -7007,7 +7512,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) -> { @@ -7015,8 +7523,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -7028,7 +7535,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) -> { @@ -7036,8 +7546,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -7049,7 +7558,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) -> { @@ -7057,8 +7569,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -7070,7 +7581,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) -> { @@ -7078,8 +7592,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -7091,7 +7604,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) -> { @@ -7099,8 +7615,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -7112,7 +7627,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) -> { @@ -7120,8 +7638,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -7133,7 +7650,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) -> { @@ -7143,8 +7663,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -7156,7 +7675,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) -> { @@ -7164,8 +7686,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) { wrapped = wrapError(exception); } reply.reply(wrapped); @@ -7177,7 +7698,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) -> { @@ -7187,8 +7711,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) { wrapped = wrapError(exception); } reply.reply(wrapped); 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 cf9c943ce8a3..2d596b8c9401 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 @@ -28,12 +28,9 @@ 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.After; import org.junit.Before; @@ -185,16 +182,21 @@ private Messages.PlatformMarker createPlatformMarker( 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.PlatformBitmap icon = + new Messages.PlatformBitmap.Builder() + .setBitmap( + new Messages.PlatformBitmapBytesMap.Builder() + .setByteData(byteArray) + .setImagePixelRatio(1.0) + .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) + .build()) + .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(null)//Arrays.asList("bytes", byteData)) + .setIcon(icon) .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/ConvertTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java index 12acd2735b3d..0e41c977c7e3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java @@ -44,7 +44,6 @@ import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.After; @@ -140,26 +139,24 @@ public void ConvertClusterToPigeonReturnsCorrectData() { public void GetBitmapFromAssetAuto() throws Exception { String fakeAssetName = "fake_asset_name"; String fakeAssetKey = "fake_asset_key"; - Map assetDetails = new HashMap<>(); - assetDetails.put("assetName", fakeAssetName); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("width", 15.0f); - assetDetails.put("height", 15.0f); - assetDetails.put("imagePixelRatio", 2.0f); when(flutterInjectorWrapper.getLookupKeyForAsset(fakeAssetName)).thenReturn(fakeAssetKey); when(assetManager.open(fakeAssetKey)).thenReturn(buildImageInputStream()); when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapAssetMap bitmap = + new Messages.PlatformBitmapAssetMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .setWidth(15.0) + .setHeight(15.0) + .setImagePixelRatio(2.0) + .setAssetName(fakeAssetName) + .build(); BitmapDescriptor result = Convert.getBitmapFromAsset( - null, //assetDetails, - assetManager, - 1.0f, - bitmapDescriptorFactoryWrapper, - flutterInjectorWrapper); + bitmap, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, flutterInjectorWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -169,27 +166,22 @@ public void GetBitmapFromAssetAutoAndWidth() throws Exception { String fakeAssetName = "fake_asset_name"; String fakeAssetKey = "fake_asset_key"; - Map assetDetails = new HashMap<>(); - assetDetails.put("assetName", fakeAssetName); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("width", 15.0f); - assetDetails.put("imagePixelRatio", 2.0f); - - Messages.PlatformBitmapAssetMap platformBitmap = new Messages.PlatformBitmapAssetMap.Builder().setAssetName(fakeAssetName).setWidth(15.0).setImagePixelRatio(2.0).setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO).build(); - when(flutterInjectorWrapper.getLookupKeyForAsset(fakeAssetName)).thenReturn(fakeAssetKey); when(assetManager.open(fakeAssetKey)).thenReturn(buildImageInputStream()); when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapAssetMap bitmap = + new Messages.PlatformBitmapAssetMap.Builder() + .setAssetName(fakeAssetName) + .setWidth(15.0) + .setImagePixelRatio(2.0) + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .build(); BitmapDescriptor result = Convert.getBitmapFromAsset( - platformBitmap, - assetManager, - 1.0f, - bitmapDescriptorFactoryWrapper, - flutterInjectorWrapper); + bitmap, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, flutterInjectorWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -199,25 +191,22 @@ public void GetBitmapFromAssetAutoAndHeight() throws Exception { String fakeAssetName = "fake_asset_name"; String fakeAssetKey = "fake_asset_key"; - Map assetDetails = new HashMap<>(); - assetDetails.put("assetName", fakeAssetName); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("height", 15.0f); - assetDetails.put("imagePixelRatio", 2.0f); - when(flutterInjectorWrapper.getLookupKeyForAsset(fakeAssetName)).thenReturn(fakeAssetKey); when(assetManager.open(fakeAssetKey)).thenReturn(buildImageInputStream()); when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapAssetMap bitmap = + new Messages.PlatformBitmapAssetMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .setHeight(15.0) + .setImagePixelRatio(2.0) + .setAssetName(fakeAssetName) + .build(); BitmapDescriptor result = Convert.getBitmapFromAsset( - null, //assetDetails, - assetManager, - 1.0f, - bitmapDescriptorFactoryWrapper, - flutterInjectorWrapper); + bitmap, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, flutterInjectorWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -227,11 +216,6 @@ public void GetBitmapFromAssetNoScaling() throws Exception { String fakeAssetName = "fake_asset_name"; String fakeAssetKey = "fake_asset_key"; - Map assetDetails = new HashMap<>(); - assetDetails.put("assetName", fakeAssetName); - assetDetails.put("bitmapScaling", "noScaling"); - assetDetails.put("imagePixelRatio", 2.0f); - when(flutterInjectorWrapper.getLookupKeyForAsset(fakeAssetName)).thenReturn(fakeAssetKey); when(assetManager.open(fakeAssetKey)).thenReturn(buildImageInputStream()); @@ -239,14 +223,16 @@ public void GetBitmapFromAssetNoScaling() throws Exception { when(bitmapDescriptorFactoryWrapper.fromAsset(any())).thenReturn(mockBitmapDescriptor); verify(bitmapDescriptorFactoryWrapper, never()).fromBitmap(any()); + Messages.PlatformBitmapAssetMap bitmap = + new Messages.PlatformBitmapAssetMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) + .setImagePixelRatio(2.0) + .setAssetName(fakeAssetName) + .build(); BitmapDescriptor result = Convert.getBitmapFromAsset( - null, //assetDetails, - assetManager, - 1.0f, - bitmapDescriptorFactoryWrapper, - flutterInjectorWrapper); + bitmap, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, flutterInjectorWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -255,15 +241,17 @@ public void GetBitmapFromAssetNoScaling() throws Exception { public void GetBitmapFromBytesAuto() { byte[] bmpData = Base64.decode(base64Image, Base64.DEFAULT); - Map assetDetails = new HashMap<>(); - assetDetails.put("byteData", bmpData); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("imagePixelRatio", 2.0f); - when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapBytesMap bitmap = + new Messages.PlatformBitmapBytesMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .setImagePixelRatio(2.0) + .setByteData(bmpData) + .build(); + BitmapDescriptor result = - Convert.getBitmapFromBytes(null, /*assetDetails, */1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(bitmap, 1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -272,16 +260,17 @@ public void GetBitmapFromBytesAuto() { public void GetBitmapFromBytesAutoAndWidth() { byte[] bmpData = Base64.decode(base64Image, Base64.DEFAULT); - Map assetDetails = new HashMap<>(); - assetDetails.put("byteData", bmpData); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("imagePixelRatio", 2.0f); - assetDetails.put("width", 15.0f); - when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapBytesMap bitmap = + new Messages.PlatformBitmapBytesMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .setImagePixelRatio(2.0) + .setByteData(bmpData) + .setWidth(15.0) + .build(); BitmapDescriptor result = - Convert.getBitmapFromBytes(null, /*assetDetails, */ 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(bitmap, 1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -290,16 +279,17 @@ public void GetBitmapFromBytesAutoAndWidth() { public void GetBitmapFromBytesAutoAndHeight() { byte[] bmpData = Base64.decode(base64Image, Base64.DEFAULT); - Map assetDetails = new HashMap<>(); - assetDetails.put("byteData", bmpData); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("imagePixelRatio", 2.0f); - assetDetails.put("height", 15.0f); - when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapBytesMap bitmap = + new Messages.PlatformBitmapBytesMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .setImagePixelRatio(2.0) + .setByteData(bmpData) + .setHeight(15.0) + .build(); BitmapDescriptor result = - Convert.getBitmapFromBytes(null, /*assetDetails, */1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(bitmap, 1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -308,15 +298,16 @@ public void GetBitmapFromBytesAutoAndHeight() { public void GetBitmapFromBytesNoScaling() { byte[] bmpData = Base64.decode(base64Image, Base64.DEFAULT); - Map assetDetails = new HashMap<>(); - assetDetails.put("byteData", bmpData); - assetDetails.put("bitmapScaling", "noScaling"); - assetDetails.put("imagePixelRatio", 2.0f); - when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapBytesMap bitmap = + new Messages.PlatformBitmapBytesMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) + .setImagePixelRatio(2.0) + .setByteData(bmpData) + .build(); BitmapDescriptor result = - Convert.getBitmapFromBytes(null, /*assetDetails, */1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(bitmap, 1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -326,15 +317,16 @@ public void GetBitmapFromBytesThrowsErrorIfInvalidImageData() { String invalidBase64Image = "not valid image data"; byte[] bmpData = Base64.decode(invalidBase64Image, Base64.DEFAULT); - Map assetDetails = new HashMap<>(); - assetDetails.put("byteData", bmpData); - assetDetails.put("bitmapScaling", "noScaling"); - assetDetails.put("imagePixelRatio", 2.0f); - verify(bitmapDescriptorFactoryWrapper, never()).fromBitmap(any()); + Messages.PlatformBitmapBytesMap bitmap = + new Messages.PlatformBitmapBytesMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) + .setImagePixelRatio(2.0) + .setByteData(bmpData) + .build(); try { - Convert.getBitmapFromBytes(null, /*assetDetails, */1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(bitmap, 1f, bitmapDescriptorFactoryWrapper); } catch (IllegalArgumentException e) { Assert.assertEquals(e.getMessage(), "Unable to interpret bytes as a valid image."); throw e; // rethrow the exception 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 bbbe883ef8a5..b32a82ab5c2f 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,8 @@ 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 java.util.Map; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -62,10 +59,15 @@ private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { 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.PlatformBitmap icon = + new Messages.PlatformBitmap.Builder() + .setBitmap( + new Messages.PlatformBitmapBytesMap.Builder() + .setByteData(byteArray) + .setImagePixelRatio(1.0) + .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) + .build()) + .build(); Messages.PlatformOffset anchor = new Messages.PlatformOffset.Builder().setDx(0.5).setDy(0.0).build(); Messages.PlatformInfoWindow infoWindow = @@ -81,8 +83,7 @@ private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { .setRotation(0.0) .setZIndex(0.0) .setConsumeTapEvents(false) - // TODO construct bitmap - .setIcon(null)//Arrays.asList("bytes", byteData)) + .setIcon(icon) .setInfoWindow(infoWindow); } 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 c91b109c864c..ee8bb4a79ee6 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 @@ -857,33 +857,64 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { } } - static PlatformMapBitmapScaling platformMapBitmapScalingFromScaling(MapBitmapScaling scaling) { - switch(scaling) { + static PlatformMapBitmapScaling platformMapBitmapScalingFromScaling( + MapBitmapScaling scaling) { + switch (scaling) { case MapBitmapScaling.auto: - return PlatformMapBitmapScaling.auto; + return PlatformMapBitmapScaling.auto; case MapBitmapScaling.none: - return PlatformMapBitmapScaling.none; + return PlatformMapBitmapScaling.none; } + /// MapBitmapScaling is defined in the platform interface. return PlatformMapBitmapScaling.auto; } - static PlatformBitmap platformBitmapFromBitmapDescriptor(BitmapDescriptor bitmap) { - switch(bitmap) { + static PlatformBitmap platformBitmapFromBitmapDescriptor( + BitmapDescriptor bitmap) { + switch (bitmap) { case final DefaultMarker marker: - return PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble())); + return PlatformBitmap( + bitmap: PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble())); case final BytesBitmap bytes: - return PlatformBitmap(bitmap: PlatformBitmapBytes(byteData: bytes.byteData, size: (bytes.size == null) ? null : _platformOffsetFromSize(bytes.size!))); + return PlatformBitmap( + bitmap: PlatformBitmapBytes( + byteData: bytes.byteData, + size: (bytes.size == null) + ? null + : _platformOffsetFromSize(bytes.size!))); case final AssetBitmap asset: - return PlatformBitmap(bitmap: PlatformBitmapAsset(name: asset.name, pkg: asset.package)); + return PlatformBitmap( + bitmap: PlatformBitmapAsset(name: asset.name, pkg: asset.package)); case final AssetImageBitmap asset: - return PlatformBitmap(bitmap: PlatformBitmapAssetImage(name: asset.name, scale: asset.scale, size: (asset.size == null) ? null : _platformOffsetFromSize(asset.size!))); + return PlatformBitmap( + bitmap: PlatformBitmapAssetImage( + name: asset.name, + scale: asset.scale, + size: (asset.size == null) + ? null + : _platformOffsetFromSize(asset.size!))); case final AssetMapBitmap asset: - return PlatformBitmap(bitmap: PlatformBitmapAssetMap(assetName: asset.assetName, bitmapScaling: platformMapBitmapScalingFromScaling(asset.bitmapScaling), imagePixelRatio: asset.imagePixelRatio, width: asset.width, height: asset.height)); + return PlatformBitmap( + bitmap: PlatformBitmapAssetMap( + assetName: asset.assetName, + bitmapScaling: + platformMapBitmapScalingFromScaling(asset.bitmapScaling), + imagePixelRatio: asset.imagePixelRatio, + width: asset.width, + height: asset.height)); case final BytesMapBitmap bytes: - return PlatformBitmap(bitmap: PlatformBitmapBytesMap(byteData: bytes.byteData, bitmapScaling: platformMapBitmapScalingFromScaling(bytes.bitmapScaling), imagePixelRatio: bytes.imagePixelRatio, width: bytes.width, height: bytes.height)); + return PlatformBitmap( + bitmap: PlatformBitmapBytesMap( + byteData: bytes.byteData, + bitmapScaling: + platformMapBitmapScalingFromScaling(bytes.bitmapScaling), + imagePixelRatio: bytes.imagePixelRatio, + width: bytes.width, + height: bytes.height)); default: - throw ArgumentError('Unrecognized type of bitmap ${bitmap.runtimeType}', 'bitmap'); + throw ArgumentError( + 'Unrecognized type of bitmap ${bitmap.runtimeType}', 'bitmap'); } } @@ -898,7 +929,12 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { return PlatformCap(type: PlatformCapType.round); case CapType.custom: cap as CustomCap; - return PlatformCap(type: PlatformCapType.custom, customCap: PlatformCustomCap(bitmapDescriptor: platformBitmapFromBitmapDescriptor(cap.bitmapDescriptor), refWidth: cap.refWidth)); + return PlatformCap( + type: PlatformCapType.custom, + customCap: PlatformCustomCap( + bitmapDescriptor: + platformBitmapFromBitmapDescriptor(cap.bitmapDescriptor), + refWidth: cap.refWidth)); } } } 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 a8eca3741d02..0864c70af744 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 []; } @@ -1090,10 +1091,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(), ); } } @@ -1513,7 +1517,6 @@ class PlatformBitmapBytesMap { } } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -1521,142 +1524,142 @@ class _PigeonCodec extends StandardMessageCodec { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is PlatformMapType) { + } else if (value is PlatformMapType) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is PlatformRendererType) { + } else if (value is PlatformRendererType) { buffer.putUint8(130); writeValue(buffer, value.index); - } else if (value is PlatformJointType) { + } else if (value is PlatformJointType) { buffer.putUint8(131); writeValue(buffer, value.index); - } else if (value is PlatformCapType) { + } else if (value is PlatformCapType) { buffer.putUint8(132); writeValue(buffer, value.index); - } else if (value is PlatformPatternItemType) { + } else if (value is PlatformPatternItemType) { buffer.putUint8(133); writeValue(buffer, value.index); - } else if (value is PlatformMapBitmapScaling) { + } else if (value is PlatformMapBitmapScaling) { buffer.putUint8(134); writeValue(buffer, value.index); - } else if (value is PlatformCameraPosition) { + } else if (value is PlatformCameraPosition) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdate) { + } else if (value is PlatformCameraUpdate) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateNewCameraPosition) { + } else if (value is PlatformCameraUpdateNewCameraPosition) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateNewLatLng) { + } else if (value is PlatformCameraUpdateNewLatLng) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateNewLatLngBounds) { + } else if (value is PlatformCameraUpdateNewLatLngBounds) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateNewLatLngZoom) { + } else if (value is PlatformCameraUpdateNewLatLngZoom) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateScrollBy) { + } else if (value is PlatformCameraUpdateScrollBy) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateZoomBy) { + } else if (value is PlatformCameraUpdateZoomBy) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateZoom) { + } else if (value is PlatformCameraUpdateZoom) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdateZoomTo) { + } else if (value is PlatformCameraUpdateZoomTo) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PlatformCircle) { + } else if (value is PlatformCircle) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is PlatformHeatmap) { + } else if (value is PlatformHeatmap) { buffer.putUint8(146); writeValue(buffer, value.encode()); - } else if (value is PlatformClusterManager) { + } else if (value is PlatformClusterManager) { buffer.putUint8(147); writeValue(buffer, value.encode()); - } else if (value is PlatformOffset) { + } else if (value is PlatformOffset) { buffer.putUint8(148); writeValue(buffer, value.encode()); - } else if (value is PlatformInfoWindow) { + } else if (value is PlatformInfoWindow) { buffer.putUint8(149); writeValue(buffer, value.encode()); - } else if (value is PlatformMarker) { + } else if (value is PlatformMarker) { buffer.putUint8(150); writeValue(buffer, value.encode()); - } else if (value is PlatformPolygon) { + } else if (value is PlatformPolygon) { buffer.putUint8(151); writeValue(buffer, value.encode()); - } else if (value is PlatformPolyline) { + } else if (value is PlatformPolyline) { buffer.putUint8(152); writeValue(buffer, value.encode()); - } else if (value is PlatformCap) { + } else if (value is PlatformCap) { buffer.putUint8(153); writeValue(buffer, value.encode()); - } else if (value is PlatformCustomCap) { + } else if (value is PlatformCustomCap) { buffer.putUint8(154); writeValue(buffer, value.encode()); - } else if (value is PlatformPatternItem) { + } else if (value is PlatformPatternItem) { buffer.putUint8(155); writeValue(buffer, value.encode()); - } else if (value is PlatformTile) { + } else if (value is PlatformTile) { buffer.putUint8(156); writeValue(buffer, value.encode()); - } else if (value is PlatformTileOverlay) { + } else if (value is PlatformTileOverlay) { buffer.putUint8(157); writeValue(buffer, value.encode()); - } else if (value is PlatformEdgeInsets) { + } else if (value is PlatformEdgeInsets) { buffer.putUint8(158); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLng) { + } else if (value is PlatformLatLng) { buffer.putUint8(159); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLngBounds) { + } else if (value is PlatformLatLngBounds) { buffer.putUint8(160); writeValue(buffer, value.encode()); - } else if (value is PlatformCluster) { + } else if (value is PlatformCluster) { buffer.putUint8(161); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraTargetBounds) { + } else if (value is PlatformCameraTargetBounds) { buffer.putUint8(162); writeValue(buffer, value.encode()); - } else if (value is PlatformMapViewCreationParams) { + } else if (value is PlatformMapViewCreationParams) { buffer.putUint8(163); writeValue(buffer, value.encode()); - } else if (value is PlatformMapConfiguration) { + } else if (value is PlatformMapConfiguration) { buffer.putUint8(164); writeValue(buffer, value.encode()); - } else if (value is PlatformPoint) { + } else if (value is PlatformPoint) { buffer.putUint8(165); writeValue(buffer, value.encode()); - } else if (value is PlatformTileLayer) { + } else if (value is PlatformTileLayer) { buffer.putUint8(166); writeValue(buffer, value.encode()); - } else if (value is PlatformZoomRange) { + } else if (value is PlatformZoomRange) { buffer.putUint8(167); writeValue(buffer, value.encode()); - } else if (value is PlatformBitmap) { + } else if (value is PlatformBitmap) { buffer.putUint8(168); writeValue(buffer, value.encode()); - } else if (value is PlatformBitmapDefaultMarker) { + } else if (value is PlatformBitmapDefaultMarker) { buffer.putUint8(169); writeValue(buffer, value.encode()); - } else if (value is PlatformBitmapBytes) { + } else if (value is PlatformBitmapBytes) { buffer.putUint8(170); writeValue(buffer, value.encode()); - } else if (value is PlatformBitmapAsset) { + } else if (value is PlatformBitmapAsset) { buffer.putUint8(171); writeValue(buffer, value.encode()); - } else if (value is PlatformBitmapAssetImage) { + } else if (value is PlatformBitmapAssetImage) { buffer.putUint8(172); writeValue(buffer, value.encode()); - } else if (value is PlatformBitmapAssetMap) { + } else if (value is PlatformBitmapAssetMap) { buffer.putUint8(173); writeValue(buffer, value.encode()); - } else if (value is PlatformBitmapBytesMap) { + } else if (value is PlatformBitmapBytesMap) { buffer.putUint8(174); writeValue(buffer, value.encode()); } else { @@ -1667,103 +1670,103 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformMapType.values[value]; - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformRendererType.values[value]; - case 131: + case 131: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformJointType.values[value]; - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformCapType.values[value]; - case 133: + case 133: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformPatternItemType.values[value]; - case 134: + case 134: final int? value = readValue(buffer) as int?; return value == null ? null : PlatformMapBitmapScaling.values[value]; - case 135: + case 135: return PlatformCameraPosition.decode(readValue(buffer)!); - case 136: + case 136: return PlatformCameraUpdate.decode(readValue(buffer)!); - case 137: + case 137: return PlatformCameraUpdateNewCameraPosition.decode(readValue(buffer)!); - case 138: + case 138: return PlatformCameraUpdateNewLatLng.decode(readValue(buffer)!); - case 139: + case 139: return PlatformCameraUpdateNewLatLngBounds.decode(readValue(buffer)!); - case 140: + case 140: return PlatformCameraUpdateNewLatLngZoom.decode(readValue(buffer)!); - case 141: + case 141: return PlatformCameraUpdateScrollBy.decode(readValue(buffer)!); - case 142: + case 142: return PlatformCameraUpdateZoomBy.decode(readValue(buffer)!); - case 143: + case 143: return PlatformCameraUpdateZoom.decode(readValue(buffer)!); - case 144: + case 144: return PlatformCameraUpdateZoomTo.decode(readValue(buffer)!); - case 145: + case 145: return PlatformCircle.decode(readValue(buffer)!); - case 146: + case 146: return PlatformHeatmap.decode(readValue(buffer)!); - case 147: + case 147: return PlatformClusterManager.decode(readValue(buffer)!); - case 148: + case 148: return PlatformOffset.decode(readValue(buffer)!); - case 149: + case 149: return PlatformInfoWindow.decode(readValue(buffer)!); - case 150: + case 150: return PlatformMarker.decode(readValue(buffer)!); - case 151: + case 151: return PlatformPolygon.decode(readValue(buffer)!); - case 152: + case 152: return PlatformPolyline.decode(readValue(buffer)!); - case 153: + case 153: return PlatformCap.decode(readValue(buffer)!); - case 154: + case 154: return PlatformCustomCap.decode(readValue(buffer)!); - case 155: + case 155: return PlatformPatternItem.decode(readValue(buffer)!); - case 156: + case 156: return PlatformTile.decode(readValue(buffer)!); - case 157: + case 157: return PlatformTileOverlay.decode(readValue(buffer)!); - case 158: + case 158: return PlatformEdgeInsets.decode(readValue(buffer)!); - case 159: + case 159: return PlatformLatLng.decode(readValue(buffer)!); - case 160: + case 160: return PlatformLatLngBounds.decode(readValue(buffer)!); - case 161: + case 161: return PlatformCluster.decode(readValue(buffer)!); - case 162: + case 162: return PlatformCameraTargetBounds.decode(readValue(buffer)!); - case 163: + case 163: return PlatformMapViewCreationParams.decode(readValue(buffer)!); - case 164: + case 164: return PlatformMapConfiguration.decode(readValue(buffer)!); - case 165: + case 165: return PlatformPoint.decode(readValue(buffer)!); - case 166: + case 166: return PlatformTileLayer.decode(readValue(buffer)!); - case 167: + case 167: return PlatformZoomRange.decode(readValue(buffer)!); - case 168: + case 168: return PlatformBitmap.decode(readValue(buffer)!); - case 169: + case 169: return PlatformBitmapDefaultMarker.decode(readValue(buffer)!); - case 170: + case 170: return PlatformBitmapBytes.decode(readValue(buffer)!); - case 171: + case 171: return PlatformBitmapAsset.decode(readValue(buffer)!); - case 172: + case 172: return PlatformBitmapAssetImage.decode(readValue(buffer)!); - case 173: + case 173: return PlatformBitmapAssetMap.decode(readValue(buffer)!); - case 174: + case 174: return PlatformBitmapBytesMap.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1780,7 +1783,8 @@ class MapsApi { /// BinaryMessenger will be used which routes to the host platform. MapsApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -1789,8 +1793,10 @@ class MapsApi { /// Returns once the map instance is available. Future waitForMap() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -1814,15 +1820,18 @@ 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 pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + Future updateMapConfiguration( + PlatformMapConfiguration configuration) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([configuration]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([configuration]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1837,15 +1846,18 @@ class MapsApi { } /// Updates the set of circles on the map. - Future updateCircles(List toAdd, List toChange, List idsToRemove) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + Future updateCircles(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1860,15 +1872,18 @@ class MapsApi { } /// Updates the set of heatmaps on the map. - Future updateHeatmaps(List toAdd, List toChange, List idsToRemove) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + Future updateHeatmaps(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1883,15 +1898,18 @@ class MapsApi { } /// Updates the set of custer managers for clusters on the map. - Future updateClusterManagers(List toAdd, List idsToRemove) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + Future updateClusterManagers( + List toAdd, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([toAdd, idsToRemove]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([toAdd, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1906,15 +1924,18 @@ class MapsApi { } /// Updates the set of markers on the map. - Future updateMarkers(List toAdd, List toChange, List idsToRemove) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + Future updateMarkers(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1929,15 +1950,18 @@ class MapsApi { } /// Updates the set of polygonss on the map. - Future updatePolygons(List toAdd, List toChange, List idsToRemove) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + Future updatePolygons(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1952,15 +1976,18 @@ class MapsApi { } /// Updates the set of polylines on the map. - Future updatePolylines(List toAdd, List toChange, List idsToRemove) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + Future updatePolylines(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1975,15 +2002,18 @@ class MapsApi { } /// Updates the set of tile overlays on the map. - Future updateTileOverlays(List toAdd, List toChange, List idsToRemove) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + Future updateTileOverlays(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([toAdd, toChange, idsToRemove]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([toAdd, toChange, idsToRemove]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1999,8 +2029,10 @@ class MapsApi { /// Gets the screen coordinate for the given map location. Future getScreenCoordinate(PlatformLatLng latLng) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2027,14 +2059,16 @@ class MapsApi { /// Gets the map location for the given screen coordinate. Future getLatLng(PlatformPoint screenCoordinate) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([screenCoordinate]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([screenCoordinate]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2055,8 +2089,10 @@ class MapsApi { /// Gets the map region currently displayed on the map. Future getVisibleRegion() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2084,8 +2120,10 @@ class MapsApi { /// Moves the camera according to [cameraUpdate] immediately, with no /// animation. Future moveCamera(PlatformCameraUpdate cameraUpdate) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2107,8 +2145,10 @@ class MapsApi { /// Moves the camera according to [cameraUpdate], animating the update. Future animateCamera(PlatformCameraUpdate cameraUpdate) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2130,8 +2170,10 @@ class MapsApi { /// Gets the current map zoom level. Future getZoomLevel() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2158,8 +2200,10 @@ class MapsApi { /// Show the info window for the marker with the given ID. Future showInfoWindow(String markerId) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2181,8 +2225,10 @@ class MapsApi { /// Hide the info window for the marker with the given ID. Future hideInfoWindow(String markerId) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2205,8 +2251,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 pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2237,8 +2285,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 pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2269,8 +2319,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 pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2297,14 +2349,16 @@ class MapsApi { /// Clears the cache of tiles previously requseted from the tile provider. Future clearTileCache(String tileOverlayId) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([tileOverlayId]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([tileOverlayId]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2320,8 +2374,10 @@ class MapsApi { /// Takes a snapshot of the map and returns its image data. Future takeSnapshot() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2393,13 +2449,22 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); @@ -2410,24 +2475,29 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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 { @@ -2435,15 +2505,19 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); @@ -2454,22 +2528,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2479,22 +2557,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2504,22 +2586,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2529,22 +2615,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2557,22 +2647,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2585,22 +2679,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2613,22 +2711,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2638,22 +2740,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2663,22 +2769,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2688,22 +2798,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2713,22 +2827,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2738,22 +2856,26 @@ 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 pigeonVar_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_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, @@ -2765,12 +2887,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())); } }); } @@ -2783,9 +2907,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 = ''}) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -2798,9 +2924,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 pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + Future initializeWithPreferredRenderer( + PlatformRendererType? type) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2833,9 +2962,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 = ''}) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -2843,8 +2974,10 @@ class MapsPlatformViewApi { final String pigeonVar_messageChannelSuffix; Future createView(PlatformMapViewCreationParams? type) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2870,9 +3003,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 = ''}) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -2880,8 +3015,10 @@ class MapsInspectorApi { final String pigeonVar_messageChannelSuffix; Future areBuildingsEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2907,8 +3044,10 @@ class MapsInspectorApi { } Future areRotateGesturesEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2934,8 +3073,10 @@ class MapsInspectorApi { } Future areZoomControlsEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2961,8 +3102,10 @@ class MapsInspectorApi { } Future areScrollGesturesEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -2988,8 +3131,10 @@ class MapsInspectorApi { } Future areTiltGesturesEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -3015,8 +3160,10 @@ class MapsInspectorApi { } Future areZoomGesturesEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -3042,8 +3189,10 @@ class MapsInspectorApi { } Future isCompassEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -3069,8 +3218,10 @@ class MapsInspectorApi { } Future isLiteModeEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -3091,8 +3242,10 @@ class MapsInspectorApi { } Future isMapToolbarEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -3118,8 +3271,10 @@ class MapsInspectorApi { } Future isMyLocationButtonEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -3145,8 +3300,10 @@ class MapsInspectorApi { } Future isTrafficEnabled() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -3172,14 +3329,16 @@ class MapsInspectorApi { } Future getTileOverlayInfo(String tileOverlayId) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([tileOverlayId]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([tileOverlayId]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -3194,8 +3353,10 @@ class MapsInspectorApi { } Future getZoomRange() async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, @@ -3221,14 +3382,16 @@ class MapsInspectorApi { } Future> getClusters(String clusterManagerId) async { - final String pigeonVar_channelName = 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([clusterManagerId]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([clusterManagerId]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -3243,7 +3406,8 @@ class MapsInspectorApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as List?)!.cast(); + return (pigeonVar_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 495fa2fc8491..bcee485b4e4c 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 @@ -526,8 +526,9 @@ class PlatformBitmapAsset { final String? pkg; } -class PlatformBitmapAssetImage{ - PlatformBitmapAssetImage({required this.name, required this.scale, this.size}); +class PlatformBitmapAssetImage { + PlatformBitmapAssetImage( + {required this.name, required this.scale, this.size}); final String name; final double scale; final PlatformOffset? size; @@ -539,7 +540,12 @@ enum PlatformMapBitmapScaling { } class PlatformBitmapAssetMap { - PlatformBitmapAssetMap({required this.assetName, required this.bitmapScaling, required this.imagePixelRatio, this.width, this.height}); + PlatformBitmapAssetMap( + {required this.assetName, + required this.bitmapScaling, + required this.imagePixelRatio, + this.width, + this.height}); final String assetName; final PlatformMapBitmapScaling bitmapScaling; final double imagePixelRatio; @@ -548,7 +554,12 @@ class PlatformBitmapAssetMap { } class PlatformBitmapBytesMap { - PlatformBitmapBytesMap({required this.byteData, required this.bitmapScaling, required this.imagePixelRatio, this.width, this.height}); + PlatformBitmapBytesMap( + {required this.byteData, + required this.bitmapScaling, + required this.imagePixelRatio, + this.width, + this.height}); final Uint8List byteData; final PlatformMapBitmapScaling bitmapScaling; final double imagePixelRatio; 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 8e1d593a95a3..c2b1aa25c284 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 @@ -416,7 +416,12 @@ void main() { object2new.draggable, object2new.flat, ]); - expect((encoded?[5] as PlatformBitmap?)?.bitmap.runtimeType, GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(object2new.icon).bitmap.runtimeType); + expect( + (encoded?[5] as PlatformBitmap?)?.bitmap.runtimeType, + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor( + object2new.icon) + .bitmap + .runtimeType); final PlatformInfoWindow? window = encoded?[6] as PlatformInfoWindow?; expect(window?.title, object2new.infoWindow.title); expect(window?.snippet, object2new.infoWindow.snippet); @@ -446,7 +451,12 @@ void main() { object3.draggable, object3.flat, ]); - expect((encoded?[5] as PlatformBitmap?)?.bitmap.runtimeType, GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(object3.icon).bitmap.runtimeType); + expect( + (encoded?[5] as PlatformBitmap?)?.bitmap.runtimeType, + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor( + object3.icon) + .bitmap + .runtimeType); final PlatformInfoWindow? window = encoded?[6] as PlatformInfoWindow?; expect(window?.title, object3.infoWindow.title); expect(window?.snippet, object3.infoWindow.snippet); From 93d8f47fa6f2bf479438a1d9cbaf879bd732a56e Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Mon, 7 Oct 2024 16:13:13 -0400 Subject: [PATCH 08/15] Add tests --- .../flutter/plugins/googlemaps/Convert.java | 8 +- .../lib/src/google_maps_flutter_android.dart | 45 +++++------ .../google_maps_flutter_android_test.dart | 79 +++++++++++++++++++ 3 files changed, 101 insertions(+), 31 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 a9fcedac9ae3..ab5ebbbb1f3e 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 @@ -503,10 +503,6 @@ private static Bitmap toScaledBitmap(Bitmap bitmap, int width, int height) { return bitmap; } - private static String toString(Object o) { - return (String) o; - } - static void interpretMapConfiguration( @NonNull Messages.PlatformMapConfiguration config, @NonNull GoogleMapOptionsSink sink) { final Messages.PlatformCameraTargetBounds cameraTargetBounds = config.getCameraTargetBounds(); @@ -850,10 +846,8 @@ private static Cap capFromPigeon( float refWidth = customCap.getRefWidth().floatValue(); return new CustomCap(bitmap, refWidth); } - default: - throw new IllegalArgumentException( - "Unrecognized PlatformCap type " + platformCap.getType()); } + throw new IllegalArgumentException("Unrecognized PlatformCap type " + platformCap.getType()); } static String interpretTileOverlayOptions( 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 ee8bb4a79ee6..b728f8333b29 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 @@ -857,6 +857,8 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { } } + /// Convert [MapBitmapScaling] from platform interface to [PlatformMapBitmapScaling] Pigeon. + @visibleForTesting static PlatformMapBitmapScaling platformMapBitmapScalingFromScaling( MapBitmapScaling scaling) { switch (scaling) { @@ -870,6 +872,8 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { return PlatformMapBitmapScaling.auto; } + /// Convert [BitmapDescriptor] from platform interface to [PlatformBitmap] pigeon. + @visibleForTesting static PlatformBitmap platformBitmapFromBitmapDescriptor( BitmapDescriptor bitmap) { switch (bitmap) { @@ -918,6 +922,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { } } + /// Convert [Cap] from platform interface to [PlatformCap] pigeon. @visibleForTesting static PlatformCap platformCapFromCap(Cap cap) { switch (cap.type) { @@ -1308,30 +1313,22 @@ PlatformJointType platformJointTypeFromJointType(JointType jointType) { /// pattern member. @visibleForTesting PlatformPatternItem platformPatternItemFromPatternItem(PatternItem item) { - final List json = item.toJson() as List; - final String tag = json[0] as String; - PlatformPatternItemType type; - double? length; - - /// These string values identify the type of pattern. They are defined and - /// used in the PatternItem class's factory methods in - /// lib/src/types/pattern_item.dart, in the - /// google_maps_flutter_platform_interface package. - // TODO(schectman): Convert PatternItem to structured data. - // https://github.com/flutter/flutter/issues/155121 - switch (tag) { - case 'dot': - type = PlatformPatternItemType.dot; - case 'dash': - type = PlatformPatternItemType.dash; - length = json[1] as double; - case 'gap': - type = PlatformPatternItemType.gap; - length = json[1] as double; - default: - throw ArgumentError('Invalid tag "$tag for PatternItem type.', 'item'); - } - return PlatformPatternItem(type: type, length: length); + switch (item.type) { + case PatternItemType.dot: + return PlatformPatternItem(type: PlatformPatternItemType.dot); + case PatternItemType.dash: + final double length = (item as VariableLengthPatternItem).length; + return PlatformPatternItem( + type: PlatformPatternItemType.dash, length: length); + case PatternItemType.gap: + final double length = (item as VariableLengthPatternItem).length; + return PlatformPatternItem( + type: PlatformPatternItemType.gap, length: length); + } + + /// [PatternItemType] is defined in the platform interface package. In case + /// a new value is added, a fallback default value is returned. + return PlatformPatternItem(type: PlatformPatternItemType.dot); } /// Update specification for a set of [TileOverlay]s. 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 c2b1aa25c284..0c60b34f4b5f 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 @@ -952,6 +952,85 @@ void main() { expect(typedUpdate.out, true); }); + test('MapBitmapScaling to PlatformMapBitmapScaling', () { + expect( + GoogleMapsFlutterAndroid.platformMapBitmapScalingFromScaling( + MapBitmapScaling.auto), + PlatformMapBitmapScaling.auto); + expect( + GoogleMapsFlutterAndroid.platformMapBitmapScalingFromScaling( + MapBitmapScaling.none), + PlatformMapBitmapScaling.none); + }); + + test('DefaultMarker bitmap to PlatformBitmap', () { + final BitmapDescriptor bitmap = BitmapDescriptor.defaultMarkerWithHue(10.0); + final PlatformBitmap platformBitmap = + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap); + expect(platformBitmap.bitmap, isA()); + final PlatformBitmapDefaultMarker typedBitmap = + platformBitmap.bitmap as PlatformBitmapDefaultMarker; + expect(typedBitmap.hue, 10.0); + }); + + test('BytesMapBitmap bitmap to PlatformBitmap', () { + final Uint8List data = Uint8List.fromList([1, 2, 3, 4]); + final BytesMapBitmap bitmap = BitmapDescriptor.bytes(data, + imagePixelRatio: 2.0, + width: 100.0, + height: 200.0, + bitmapScaling: MapBitmapScaling.auto); + final PlatformBitmap platformBitmap = + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap); + expect(platformBitmap.bitmap, isA()); + final PlatformBitmapBytesMap typedBitmap = + platformBitmap.bitmap as PlatformBitmapBytesMap; + expect(typedBitmap.byteData, data); + expect(typedBitmap.bitmapScaling, PlatformMapBitmapScaling.auto); + expect(typedBitmap.imagePixelRatio, 2.0); + expect(typedBitmap.width, 100.0); + expect(typedBitmap.height, 200.0); + }); + + test('AssetMapBitmap bitmap to PlatformBitmap', () { + const String assetName = 'fake_asset_name'; + final AssetMapBitmap bitmap = AssetMapBitmap(assetName, + imagePixelRatio: 2.0, + width: 100.0, + height: 200.0, + bitmapScaling: MapBitmapScaling.auto); + final PlatformBitmap platformBitmap = + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap); + expect(platformBitmap.bitmap, isA()); + final PlatformBitmapAssetMap typedBitmap = + platformBitmap.bitmap as PlatformBitmapAssetMap; + expect(typedBitmap.assetName, assetName); + expect(typedBitmap.bitmapScaling, PlatformMapBitmapScaling.auto); + expect(typedBitmap.imagePixelRatio, 2.0); + expect(typedBitmap.width, 100.0); + expect(typedBitmap.height, 200.0); + }); + + test('Cap to PlatformCap', () { + expect(GoogleMapsFlutterAndroid.platformCapFromCap(Cap.buttCap).encode(), + PlatformCap(type: PlatformCapType.butt).encode()); + expect(GoogleMapsFlutterAndroid.platformCapFromCap(Cap.roundCap).encode(), + PlatformCap(type: PlatformCapType.round).encode()); + expect(GoogleMapsFlutterAndroid.platformCapFromCap(Cap.squareCap).encode(), + PlatformCap(type: PlatformCapType.square).encode()); + + const BitmapDescriptor bitmap = BitmapDescriptor.defaultMarker; + const CustomCap customCap = CustomCap(bitmap, refWidth: 15.0); + final PlatformCap platformCap = + GoogleMapsFlutterAndroid.platformCapFromCap(customCap); + final PlatformCustomCap expected = PlatformCustomCap( + bitmapDescriptor: + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap), + refWidth: 15.0); + expect(platformCap.type, PlatformCapType.custom); + expect(customCap.refWidth, expected.refWidth); + }); + testWidgets('Use PlatformViewLink when using surface view', (WidgetTester tester) async { final GoogleMapsFlutterAndroid maps = GoogleMapsFlutterAndroid(); From 05b6f90956ae6b5086081442983d866e02716b3b Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 10 Oct 2024 12:51:00 -0400 Subject: [PATCH 09/15] Regenerate pigeons --- .../flutter/plugins/googlemaps/Convert.java | 5 +- .../flutter/plugins/googlemaps/Messages.java | 1242 ++++++++++++----- .../lib/src/google_maps_flutter_android.dart | 44 +- .../lib/src/messages.g.dart | 172 ++- .../pigeons/messages.dart | 5 +- .../google_maps_flutter_android_test.dart | 30 +- 6 files changed, 1037 insertions(+), 461 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 019e41c7d6eb..5430bde1a889 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 @@ -61,8 +61,9 @@ class Convert { public static final String HEATMAP_GRADIENT_COLOR_MAP_SIZE_KEY = "colorMapSize"; private static BitmapDescriptor toBitmapDescriptor( - Messages.PlatformBitmap o, AssetManager assetManager, float density) { - return toBitmapDescriptor(o, assetManager, density, new BitmapDescriptorFactoryWrapper()); + Messages.PlatformBitmap platformBitmap, AssetManager assetManager, float density) { + return toBitmapDescriptor( + platformBitmap, assetManager, density, new BitmapDescriptorFactoryWrapper()); } private static BitmapDescriptor toBitmapDescriptor( 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 f7dc2ad633ba..b246f06ea2d7 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 @@ -113,7 +113,6 @@ public enum PlatformJointType { } } - /** * Enumeration of possible types of PlatformCap, corresponding to the subclasses of Cap in the * Google Maps Android SDK. See @@ -2785,187 +2784,6 @@ ArrayList toList() { } } - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformCap { - private @NonNull PlatformCapType type; - - public @NonNull PlatformCapType getType() { - return type; - } - - public void setType(@NonNull PlatformCapType setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"type\" is null."); - } - this.type = setterArg; - } - - private @Nullable PlatformCustomCap customCap; - - public @Nullable PlatformCustomCap getCustomCap() { - return customCap; - } - - public void setCustomCap(@Nullable PlatformCustomCap setterArg) { - this.customCap = setterArg; - } - - /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformCap() {} - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PlatformCap that = (PlatformCap) o; - return type.equals(that.type) && Objects.equals(customCap, that.customCap); - } - - @Override - public int hashCode() { - return Objects.hash(type, customCap); - } - - public static final class Builder { - - private @Nullable PlatformCapType type; - - @CanIgnoreReturnValue - public @NonNull Builder setType(@NonNull PlatformCapType setterArg) { - this.type = setterArg; - return this; - } - - private @Nullable PlatformCustomCap customCap; - - @CanIgnoreReturnValue - public @NonNull Builder setCustomCap(@Nullable PlatformCustomCap setterArg) { - this.customCap = setterArg; - return this; - } - - public @NonNull PlatformCap build() { - PlatformCap pigeonReturn = new PlatformCap(); - pigeonReturn.setType(type); - pigeonReturn.setCustomCap(customCap); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList<>(2); - toListResult.add(type); - toListResult.add(customCap); - return toListResult; - } - - static @NonNull PlatformCap fromList(@NonNull ArrayList pigeonVar_list) { - PlatformCap pigeonResult = new PlatformCap(); - Object type = pigeonVar_list.get(0); - pigeonResult.setType((PlatformCapType) type); - Object customCap = pigeonVar_list.get(1); - pigeonResult.setCustomCap((PlatformCustomCap) customCap); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformCustomCap { - private @NonNull PlatformBitmap bitmapDescriptor; - - public @NonNull PlatformBitmap getBitmapDescriptor() { - return bitmapDescriptor; - } - - public void setBitmapDescriptor(@NonNull PlatformBitmap setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"bitmapDescriptor\" is null."); - } - this.bitmapDescriptor = setterArg; - } - - private @NonNull Double refWidth; - - public @NonNull Double getRefWidth() { - return refWidth; - } - - public void setRefWidth(@NonNull Double setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"refWidth\" is null."); - } - this.refWidth = setterArg; - } - - /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformCustomCap() {} - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PlatformCustomCap that = (PlatformCustomCap) o; - return bitmapDescriptor.equals(that.bitmapDescriptor) && refWidth.equals(that.refWidth); - } - - @Override - public int hashCode() { - return Objects.hash(bitmapDescriptor, refWidth); - } - - public static final class Builder { - - private @Nullable PlatformBitmap bitmapDescriptor; - - @CanIgnoreReturnValue - public @NonNull Builder setBitmapDescriptor(@NonNull PlatformBitmap setterArg) { - this.bitmapDescriptor = setterArg; - return this; - } - - private @Nullable Double refWidth; - - @CanIgnoreReturnValue - public @NonNull Builder setRefWidth(@NonNull Double setterArg) { - this.refWidth = setterArg; - return this; - } - - public @NonNull PlatformCustomCap build() { - PlatformCustomCap pigeonReturn = new PlatformCustomCap(); - pigeonReturn.setBitmapDescriptor(bitmapDescriptor); - pigeonReturn.setRefWidth(refWidth); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList<>(2); - toListResult.add(bitmapDescriptor); - toListResult.add(refWidth); - return toListResult; - } - - static @NonNull PlatformCustomCap fromList(@NonNull ArrayList pigeonVar_list) { - PlatformCustomCap pigeonResult = new PlatformCustomCap(); - Object bitmapDescriptor = pigeonVar_list.get(0); - pigeonResult.setBitmapDescriptor((PlatformBitmap) bitmapDescriptor); - Object refWidth = pigeonVar_list.get(1); - pigeonResult.setRefWidth((Double) refWidth); - return pigeonResult; - } - } - /** * Pigeon equivalent of Cap from the platform interface. * https://github.com/flutter/packages/blob/main/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/cap.dart @@ -2986,14 +2804,13 @@ public void setType(@NonNull PlatformCapType setterArg) { this.type = setterArg; } - /** The JSON data returned by BitmapDescriptor.toJson. */ - private @Nullable Object bitmapDescriptor; + private @Nullable PlatformBitmap bitmapDescriptor; - public @Nullable Object getBitmapDescriptor() { + public @Nullable PlatformBitmap getBitmapDescriptor() { return bitmapDescriptor; } - public void setBitmapDescriptor(@Nullable Object setterArg) { + public void setBitmapDescriptor(@Nullable PlatformBitmap setterArg) { this.bitmapDescriptor = setterArg; } @@ -3039,10 +2856,10 @@ public static final class Builder { return this; } - private @Nullable Object bitmapDescriptor; + private @Nullable PlatformBitmap bitmapDescriptor; @CanIgnoreReturnValue - public @NonNull Builder setBitmapDescriptor(@Nullable Object setterArg) { + public @NonNull Builder setBitmapDescriptor(@Nullable PlatformBitmap setterArg) { this.bitmapDescriptor = setterArg; return this; } @@ -3078,7 +2895,7 @@ ArrayList toList() { Object type = pigeonVar_list.get(0); pigeonResult.setType((PlatformCapType) type); Object bitmapDescriptor = pigeonVar_list.get(1); - pigeonResult.setBitmapDescriptor(bitmapDescriptor); + pigeonResult.setBitmapDescriptor((PlatformBitmap) bitmapDescriptor); Object refWidth = pigeonVar_list.get(2); pigeonResult.setRefWidth((Double) refWidth); return pigeonResult; @@ -5223,103 +5040,9 @@ public void setBitmap(@NonNull Object setterArg) { PlatformBitmap() {} @Override - protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { - switch (type) { - case (byte) 129: - { - Object value = readValue(buffer); - return value == null ? null : PlatformMapType.values()[((Long) value).intValue()]; - } - case (byte) 130: - { - Object value = readValue(buffer); - return value == null ? null : PlatformRendererType.values()[((Long) value).intValue()]; - } - case (byte) 131: - { - Object value = readValue(buffer); - return value == null ? null : PlatformJointType.values()[((Long) value).intValue()]; - } - case (byte) 132: - { - Object value = readValue(buffer); - return value == null ? null : PlatformCapType.values()[((Long) value).intValue()]; - } - case (byte) 133: - { - Object value = readValue(buffer); - return value == null - ? null - : PlatformPatternItemType.values()[((Long) value).intValue()]; - } - case (byte) 134: - return PlatformCameraPosition.fromList((ArrayList) readValue(buffer)); - case (byte) 135: - return PlatformCameraUpdate.fromList((ArrayList) readValue(buffer)); - case (byte) 136: - return PlatformCameraUpdateNewCameraPosition.fromList( - (ArrayList) readValue(buffer)); - case (byte) 137: - return PlatformCameraUpdateNewLatLng.fromList((ArrayList) readValue(buffer)); - case (byte) 138: - return PlatformCameraUpdateNewLatLngBounds.fromList( - (ArrayList) readValue(buffer)); - case (byte) 139: - return PlatformCameraUpdateNewLatLngZoom.fromList((ArrayList) readValue(buffer)); - case (byte) 140: - return PlatformCameraUpdateScrollBy.fromList((ArrayList) readValue(buffer)); - case (byte) 141: - return PlatformCameraUpdateZoomBy.fromList((ArrayList) readValue(buffer)); - case (byte) 142: - return PlatformCameraUpdateZoom.fromList((ArrayList) readValue(buffer)); - case (byte) 143: - return PlatformCameraUpdateZoomTo.fromList((ArrayList) readValue(buffer)); - case (byte) 144: - return PlatformCircle.fromList((ArrayList) readValue(buffer)); - case (byte) 145: - return PlatformHeatmap.fromList((ArrayList) readValue(buffer)); - case (byte) 146: - return PlatformClusterManager.fromList((ArrayList) readValue(buffer)); - case (byte) 147: - return PlatformOffset.fromList((ArrayList) readValue(buffer)); - case (byte) 148: - return PlatformInfoWindow.fromList((ArrayList) readValue(buffer)); - case (byte) 149: - return PlatformMarker.fromList((ArrayList) readValue(buffer)); - case (byte) 150: - return PlatformPolygon.fromList((ArrayList) readValue(buffer)); - case (byte) 151: - return PlatformPolyline.fromList((ArrayList) readValue(buffer)); - case (byte) 152: - return PlatformCap.fromList((ArrayList) readValue(buffer)); - case (byte) 153: - return PlatformPatternItem.fromList((ArrayList) readValue(buffer)); - case (byte) 154: - return PlatformTile.fromList((ArrayList) readValue(buffer)); - case (byte) 155: - return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); - case (byte) 156: - return PlatformEdgeInsets.fromList((ArrayList) readValue(buffer)); - case (byte) 157: - return PlatformLatLng.fromList((ArrayList) readValue(buffer)); - case (byte) 158: - return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); - case (byte) 159: - return PlatformCluster.fromList((ArrayList) readValue(buffer)); - case (byte) 160: - return PlatformCameraTargetBounds.fromList((ArrayList) readValue(buffer)); - case (byte) 161: - return PlatformMapViewCreationParams.fromList((ArrayList) readValue(buffer)); - case (byte) 162: - return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); - case (byte) 163: - return PlatformPoint.fromList((ArrayList) readValue(buffer)); - case (byte) 164: - return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); - case (byte) 165: - return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); - default: - return super.readValueOfType(type, buffer); + public boolean equals(Object o) { + if (this == o) { + return true; } if (o == null || getClass() != o.getClass()) { return false; @@ -5329,13 +5052,865 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { } @Override - protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof PlatformMapType) { - stream.write(129); - writeValue(stream, value == null ? null : ((PlatformMapType) value).index); - } else if (value instanceof PlatformRendererType) { - stream.write(130); - writeValue(stream, value == null ? null : ((PlatformRendererType) value).index); + public int hashCode() { + return Objects.hash(bitmap); + } + + public static final class Builder { + + private @Nullable Object bitmap; + + @CanIgnoreReturnValue + public @NonNull Builder setBitmap(@NonNull Object setterArg) { + this.bitmap = setterArg; + return this; + } + + public @NonNull PlatformBitmap build() { + PlatformBitmap pigeonReturn = new PlatformBitmap(); + pigeonReturn.setBitmap(bitmap); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(bitmap); + return toListResult; + } + + static @NonNull PlatformBitmap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmap pigeonResult = new PlatformBitmap(); + Object bitmap = pigeonVar_list.get(0); + pigeonResult.setBitmap(bitmap); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapDefaultMarker { + private @Nullable Double hue; + + public @Nullable Double getHue() { + return hue; + } + + public void setHue(@Nullable Double setterArg) { + this.hue = setterArg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBitmapDefaultMarker that = (PlatformBitmapDefaultMarker) o; + return Objects.equals(hue, that.hue); + } + + @Override + public int hashCode() { + return Objects.hash(hue); + } + + public static final class Builder { + + private @Nullable Double hue; + + @CanIgnoreReturnValue + public @NonNull Builder setHue(@Nullable Double setterArg) { + this.hue = setterArg; + return this; + } + + public @NonNull PlatformBitmapDefaultMarker build() { + PlatformBitmapDefaultMarker pigeonReturn = new PlatformBitmapDefaultMarker(); + pigeonReturn.setHue(hue); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(hue); + return toListResult; + } + + static @NonNull PlatformBitmapDefaultMarker fromList( + @NonNull ArrayList pigeonVar_list) { + PlatformBitmapDefaultMarker pigeonResult = new PlatformBitmapDefaultMarker(); + Object hue = pigeonVar_list.get(0); + pigeonResult.setHue((Double) hue); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapBytes { + private @NonNull byte[] byteData; + + public @NonNull byte[] getByteData() { + return byteData; + } + + public void setByteData(@NonNull byte[] setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"byteData\" is null."); + } + this.byteData = setterArg; + } + + private @Nullable PlatformOffset size; + + public @Nullable PlatformOffset getSize() { + return size; + } + + public void setSize(@Nullable PlatformOffset setterArg) { + this.size = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapBytes() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBitmapBytes that = (PlatformBitmapBytes) o; + return Arrays.equals(byteData, that.byteData) && Objects.equals(size, that.size); + } + + @Override + public int hashCode() { + int pigeonVar_result = Objects.hash(size); + pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(byteData); + return pigeonVar_result; + } + + public static final class Builder { + + private @Nullable byte[] byteData; + + @CanIgnoreReturnValue + public @NonNull Builder setByteData(@NonNull byte[] setterArg) { + this.byteData = setterArg; + return this; + } + + private @Nullable PlatformOffset size; + + @CanIgnoreReturnValue + public @NonNull Builder setSize(@Nullable PlatformOffset setterArg) { + this.size = setterArg; + return this; + } + + public @NonNull PlatformBitmapBytes build() { + PlatformBitmapBytes pigeonReturn = new PlatformBitmapBytes(); + pigeonReturn.setByteData(byteData); + pigeonReturn.setSize(size); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(byteData); + toListResult.add(size); + return toListResult; + } + + static @NonNull PlatformBitmapBytes fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapBytes pigeonResult = new PlatformBitmapBytes(); + Object byteData = pigeonVar_list.get(0); + pigeonResult.setByteData((byte[]) byteData); + Object size = pigeonVar_list.get(1); + pigeonResult.setSize((PlatformOffset) size); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapAsset { + private @NonNull String name; + + public @NonNull String getName() { + return name; + } + + public void setName(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"name\" is null."); + } + this.name = setterArg; + } + + private @Nullable String pkg; + + public @Nullable String getPkg() { + return pkg; + } + + public void setPkg(@Nullable String setterArg) { + this.pkg = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapAsset() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBitmapAsset that = (PlatformBitmapAsset) o; + return name.equals(that.name) && Objects.equals(pkg, that.pkg); + } + + @Override + public int hashCode() { + return Objects.hash(name, pkg); + } + + public static final class Builder { + + private @Nullable String name; + + @CanIgnoreReturnValue + public @NonNull Builder setName(@NonNull String setterArg) { + this.name = setterArg; + return this; + } + + private @Nullable String pkg; + + @CanIgnoreReturnValue + public @NonNull Builder setPkg(@Nullable String setterArg) { + this.pkg = setterArg; + return this; + } + + public @NonNull PlatformBitmapAsset build() { + PlatformBitmapAsset pigeonReturn = new PlatformBitmapAsset(); + pigeonReturn.setName(name); + pigeonReturn.setPkg(pkg); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(name); + toListResult.add(pkg); + return toListResult; + } + + static @NonNull PlatformBitmapAsset fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapAsset pigeonResult = new PlatformBitmapAsset(); + Object name = pigeonVar_list.get(0); + pigeonResult.setName((String) name); + Object pkg = pigeonVar_list.get(1); + pigeonResult.setPkg((String) pkg); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapAssetImage { + private @NonNull String name; + + public @NonNull String getName() { + return name; + } + + public void setName(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"name\" is null."); + } + this.name = setterArg; + } + + private @NonNull Double scale; + + public @NonNull Double getScale() { + return scale; + } + + public void setScale(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"scale\" is null."); + } + this.scale = setterArg; + } + + private @Nullable PlatformOffset size; + + public @Nullable PlatformOffset getSize() { + return size; + } + + public void setSize(@Nullable PlatformOffset setterArg) { + this.size = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapAssetImage() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBitmapAssetImage that = (PlatformBitmapAssetImage) o; + return name.equals(that.name) && scale.equals(that.scale) && Objects.equals(size, that.size); + } + + @Override + public int hashCode() { + return Objects.hash(name, scale, size); + } + + public static final class Builder { + + private @Nullable String name; + + @CanIgnoreReturnValue + public @NonNull Builder setName(@NonNull String setterArg) { + this.name = setterArg; + return this; + } + + private @Nullable Double scale; + + @CanIgnoreReturnValue + public @NonNull Builder setScale(@NonNull Double setterArg) { + this.scale = setterArg; + return this; + } + + private @Nullable PlatformOffset size; + + @CanIgnoreReturnValue + public @NonNull Builder setSize(@Nullable PlatformOffset setterArg) { + this.size = setterArg; + return this; + } + + public @NonNull PlatformBitmapAssetImage build() { + PlatformBitmapAssetImage pigeonReturn = new PlatformBitmapAssetImage(); + pigeonReturn.setName(name); + pigeonReturn.setScale(scale); + pigeonReturn.setSize(size); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(3); + toListResult.add(name); + toListResult.add(scale); + toListResult.add(size); + return toListResult; + } + + static @NonNull PlatformBitmapAssetImage fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapAssetImage pigeonResult = new PlatformBitmapAssetImage(); + Object name = pigeonVar_list.get(0); + pigeonResult.setName((String) name); + Object scale = pigeonVar_list.get(1); + pigeonResult.setScale((Double) scale); + Object size = pigeonVar_list.get(2); + pigeonResult.setSize((PlatformOffset) size); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapAssetMap { + private @NonNull String assetName; + + public @NonNull String getAssetName() { + return assetName; + } + + public void setAssetName(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"assetName\" is null."); + } + this.assetName = setterArg; + } + + private @NonNull PlatformMapBitmapScaling bitmapScaling; + + public @NonNull PlatformMapBitmapScaling getBitmapScaling() { + return bitmapScaling; + } + + public void setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"bitmapScaling\" is null."); + } + this.bitmapScaling = setterArg; + } + + private @NonNull Double imagePixelRatio; + + public @NonNull Double getImagePixelRatio() { + return imagePixelRatio; + } + + public void setImagePixelRatio(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"imagePixelRatio\" is null."); + } + this.imagePixelRatio = setterArg; + } + + private @Nullable Double width; + + public @Nullable Double getWidth() { + return width; + } + + public void setWidth(@Nullable Double setterArg) { + this.width = setterArg; + } + + private @Nullable Double height; + + public @Nullable Double getHeight() { + return height; + } + + public void setHeight(@Nullable Double setterArg) { + this.height = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapAssetMap() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBitmapAssetMap that = (PlatformBitmapAssetMap) o; + return assetName.equals(that.assetName) + && bitmapScaling.equals(that.bitmapScaling) + && imagePixelRatio.equals(that.imagePixelRatio) + && Objects.equals(width, that.width) + && Objects.equals(height, that.height); + } + + @Override + public int hashCode() { + return Objects.hash(assetName, bitmapScaling, imagePixelRatio, width, height); + } + + public static final class Builder { + + private @Nullable String assetName; + + @CanIgnoreReturnValue + public @NonNull Builder setAssetName(@NonNull String setterArg) { + this.assetName = setterArg; + return this; + } + + private @Nullable PlatformMapBitmapScaling bitmapScaling; + + @CanIgnoreReturnValue + public @NonNull Builder setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + this.bitmapScaling = setterArg; + return this; + } + + private @Nullable Double imagePixelRatio; + + @CanIgnoreReturnValue + public @NonNull Builder setImagePixelRatio(@NonNull Double setterArg) { + this.imagePixelRatio = setterArg; + return this; + } + + private @Nullable Double width; + + @CanIgnoreReturnValue + public @NonNull Builder setWidth(@Nullable Double setterArg) { + this.width = setterArg; + return this; + } + + private @Nullable Double height; + + @CanIgnoreReturnValue + public @NonNull Builder setHeight(@Nullable Double setterArg) { + this.height = setterArg; + return this; + } + + public @NonNull PlatformBitmapAssetMap build() { + PlatformBitmapAssetMap pigeonReturn = new PlatformBitmapAssetMap(); + pigeonReturn.setAssetName(assetName); + pigeonReturn.setBitmapScaling(bitmapScaling); + pigeonReturn.setImagePixelRatio(imagePixelRatio); + pigeonReturn.setWidth(width); + pigeonReturn.setHeight(height); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(5); + toListResult.add(assetName); + toListResult.add(bitmapScaling); + toListResult.add(imagePixelRatio); + toListResult.add(width); + toListResult.add(height); + return toListResult; + } + + static @NonNull PlatformBitmapAssetMap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapAssetMap pigeonResult = new PlatformBitmapAssetMap(); + Object assetName = pigeonVar_list.get(0); + pigeonResult.setAssetName((String) assetName); + Object bitmapScaling = pigeonVar_list.get(1); + pigeonResult.setBitmapScaling((PlatformMapBitmapScaling) bitmapScaling); + Object imagePixelRatio = pigeonVar_list.get(2); + pigeonResult.setImagePixelRatio((Double) imagePixelRatio); + Object width = pigeonVar_list.get(3); + pigeonResult.setWidth((Double) width); + Object height = pigeonVar_list.get(4); + pigeonResult.setHeight((Double) height); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class PlatformBitmapBytesMap { + private @NonNull byte[] byteData; + + public @NonNull byte[] getByteData() { + return byteData; + } + + public void setByteData(@NonNull byte[] setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"byteData\" is null."); + } + this.byteData = setterArg; + } + + private @NonNull PlatformMapBitmapScaling bitmapScaling; + + public @NonNull PlatformMapBitmapScaling getBitmapScaling() { + return bitmapScaling; + } + + public void setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"bitmapScaling\" is null."); + } + this.bitmapScaling = setterArg; + } + + private @NonNull Double imagePixelRatio; + + public @NonNull Double getImagePixelRatio() { + return imagePixelRatio; + } + + public void setImagePixelRatio(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"imagePixelRatio\" is null."); + } + this.imagePixelRatio = setterArg; + } + + private @Nullable Double width; + + public @Nullable Double getWidth() { + return width; + } + + public void setWidth(@Nullable Double setterArg) { + this.width = setterArg; + } + + private @Nullable Double height; + + public @Nullable Double getHeight() { + return height; + } + + public void setHeight(@Nullable Double setterArg) { + this.height = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapBytesMap() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBitmapBytesMap that = (PlatformBitmapBytesMap) o; + return Arrays.equals(byteData, that.byteData) + && bitmapScaling.equals(that.bitmapScaling) + && imagePixelRatio.equals(that.imagePixelRatio) + && Objects.equals(width, that.width) + && Objects.equals(height, that.height); + } + + @Override + public int hashCode() { + int pigeonVar_result = Objects.hash(bitmapScaling, imagePixelRatio, width, height); + pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(byteData); + return pigeonVar_result; + } + + public static final class Builder { + + private @Nullable byte[] byteData; + + @CanIgnoreReturnValue + public @NonNull Builder setByteData(@NonNull byte[] setterArg) { + this.byteData = setterArg; + return this; + } + + private @Nullable PlatformMapBitmapScaling bitmapScaling; + + @CanIgnoreReturnValue + public @NonNull Builder setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + this.bitmapScaling = setterArg; + return this; + } + + private @Nullable Double imagePixelRatio; + + @CanIgnoreReturnValue + public @NonNull Builder setImagePixelRatio(@NonNull Double setterArg) { + this.imagePixelRatio = setterArg; + return this; + } + + private @Nullable Double width; + + @CanIgnoreReturnValue + public @NonNull Builder setWidth(@Nullable Double setterArg) { + this.width = setterArg; + return this; + } + + private @Nullable Double height; + + @CanIgnoreReturnValue + public @NonNull Builder setHeight(@Nullable Double setterArg) { + this.height = setterArg; + return this; + } + + public @NonNull PlatformBitmapBytesMap build() { + PlatformBitmapBytesMap pigeonReturn = new PlatformBitmapBytesMap(); + pigeonReturn.setByteData(byteData); + pigeonReturn.setBitmapScaling(bitmapScaling); + pigeonReturn.setImagePixelRatio(imagePixelRatio); + pigeonReturn.setWidth(width); + pigeonReturn.setHeight(height); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(5); + toListResult.add(byteData); + toListResult.add(bitmapScaling); + toListResult.add(imagePixelRatio); + toListResult.add(width); + toListResult.add(height); + return toListResult; + } + + static @NonNull PlatformBitmapBytesMap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapBytesMap pigeonResult = new PlatformBitmapBytesMap(); + Object byteData = pigeonVar_list.get(0); + pigeonResult.setByteData((byte[]) byteData); + Object bitmapScaling = pigeonVar_list.get(1); + pigeonResult.setBitmapScaling((PlatformMapBitmapScaling) bitmapScaling); + Object imagePixelRatio = pigeonVar_list.get(2); + pigeonResult.setImagePixelRatio((Double) imagePixelRatio); + Object width = pigeonVar_list.get(3); + pigeonResult.setWidth((Double) width); + Object height = pigeonVar_list.get(4); + pigeonResult.setHeight((Double) height); + return pigeonResult; + } + } + + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); + + private PigeonCodec() {} + + @Override + protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { + switch (type) { + case (byte) 129: + { + Object value = readValue(buffer); + return value == null ? null : PlatformMapType.values()[((Long) value).intValue()]; + } + case (byte) 130: + { + Object value = readValue(buffer); + return value == null ? null : PlatformRendererType.values()[((Long) value).intValue()]; + } + case (byte) 131: + { + Object value = readValue(buffer); + return value == null ? null : PlatformJointType.values()[((Long) value).intValue()]; + } + case (byte) 132: + { + Object value = readValue(buffer); + return value == null ? null : PlatformCapType.values()[((Long) value).intValue()]; + } + case (byte) 133: + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformPatternItemType.values()[((Long) value).intValue()]; + } + case (byte) 134: + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformMapBitmapScaling.values()[((Long) value).intValue()]; + } + case (byte) 135: + return PlatformCameraPosition.fromList((ArrayList) readValue(buffer)); + case (byte) 136: + return PlatformCameraUpdate.fromList((ArrayList) readValue(buffer)); + case (byte) 137: + return PlatformCameraUpdateNewCameraPosition.fromList( + (ArrayList) readValue(buffer)); + case (byte) 138: + return PlatformCameraUpdateNewLatLng.fromList((ArrayList) readValue(buffer)); + case (byte) 139: + return PlatformCameraUpdateNewLatLngBounds.fromList( + (ArrayList) readValue(buffer)); + case (byte) 140: + return PlatformCameraUpdateNewLatLngZoom.fromList((ArrayList) readValue(buffer)); + case (byte) 141: + return PlatformCameraUpdateScrollBy.fromList((ArrayList) readValue(buffer)); + case (byte) 142: + return PlatformCameraUpdateZoomBy.fromList((ArrayList) readValue(buffer)); + case (byte) 143: + return PlatformCameraUpdateZoom.fromList((ArrayList) readValue(buffer)); + case (byte) 144: + return PlatformCameraUpdateZoomTo.fromList((ArrayList) readValue(buffer)); + case (byte) 145: + return PlatformCircle.fromList((ArrayList) readValue(buffer)); + case (byte) 146: + return PlatformHeatmap.fromList((ArrayList) readValue(buffer)); + case (byte) 147: + return PlatformClusterManager.fromList((ArrayList) readValue(buffer)); + case (byte) 148: + return PlatformOffset.fromList((ArrayList) readValue(buffer)); + case (byte) 149: + return PlatformInfoWindow.fromList((ArrayList) readValue(buffer)); + case (byte) 150: + return PlatformMarker.fromList((ArrayList) readValue(buffer)); + case (byte) 151: + return PlatformPolygon.fromList((ArrayList) readValue(buffer)); + case (byte) 152: + return PlatformPolyline.fromList((ArrayList) readValue(buffer)); + case (byte) 153: + return PlatformCap.fromList((ArrayList) readValue(buffer)); + case (byte) 154: + return PlatformPatternItem.fromList((ArrayList) readValue(buffer)); + case (byte) 155: + return PlatformTile.fromList((ArrayList) readValue(buffer)); + case (byte) 156: + return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); + case (byte) 157: + return PlatformEdgeInsets.fromList((ArrayList) readValue(buffer)); + case (byte) 158: + return PlatformLatLng.fromList((ArrayList) readValue(buffer)); + case (byte) 159: + return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); + case (byte) 160: + return PlatformCluster.fromList((ArrayList) readValue(buffer)); + case (byte) 161: + return PlatformCameraTargetBounds.fromList((ArrayList) readValue(buffer)); + case (byte) 162: + return PlatformMapViewCreationParams.fromList((ArrayList) readValue(buffer)); + case (byte) 163: + return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); + case (byte) 164: + return PlatformPoint.fromList((ArrayList) readValue(buffer)); + case (byte) 165: + return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); + case (byte) 166: + return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + case (byte) 167: + return PlatformBitmap.fromList((ArrayList) readValue(buffer)); + case (byte) 168: + return PlatformBitmapDefaultMarker.fromList((ArrayList) readValue(buffer)); + case (byte) 169: + return PlatformBitmapBytes.fromList((ArrayList) readValue(buffer)); + case (byte) 170: + return PlatformBitmapAsset.fromList((ArrayList) readValue(buffer)); + case (byte) 171: + return PlatformBitmapAssetImage.fromList((ArrayList) readValue(buffer)); + case (byte) 172: + return PlatformBitmapAssetMap.fromList((ArrayList) readValue(buffer)); + case (byte) 173: + return PlatformBitmapBytesMap.fromList((ArrayList) readValue(buffer)); + default: + return super.readValueOfType(type, buffer); + } + } + + @Override + protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { + if (value instanceof PlatformMapType) { + stream.write(129); + writeValue(stream, value == null ? null : ((PlatformMapType) value).index); + } else if (value instanceof PlatformRendererType) { + stream.write(130); + writeValue(stream, value == null ? null : ((PlatformRendererType) value).index); } else if (value instanceof PlatformJointType) { stream.write(131); writeValue(stream, value == null ? null : ((PlatformJointType) value).index); @@ -5345,122 +5920,125 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } else if (value instanceof PlatformPatternItemType) { stream.write(133); writeValue(stream, value == null ? null : ((PlatformPatternItemType) value).index); - } else if (value instanceof PlatformCameraPosition) { + } else if (value instanceof PlatformMapBitmapScaling) { stream.write(134); + writeValue(stream, value == null ? null : ((PlatformMapBitmapScaling) value).index); + } else if (value instanceof PlatformCameraPosition) { + stream.write(135); writeValue(stream, ((PlatformCameraPosition) value).toList()); } else if (value instanceof PlatformCameraUpdate) { - stream.write(135); + stream.write(136); writeValue(stream, ((PlatformCameraUpdate) value).toList()); } else if (value instanceof PlatformCameraUpdateNewCameraPosition) { - stream.write(136); + stream.write(137); writeValue(stream, ((PlatformCameraUpdateNewCameraPosition) value).toList()); } else if (value instanceof PlatformCameraUpdateNewLatLng) { - stream.write(137); + stream.write(138); writeValue(stream, ((PlatformCameraUpdateNewLatLng) value).toList()); } else if (value instanceof PlatformCameraUpdateNewLatLngBounds) { - stream.write(138); + stream.write(139); writeValue(stream, ((PlatformCameraUpdateNewLatLngBounds) value).toList()); } else if (value instanceof PlatformCameraUpdateNewLatLngZoom) { - stream.write(139); + stream.write(140); writeValue(stream, ((PlatformCameraUpdateNewLatLngZoom) value).toList()); } else if (value instanceof PlatformCameraUpdateScrollBy) { - stream.write(140); + stream.write(141); writeValue(stream, ((PlatformCameraUpdateScrollBy) value).toList()); } else if (value instanceof PlatformCameraUpdateZoomBy) { - stream.write(141); + stream.write(142); writeValue(stream, ((PlatformCameraUpdateZoomBy) value).toList()); } else if (value instanceof PlatformCameraUpdateZoom) { - stream.write(142); + stream.write(143); writeValue(stream, ((PlatformCameraUpdateZoom) value).toList()); } else if (value instanceof PlatformCameraUpdateZoomTo) { - stream.write(143); + stream.write(144); writeValue(stream, ((PlatformCameraUpdateZoomTo) value).toList()); } else if (value instanceof PlatformCircle) { - stream.write(144); + stream.write(145); writeValue(stream, ((PlatformCircle) value).toList()); } else if (value instanceof PlatformHeatmap) { - stream.write(145); + stream.write(146); writeValue(stream, ((PlatformHeatmap) value).toList()); } else if (value instanceof PlatformClusterManager) { - stream.write(146); + stream.write(147); writeValue(stream, ((PlatformClusterManager) value).toList()); } else if (value instanceof PlatformOffset) { - stream.write(147); + stream.write(148); writeValue(stream, ((PlatformOffset) value).toList()); } else if (value instanceof PlatformInfoWindow) { - stream.write(148); + stream.write(149); writeValue(stream, ((PlatformInfoWindow) value).toList()); } else if (value instanceof PlatformMarker) { - stream.write(149); + stream.write(150); writeValue(stream, ((PlatformMarker) value).toList()); } else if (value instanceof PlatformPolygon) { - stream.write(150); + stream.write(151); writeValue(stream, ((PlatformPolygon) value).toList()); } else if (value instanceof PlatformPolyline) { - stream.write(151); + stream.write(152); writeValue(stream, ((PlatformPolyline) value).toList()); } else if (value instanceof PlatformCap) { - stream.write(152); + stream.write(153); writeValue(stream, ((PlatformCap) value).toList()); } else if (value instanceof PlatformPatternItem) { - stream.write(153); + stream.write(154); writeValue(stream, ((PlatformPatternItem) value).toList()); } else if (value instanceof PlatformTile) { - stream.write(154); + stream.write(155); writeValue(stream, ((PlatformTile) value).toList()); } else if (value instanceof PlatformTileOverlay) { - stream.write(155); + stream.write(156); writeValue(stream, ((PlatformTileOverlay) value).toList()); } else if (value instanceof PlatformEdgeInsets) { - stream.write(156); + stream.write(157); writeValue(stream, ((PlatformEdgeInsets) value).toList()); } else if (value instanceof PlatformLatLng) { - stream.write(157); + stream.write(158); writeValue(stream, ((PlatformLatLng) value).toList()); } else if (value instanceof PlatformLatLngBounds) { - stream.write(158); + stream.write(159); writeValue(stream, ((PlatformLatLngBounds) value).toList()); } else if (value instanceof PlatformCluster) { - stream.write(159); + stream.write(160); writeValue(stream, ((PlatformCluster) value).toList()); } else if (value instanceof PlatformCameraTargetBounds) { - stream.write(160); + stream.write(161); writeValue(stream, ((PlatformCameraTargetBounds) value).toList()); } else if (value instanceof PlatformMapViewCreationParams) { - stream.write(161); + stream.write(162); writeValue(stream, ((PlatformMapViewCreationParams) value).toList()); } else if (value instanceof PlatformMapConfiguration) { - stream.write(162); + stream.write(163); writeValue(stream, ((PlatformMapConfiguration) value).toList()); } else if (value instanceof PlatformPoint) { - stream.write(163); + stream.write(164); writeValue(stream, ((PlatformPoint) value).toList()); } else if (value instanceof PlatformTileLayer) { - stream.write(164); + stream.write(165); writeValue(stream, ((PlatformTileLayer) value).toList()); } else if (value instanceof PlatformZoomRange) { - stream.write(165); + stream.write(166); writeValue(stream, ((PlatformZoomRange) value).toList()); } else if (value instanceof PlatformBitmap) { - stream.write(168); + stream.write(167); writeValue(stream, ((PlatformBitmap) value).toList()); } else if (value instanceof PlatformBitmapDefaultMarker) { - stream.write(169); + stream.write(168); writeValue(stream, ((PlatformBitmapDefaultMarker) value).toList()); } else if (value instanceof PlatformBitmapBytes) { - stream.write(170); + stream.write(169); writeValue(stream, ((PlatformBitmapBytes) value).toList()); } else if (value instanceof PlatformBitmapAsset) { - stream.write(171); + stream.write(170); writeValue(stream, ((PlatformBitmapAsset) value).toList()); } else if (value instanceof PlatformBitmapAssetImage) { - stream.write(172); + stream.write(171); writeValue(stream, ((PlatformBitmapAssetImage) value).toList()); } else if (value instanceof PlatformBitmapAssetMap) { - stream.write(173); + stream.write(172); writeValue(stream, ((PlatformBitmapAssetMap) value).toList()); } else if (value instanceof PlatformBitmapBytesMap) { - stream.write(174); + stream.write(173); writeValue(stream, ((PlatformBitmapBytesMap) value).toList()); } 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 f377c59bf307..9ca1a3c1767b 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 @@ -927,19 +927,18 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { static PlatformCap platformCapFromCap(Cap cap) { switch (cap.type) { case CapType.butt: - return PlatformCap(type: PlatformCapType.butt); + return PlatformCap(type: PlatformCapType.buttCap); case CapType.square: - return PlatformCap(type: PlatformCapType.square); + return PlatformCap(type: PlatformCapType.squareCap); case CapType.round: - return PlatformCap(type: PlatformCapType.round); + return PlatformCap(type: PlatformCapType.roundCap); case CapType.custom: cap as CustomCap; return PlatformCap( - type: PlatformCapType.custom, - customCap: PlatformCustomCap( - bitmapDescriptor: - platformBitmapFromBitmapDescriptor(cap.bitmapDescriptor), - refWidth: cap.refWidth)); + type: PlatformCapType.customCap, + bitmapDescriptor: + platformBitmapFromBitmapDescriptor(cap.bitmapDescriptor), + refWidth: cap.refWidth); } } } @@ -1309,35 +1308,6 @@ PlatformJointType platformJointTypeFromJointType(JointType jointType) { return PlatformJointType.mitered; } -/// Converts platform interface's [Cap] to Pigeon's [PlatformCap]. -@visibleForTesting -PlatformCap platformCapFromCap(Cap cap) { - // TODO(schectman): Convert Cap to structured data. - // https://github.com/flutter/flutter/issues/155121 - final List json = cap.toJson() as List; - final String tag = json[0] as String; - switch (tag) { - case 'buttCap': - return PlatformCap(type: PlatformCapType.buttCap); - case 'roundCap': - return PlatformCap(type: PlatformCapType.roundCap); - case 'squareCap': - return PlatformCap(type: PlatformCapType.squareCap); - case 'customCap': - final Object bitmapDescriptor = json[1]; - final double refWidth = json[2] as double; - return PlatformCap( - type: PlatformCapType.customCap, - bitmapDescriptor: bitmapDescriptor, - refWidth: refWidth); - } - // The string tags used to identify the type of cap comes from a different - // package, which could get a new value at - // any time, so provide a fallback that ensures this won't break when used - // with a version that contains new values. - return PlatformCap(type: PlatformCapType.buttCap); -} - /// Converts a PatternItem to Pigeon's PlatformPatternItem for PlatformPolyline /// pattern member. @visibleForTesting 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 10e1f90a71a7..5884406fd616 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 @@ -742,8 +742,7 @@ class PlatformCap { PlatformCapType type; - /// The JSON data returned by BitmapDescriptor.toJson. - Object? bitmapDescriptor; + PlatformBitmap? bitmapDescriptor; double? refWidth; @@ -759,7 +758,7 @@ class PlatformCap { result as List; return PlatformCap( type: result[0]! as PlatformCapType, - bitmapDescriptor: result[1], + bitmapDescriptor: result[1] as PlatformBitmap?, refWidth: result[2] as double?, ); } @@ -1526,101 +1525,125 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is PlatformPatternItemType) { buffer.putUint8(133); writeValue(buffer, value.index); - } else if (value is PlatformCameraPosition) { + } else if (value is PlatformMapBitmapScaling) { buffer.putUint8(134); + writeValue(buffer, value.index); + } else if (value is PlatformCameraPosition) { + buffer.putUint8(135); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdate) { - buffer.putUint8(135); + buffer.putUint8(136); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewCameraPosition) { - buffer.putUint8(136); + buffer.putUint8(137); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLng) { - buffer.putUint8(137); + buffer.putUint8(138); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLngBounds) { - buffer.putUint8(138); + buffer.putUint8(139); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLngZoom) { - buffer.putUint8(139); + buffer.putUint8(140); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateScrollBy) { - buffer.putUint8(140); + buffer.putUint8(141); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoomBy) { - buffer.putUint8(141); + buffer.putUint8(142); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoom) { - buffer.putUint8(142); + buffer.putUint8(143); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoomTo) { - buffer.putUint8(143); + buffer.putUint8(144); writeValue(buffer, value.encode()); } else if (value is PlatformCircle) { - buffer.putUint8(144); + buffer.putUint8(145); writeValue(buffer, value.encode()); } else if (value is PlatformHeatmap) { - buffer.putUint8(145); + buffer.putUint8(146); writeValue(buffer, value.encode()); } else if (value is PlatformClusterManager) { - buffer.putUint8(146); + buffer.putUint8(147); writeValue(buffer, value.encode()); } else if (value is PlatformOffset) { - buffer.putUint8(147); + buffer.putUint8(148); writeValue(buffer, value.encode()); } else if (value is PlatformInfoWindow) { - buffer.putUint8(148); + buffer.putUint8(149); writeValue(buffer, value.encode()); } else if (value is PlatformMarker) { - buffer.putUint8(149); + buffer.putUint8(150); writeValue(buffer, value.encode()); } else if (value is PlatformPolygon) { - buffer.putUint8(150); + buffer.putUint8(151); writeValue(buffer, value.encode()); } else if (value is PlatformPolyline) { - buffer.putUint8(151); + buffer.putUint8(152); writeValue(buffer, value.encode()); } else if (value is PlatformCap) { - buffer.putUint8(152); + buffer.putUint8(153); writeValue(buffer, value.encode()); } else if (value is PlatformPatternItem) { - buffer.putUint8(153); + buffer.putUint8(154); writeValue(buffer, value.encode()); } else if (value is PlatformTile) { - buffer.putUint8(154); + buffer.putUint8(155); writeValue(buffer, value.encode()); } else if (value is PlatformTileOverlay) { - buffer.putUint8(155); + buffer.putUint8(156); writeValue(buffer, value.encode()); } else if (value is PlatformEdgeInsets) { - buffer.putUint8(156); + buffer.putUint8(157); writeValue(buffer, value.encode()); } else if (value is PlatformLatLng) { - buffer.putUint8(157); + buffer.putUint8(158); writeValue(buffer, value.encode()); } else if (value is PlatformLatLngBounds) { - buffer.putUint8(158); + buffer.putUint8(159); writeValue(buffer, value.encode()); } else if (value is PlatformCluster) { - buffer.putUint8(159); + buffer.putUint8(160); writeValue(buffer, value.encode()); } else if (value is PlatformCameraTargetBounds) { - buffer.putUint8(160); + buffer.putUint8(161); writeValue(buffer, value.encode()); } else if (value is PlatformMapViewCreationParams) { - buffer.putUint8(161); + buffer.putUint8(162); writeValue(buffer, value.encode()); } else if (value is PlatformMapConfiguration) { - buffer.putUint8(162); + buffer.putUint8(163); writeValue(buffer, value.encode()); } else if (value is PlatformPoint) { - buffer.putUint8(163); + buffer.putUint8(164); writeValue(buffer, value.encode()); } else if (value is PlatformTileLayer) { - buffer.putUint8(164); + buffer.putUint8(165); writeValue(buffer, value.encode()); } else if (value is PlatformZoomRange) { - buffer.putUint8(165); + buffer.putUint8(166); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmap) { + buffer.putUint8(167); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapDefaultMarker) { + buffer.putUint8(168); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapBytes) { + buffer.putUint8(169); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapAsset) { + buffer.putUint8(170); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapAssetImage) { + buffer.putUint8(171); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapAssetMap) { + buffer.putUint8(172); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapBytesMap) { + buffer.putUint8(173); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -1646,82 +1669,85 @@ class _PigeonCodec extends StandardMessageCodec { final int? value = readValue(buffer) as int?; return value == null ? null : PlatformPatternItemType.values[value]; case 134: - return PlatformCameraPosition.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformMapBitmapScaling.values[value]; case 135: - return PlatformCameraUpdate.decode(readValue(buffer)!); + return PlatformCameraPosition.decode(readValue(buffer)!); case 136: - return PlatformCameraUpdateNewCameraPosition.decode(readValue(buffer)!); + return PlatformCameraUpdate.decode(readValue(buffer)!); case 137: - return PlatformCameraUpdateNewLatLng.decode(readValue(buffer)!); + return PlatformCameraUpdateNewCameraPosition.decode(readValue(buffer)!); case 138: - return PlatformCameraUpdateNewLatLngBounds.decode(readValue(buffer)!); + return PlatformCameraUpdateNewLatLng.decode(readValue(buffer)!); case 139: - return PlatformCameraUpdateNewLatLngZoom.decode(readValue(buffer)!); + return PlatformCameraUpdateNewLatLngBounds.decode(readValue(buffer)!); case 140: - return PlatformCameraUpdateScrollBy.decode(readValue(buffer)!); + return PlatformCameraUpdateNewLatLngZoom.decode(readValue(buffer)!); case 141: - return PlatformCameraUpdateZoomBy.decode(readValue(buffer)!); + return PlatformCameraUpdateScrollBy.decode(readValue(buffer)!); case 142: - return PlatformCameraUpdateZoom.decode(readValue(buffer)!); + return PlatformCameraUpdateZoomBy.decode(readValue(buffer)!); case 143: - return PlatformCameraUpdateZoomTo.decode(readValue(buffer)!); + return PlatformCameraUpdateZoom.decode(readValue(buffer)!); case 144: - return PlatformCircle.decode(readValue(buffer)!); + return PlatformCameraUpdateZoomTo.decode(readValue(buffer)!); case 145: - return PlatformHeatmap.decode(readValue(buffer)!); + return PlatformCircle.decode(readValue(buffer)!); case 146: - return PlatformClusterManager.decode(readValue(buffer)!); + return PlatformHeatmap.decode(readValue(buffer)!); case 147: - return PlatformOffset.decode(readValue(buffer)!); + return PlatformClusterManager.decode(readValue(buffer)!); case 148: - return PlatformInfoWindow.decode(readValue(buffer)!); + return PlatformOffset.decode(readValue(buffer)!); case 149: - return PlatformMarker.decode(readValue(buffer)!); + return PlatformInfoWindow.decode(readValue(buffer)!); case 150: - return PlatformPolygon.decode(readValue(buffer)!); + return PlatformMarker.decode(readValue(buffer)!); case 151: - return PlatformPolyline.decode(readValue(buffer)!); + return PlatformPolygon.decode(readValue(buffer)!); case 152: - return PlatformCap.decode(readValue(buffer)!); + return PlatformPolyline.decode(readValue(buffer)!); case 153: - return PlatformPatternItem.decode(readValue(buffer)!); + return PlatformCap.decode(readValue(buffer)!); case 154: - return PlatformTile.decode(readValue(buffer)!); + return PlatformPatternItem.decode(readValue(buffer)!); case 155: - return PlatformTileOverlay.decode(readValue(buffer)!); + return PlatformTile.decode(readValue(buffer)!); case 156: - return PlatformEdgeInsets.decode(readValue(buffer)!); + return PlatformTileOverlay.decode(readValue(buffer)!); case 157: - return PlatformLatLng.decode(readValue(buffer)!); + return PlatformEdgeInsets.decode(readValue(buffer)!); case 158: - return PlatformLatLngBounds.decode(readValue(buffer)!); + return PlatformLatLng.decode(readValue(buffer)!); case 159: - return PlatformCluster.decode(readValue(buffer)!); + return PlatformLatLngBounds.decode(readValue(buffer)!); case 160: - return PlatformCameraTargetBounds.decode(readValue(buffer)!); + return PlatformCluster.decode(readValue(buffer)!); case 161: - return PlatformMapViewCreationParams.decode(readValue(buffer)!); + return PlatformCameraTargetBounds.decode(readValue(buffer)!); case 162: - return PlatformMapConfiguration.decode(readValue(buffer)!); + return PlatformMapViewCreationParams.decode(readValue(buffer)!); case 163: - return PlatformPoint.decode(readValue(buffer)!); + return PlatformMapConfiguration.decode(readValue(buffer)!); case 164: - return PlatformTileLayer.decode(readValue(buffer)!); + return PlatformPoint.decode(readValue(buffer)!); case 165: + return PlatformTileLayer.decode(readValue(buffer)!); + case 166: return PlatformZoomRange.decode(readValue(buffer)!); - case 168: + case 167: return PlatformBitmap.decode(readValue(buffer)!); - case 169: + case 168: return PlatformBitmapDefaultMarker.decode(readValue(buffer)!); - case 170: + case 169: return PlatformBitmapBytes.decode(readValue(buffer)!); - case 171: + case 170: return PlatformBitmapAsset.decode(readValue(buffer)!); - case 172: + case 171: return PlatformBitmapAssetImage.decode(readValue(buffer)!); - case 173: + case 172: return PlatformBitmapAssetMap.decode(readValue(buffer)!); - case 174: + case 173: return PlatformBitmapBytesMap.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); 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 9224a711ead3..cade997ad140 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 @@ -292,10 +292,7 @@ class PlatformCap { final PlatformCapType type; - /// The JSON data returned by BitmapDescriptor.toJson. - // TODO(schectman): Convert to structured data. - // https://github.com/flutter/flutter/issues/155122 - final Object? bitmapDescriptor; + final PlatformBitmap? bitmapDescriptor; final double? refWidth; } 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 123d4bda60fd..21e61da798ba 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 @@ -588,10 +588,18 @@ void main() { expect(pattern?.encode(), platformPatternItemFromPatternItem(expected.patterns[i]).encode()); } - expect(actual.startCap.encode(), - platformCapFromCap(expected.startCap).encode()); - expect( - actual.endCap.encode(), platformCapFromCap(expected.endCap).encode()); + final PlatformCap expectedStartCap = + GoogleMapsFlutterAndroid.platformCapFromCap(expected.startCap); + final PlatformCap expectedEndCap = + GoogleMapsFlutterAndroid.platformCapFromCap(expected.endCap); + expect(actual.startCap.type, expectedStartCap.type); + expect(actual.startCap.refWidth, expectedStartCap.refWidth); + expect(actual.startCap.bitmapDescriptor?.bitmap.runtimeType, + expectedStartCap.bitmapDescriptor?.bitmap.runtimeType); + expect(actual.endCap.type, expectedEndCap.type); + expect(actual.endCap.refWidth, expectedEndCap.refWidth); + expect(actual.endCap.bitmapDescriptor?.bitmap.runtimeType, + expectedEndCap.bitmapDescriptor?.bitmap.runtimeType); } // Object one should be removed. @@ -1023,22 +1031,18 @@ void main() { test('Cap to PlatformCap', () { expect(GoogleMapsFlutterAndroid.platformCapFromCap(Cap.buttCap).encode(), - PlatformCap(type: PlatformCapType.butt).encode()); + PlatformCap(type: PlatformCapType.buttCap).encode()); expect(GoogleMapsFlutterAndroid.platformCapFromCap(Cap.roundCap).encode(), - PlatformCap(type: PlatformCapType.round).encode()); + PlatformCap(type: PlatformCapType.roundCap).encode()); expect(GoogleMapsFlutterAndroid.platformCapFromCap(Cap.squareCap).encode(), - PlatformCap(type: PlatformCapType.square).encode()); + PlatformCap(type: PlatformCapType.squareCap).encode()); const BitmapDescriptor bitmap = BitmapDescriptor.defaultMarker; const CustomCap customCap = CustomCap(bitmap, refWidth: 15.0); final PlatformCap platformCap = GoogleMapsFlutterAndroid.platformCapFromCap(customCap); - final PlatformCustomCap expected = PlatformCustomCap( - bitmapDescriptor: - GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap), - refWidth: 15.0); - expect(platformCap.type, PlatformCapType.custom); - expect(customCap.refWidth, expected.refWidth); + expect(platformCap.type, PlatformCapType.customCap); + expect(customCap.refWidth, 15.0); }); testWidgets('Use PlatformViewLink when using surface view', From 99edbbf7df9b8a2b96319cf3d2620c1271c4d7c5 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 10 Oct 2024 12:52:36 -0400 Subject: [PATCH 10/15] Version bump --- .../google_maps_flutter_android/CHANGELOG.md | 5 +++++ .../google_maps_flutter_android/pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 fa6f77a4219e..1b2a6366ab78 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,8 @@ +## 2.14.10 + +* Adds 'PlatformBitmap' type. +* Updates type unsafe implementations. + ## 2.14.9 * Adds `PlatformCap` for `PlatformPolyline.startCap` and `endCap`. 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 4aeb15f091d7..a9a1ec62d361 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.9 +version: 2.14.10 environment: sdk: ^3.5.0 From 604a1de6b481b49df036cc83c2614bae57ec1245 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 10 Oct 2024 13:09:26 -0400 Subject: [PATCH 11/15] Linter ignore directive --- .../lib/src/google_maps_flutter_android.dart | 15 ++++++++++++--- 1 file changed, 12 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 9ca1a3c1767b..afa95be57013 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 @@ -868,7 +868,12 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { return PlatformMapBitmapScaling.none; } - /// MapBitmapScaling is defined in the platform interface. + // The enum comes from a different package, which could get a new value at + // any time, so provide a fallback that ensures this won't break when used + // with a version that contains new values. This is deliberately outside + // the switch rather than a `default` so that the linter will flag the + // switch as needing an update. + // ignore: dead_code return PlatformMapBitmapScaling.auto; } @@ -1325,8 +1330,12 @@ PlatformPatternItem platformPatternItemFromPatternItem(PatternItem item) { type: PlatformPatternItemType.gap, length: length); } - /// [PatternItemType] is defined in the platform interface package. In case - /// a new value is added, a fallback default value is returned. + // The enum comes from a different package, which could get a new value at + // any time, so provide a fallback that ensures this won't break when used + // with a version that contains new values. This is deliberately outside + // the switch rather than a `default` so that the linter will flag the + // switch as needing an update. + // ignore: dead_code return PlatformPatternItem(type: PlatformPatternItemType.dot); } From aed6e55deddbffaa356a9a08108aa657a5e5d1d5 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 10 Oct 2024 13:37:46 -0400 Subject: [PATCH 12/15] Appease analyse overlords --- .../test/google_maps_flutter_android_test.dart | 6 ++---- 1 file changed, 2 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 21e61da798ba..13b06f0ce47b 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 @@ -996,8 +996,7 @@ void main() { final BytesMapBitmap bitmap = BitmapDescriptor.bytes(data, imagePixelRatio: 2.0, width: 100.0, - height: 200.0, - bitmapScaling: MapBitmapScaling.auto); + height: 200.0); final PlatformBitmap platformBitmap = GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap); expect(platformBitmap.bitmap, isA()); @@ -1015,8 +1014,7 @@ void main() { final AssetMapBitmap bitmap = AssetMapBitmap(assetName, imagePixelRatio: 2.0, width: 100.0, - height: 200.0, - bitmapScaling: MapBitmapScaling.auto); + height: 200.0); final PlatformBitmap platformBitmap = GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap); expect(platformBitmap.bitmap, isA()); From 16eb007c062cbcb0f19cf663aa276507d06ce0ed Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Thu, 10 Oct 2024 13:43:20 -0400 Subject: [PATCH 13/15] Update javadocs --- .../flutter/plugins/googlemaps/Convert.java | 21 +++++++++---------- .../google_maps_flutter_android_test.dart | 8 ++----- 2 files changed, 12 insertions(+), 17 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 5430bde1a889..ae6aac1d2fa7 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 @@ -138,12 +138,11 @@ private static BitmapDescriptor getBitmapFromBytesLegacy( * bytes, 'bitmapScaling' for scaling mode, and 'imagePixelRatio' for scale ratio. It may * optionally include 'width' and/or 'height' for explicit image dimensions. * - * @param bytesMap a map containing the byte data and scaling instructions. Expected keys are: - * 'byteData': the actual bytes of the image, 'bitmapScaling': the scaling mode, either 'auto' - * or 'none', 'imagePixelRatio': used with 'auto' bitmapScaling if width or height are not - * provided, 'width' (optional): the desired width, which affects scaling if 'height' is not - * provided, 'height' (optional): the desired height, which affects scaling if 'width' is not - * provided + * @param bytesMap a [PlatformBitmapBytesMap] containing the byte data from which to construct a + * [BitmapDescriptor] and a bitmap scaling mode. If the scaling mode is `AUTO`, `bytesMap` + * shall also contain an `imagePixelRatio` used to compute the scaling ratio. May also contain + * an optional `width`, which affects scaling if `height` is omitted, and `height`, which + * affects scaling if `width` is omitted. * @param density the density of the display, used to calculate pixel dimensions. * @param bitmapDescriptorFactory is an instance of the BitmapDescriptorFactoryWrapper. * @return BitmapDescriptor object from bytes data. @@ -200,11 +199,11 @@ public static BitmapDescriptor getBitmapFromBytes( * 'imagePixelRatio', and may optionally include 'width' and/or 'height' to explicitly set the * dimensions of the output image. * - * @param assetMap a map containing the asset details and scaling instructions, with keys - * 'assetName': the name of the asset file, 'bitmapScaling': the scaling mode, either 'auto' - * or 'none', 'imagePixelRatio': used with 'auto' scaling to compute the scale ratio, 'width' - * (optional): the desired width, which affects scaling if 'height' is not provided, 'height' - * (optional): the desired height, which affects scaling if 'width' is not provided + * @param assetMap a [PlatformBitmapAssetMap] containing the asset name from which to construct a + * [BitmapDescriptor] and a bitmap scaling mode. If the scaling mode is `AUTO`, `bytesMap` + * shall also contain an `imagePixelRatio` used to compute the scaling ratio. May also contain + * an optional `width`, which affects scaling if `height` is omitted, and `height`, which + * affects scaling if `width` is omitted. * @param assetManager assetManager An instance of Android's AssetManager, which provides access * to any raw asset files stored in the application's assets directory. * @param density density the density of the display, used to calculate pixel dimensions. 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 13b06f0ce47b..79c84fa0f2fb 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 @@ -994,9 +994,7 @@ void main() { test('BytesMapBitmap bitmap to PlatformBitmap', () { final Uint8List data = Uint8List.fromList([1, 2, 3, 4]); final BytesMapBitmap bitmap = BitmapDescriptor.bytes(data, - imagePixelRatio: 2.0, - width: 100.0, - height: 200.0); + imagePixelRatio: 2.0, width: 100.0, height: 200.0); final PlatformBitmap platformBitmap = GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap); expect(platformBitmap.bitmap, isA()); @@ -1012,9 +1010,7 @@ void main() { test('AssetMapBitmap bitmap to PlatformBitmap', () { const String assetName = 'fake_asset_name'; final AssetMapBitmap bitmap = AssetMapBitmap(assetName, - imagePixelRatio: 2.0, - width: 100.0, - height: 200.0); + imagePixelRatio: 2.0, width: 100.0, height: 200.0); final PlatformBitmap platformBitmap = GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap); expect(platformBitmap.bitmap, isA()); From 56f3498851a1f3d902587c94ebc4c7bc65de73c3 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Fri, 11 Oct 2024 17:06:12 -0400 Subject: [PATCH 14/15] PR feedback --- .../flutter/plugins/googlemaps/Convert.java | 23 +- .../flutter/plugins/googlemaps/Messages.java | 196 +++++++++++------- .../ClusterManagersControllerTest.java | 4 +- .../googlemaps/MarkersControllerTest.java | 6 +- .../lib/src/google_maps_flutter_android.dart | 18 +- .../lib/src/messages.g.dart | 73 ++++--- .../pigeons/messages.dart | 43 +++- .../google_maps_flutter_android_test.dart | 24 +-- 8 files changed, 236 insertions(+), 151 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 ae6aac1d2fa7..84c49ec6ee95 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 @@ -139,10 +139,8 @@ private static BitmapDescriptor getBitmapFromBytesLegacy( * optionally include 'width' and/or 'height' for explicit image dimensions. * * @param bytesMap a [PlatformBitmapBytesMap] containing the byte data from which to construct a - * [BitmapDescriptor] and a bitmap scaling mode. If the scaling mode is `AUTO`, `bytesMap` - * shall also contain an `imagePixelRatio` used to compute the scaling ratio. May also contain - * an optional `width`, which affects scaling if `height` is omitted, and `height`, which - * affects scaling if `width` is omitted. + * [BitmapDescriptor] and a bitmap scaling mode. The optional `width` affects scaling when + * `height` is `null`, and the optional `height` affects scaling when `width` is `null. * @param density the density of the display, used to calculate pixel dimensions. * @param bitmapDescriptorFactory is an instance of the BitmapDescriptorFactoryWrapper. * @return BitmapDescriptor object from bytes data. @@ -200,10 +198,8 @@ public static BitmapDescriptor getBitmapFromBytes( * dimensions of the output image. * * @param assetMap a [PlatformBitmapAssetMap] containing the asset name from which to construct a - * [BitmapDescriptor] and a bitmap scaling mode. If the scaling mode is `AUTO`, `bytesMap` - * shall also contain an `imagePixelRatio` used to compute the scaling ratio. May also contain - * an optional `width`, which affects scaling if `height` is omitted, and `height`, which - * affects scaling if `width` is omitted. + * [BitmapDescriptor] and a bitmap scaling mode. The optional `width` affects scaling when + * `height` is `null`, and the optional `height` affects scaling when `width` is `null. * @param assetManager assetManager An instance of Android's AssetManager, which provides access * to any raw asset files stored in the application's assets directory. * @param density density the density of the display, used to calculate pixel dimensions. @@ -456,11 +452,11 @@ static Point pointFromPigeon(Messages.PlatformPoint point) { } @Nullable - static Point pointFromPigeon(@Nullable Messages.PlatformOffset point, float density) { + static Point pointFromPigeon(@Nullable Messages.PlatformDoublePair point, float density) { if (point == null) { return null; } - return new Point((int) (point.getDx() * density), (int) (point.getDy() * density)); + return new Point((int) (point.getX() * density), (int) (point.getY() * density)); } static Messages.PlatformPoint pointToPigeon(Point point) { @@ -598,8 +594,7 @@ static void interpretMarkerOptions( float density, BitmapDescriptorFactoryWrapper wrapper) { sink.setAlpha(marker.getAlpha().floatValue()); - sink.setAnchor( - marker.getAnchor().getDx().floatValue(), marker.getAnchor().getDy().floatValue()); + sink.setAnchor(marker.getAnchor().getX().floatValue(), marker.getAnchor().getY().floatValue()); sink.setConsumeTapEvents(marker.getConsumeTapEvents()); sink.setDraggable(marker.getDraggable()); sink.setFlat(marker.getFlat()); @@ -617,9 +612,9 @@ private static void interpretInfoWindowOptions( if (title != null) { sink.setInfoWindowText(title, infoWindow.getSnippet()); } - Messages.PlatformOffset infoWindowAnchor = infoWindow.getAnchor(); + Messages.PlatformDoublePair infoWindowAnchor = infoWindow.getAnchor(); sink.setInfoWindowAnchor( - infoWindowAnchor.getDx().floatValue(), infoWindowAnchor.getDy().floatValue()); + infoWindowAnchor.getX().floatValue(), infoWindowAnchor.getY().floatValue()); } static String interpretPolygonOptions(Messages.PlatformPolygon polygon, PolygonOptionsSink sink) { 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 b246f06ea2d7..d2e29fab127c 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 @@ -144,6 +144,7 @@ public enum PlatformPatternItemType { } } + /** Pigeon equivalent of [MapBitmapScaling]. */ public enum PlatformMapBitmapScaling { AUTO(0), NONE(1); @@ -838,13 +839,13 @@ public void setAmount(@NonNull Double setterArg) { this.amount = setterArg; } - private @Nullable PlatformOffset focus; + private @Nullable PlatformDoublePair focus; - public @Nullable PlatformOffset getFocus() { + public @Nullable PlatformDoublePair getFocus() { return focus; } - public void setFocus(@Nullable PlatformOffset setterArg) { + public void setFocus(@Nullable PlatformDoublePair setterArg) { this.focus = setterArg; } @@ -878,10 +879,10 @@ public static final class Builder { return this; } - private @Nullable PlatformOffset focus; + private @Nullable PlatformDoublePair focus; @CanIgnoreReturnValue - public @NonNull Builder setFocus(@Nullable PlatformOffset setterArg) { + public @NonNull Builder setFocus(@Nullable PlatformDoublePair setterArg) { this.focus = setterArg; return this; } @@ -907,7 +908,7 @@ ArrayList toList() { Object amount = pigeonVar_list.get(0); pigeonResult.setAmount((Double) amount); Object focus = pigeonVar_list.get(1); - pigeonResult.setFocus((PlatformOffset) focus); + pigeonResult.setFocus((PlatformDoublePair) focus); return pigeonResult; } } @@ -1489,39 +1490,39 @@ ArrayList toList() { } /** - * Pigeon equivalent of the Offset class. + * Pair of double values, such as for an offset or size. * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformOffset { - private @NonNull Double dx; + public static final class PlatformDoublePair { + private @NonNull Double x; - public @NonNull Double getDx() { - return dx; + public @NonNull Double getX() { + return x; } - public void setDx(@NonNull Double setterArg) { + public void setX(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"dx\" is null."); + throw new IllegalStateException("Nonnull field \"x\" is null."); } - this.dx = setterArg; + this.x = setterArg; } - private @NonNull Double dy; + private @NonNull Double y; - public @NonNull Double getDy() { - return dy; + public @NonNull Double getY() { + return y; } - public void setDy(@NonNull Double setterArg) { + public void setY(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"dy\" is null."); + throw new IllegalStateException("Nonnull field \"y\" is null."); } - this.dy = setterArg; + this.y = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformOffset() {} + PlatformDoublePair() {} @Override public boolean equals(Object o) { @@ -1531,37 +1532,37 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformOffset that = (PlatformOffset) o; - return dx.equals(that.dx) && dy.equals(that.dy); + PlatformDoublePair that = (PlatformDoublePair) o; + return x.equals(that.x) && y.equals(that.y); } @Override public int hashCode() { - return Objects.hash(dx, dy); + return Objects.hash(x, y); } public static final class Builder { - private @Nullable Double dx; + private @Nullable Double x; @CanIgnoreReturnValue - public @NonNull Builder setDx(@NonNull Double setterArg) { - this.dx = setterArg; + public @NonNull Builder setX(@NonNull Double setterArg) { + this.x = setterArg; return this; } - private @Nullable Double dy; + private @Nullable Double y; @CanIgnoreReturnValue - public @NonNull Builder setDy(@NonNull Double setterArg) { - this.dy = setterArg; + public @NonNull Builder setY(@NonNull Double setterArg) { + this.y = setterArg; return this; } - public @NonNull PlatformOffset build() { - PlatformOffset pigeonReturn = new PlatformOffset(); - pigeonReturn.setDx(dx); - pigeonReturn.setDy(dy); + public @NonNull PlatformDoublePair build() { + PlatformDoublePair pigeonReturn = new PlatformDoublePair(); + pigeonReturn.setX(x); + pigeonReturn.setY(y); return pigeonReturn; } } @@ -1569,17 +1570,17 @@ public static final class Builder { @NonNull ArrayList toList() { ArrayList toListResult = new ArrayList<>(2); - toListResult.add(dx); - toListResult.add(dy); + toListResult.add(x); + toListResult.add(y); return toListResult; } - static @NonNull PlatformOffset fromList(@NonNull ArrayList pigeonVar_list) { - PlatformOffset pigeonResult = new PlatformOffset(); - Object dx = pigeonVar_list.get(0); - pigeonResult.setDx((Double) dx); - Object dy = pigeonVar_list.get(1); - pigeonResult.setDy((Double) dy); + static @NonNull PlatformDoublePair fromList(@NonNull ArrayList pigeonVar_list) { + PlatformDoublePair pigeonResult = new PlatformDoublePair(); + Object x = pigeonVar_list.get(0); + pigeonResult.setX((Double) x); + Object y = pigeonVar_list.get(1); + pigeonResult.setY((Double) y); return pigeonResult; } } @@ -1610,13 +1611,13 @@ public void setSnippet(@Nullable String setterArg) { this.snippet = setterArg; } - private @NonNull PlatformOffset anchor; + private @NonNull PlatformDoublePair anchor; - public @NonNull PlatformOffset getAnchor() { + public @NonNull PlatformDoublePair getAnchor() { return anchor; } - public void setAnchor(@NonNull PlatformOffset setterArg) { + public void setAnchor(@NonNull PlatformDoublePair setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"anchor\" is null."); } @@ -1663,10 +1664,10 @@ public static final class Builder { return this; } - private @Nullable PlatformOffset anchor; + private @Nullable PlatformDoublePair anchor; @CanIgnoreReturnValue - public @NonNull Builder setAnchor(@NonNull PlatformOffset setterArg) { + public @NonNull Builder setAnchor(@NonNull PlatformDoublePair setterArg) { this.anchor = setterArg; return this; } @@ -1696,7 +1697,7 @@ ArrayList toList() { Object snippet = pigeonVar_list.get(1); pigeonResult.setSnippet((String) snippet); Object anchor = pigeonVar_list.get(2); - pigeonResult.setAnchor((PlatformOffset) anchor); + pigeonResult.setAnchor((PlatformDoublePair) anchor); return pigeonResult; } } @@ -1720,13 +1721,13 @@ public void setAlpha(@NonNull Double setterArg) { this.alpha = setterArg; } - private @NonNull PlatformOffset anchor; + private @NonNull PlatformDoublePair anchor; - public @NonNull PlatformOffset getAnchor() { + public @NonNull PlatformDoublePair getAnchor() { return anchor; } - public void setAnchor(@NonNull PlatformOffset setterArg) { + public void setAnchor(@NonNull PlatformDoublePair setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"anchor\" is null."); } @@ -1928,10 +1929,10 @@ public static final class Builder { return this; } - private @Nullable PlatformOffset anchor; + private @Nullable PlatformDoublePair anchor; @CanIgnoreReturnValue - public @NonNull Builder setAnchor(@NonNull PlatformOffset setterArg) { + public @NonNull Builder setAnchor(@NonNull PlatformDoublePair setterArg) { this.anchor = setterArg; return this; } @@ -2067,7 +2068,7 @@ ArrayList toList() { Object alpha = pigeonVar_list.get(0); pigeonResult.setAlpha((Double) alpha); Object anchor = pigeonVar_list.get(1); - pigeonResult.setAnchor((PlatformOffset) anchor); + pigeonResult.setAnchor((PlatformDoublePair) anchor); Object consumeTapEvents = pigeonVar_list.get(2); pigeonResult.setConsumeTapEvents((Boolean) consumeTapEvents); Object draggable = pigeonVar_list.get(3); @@ -5021,8 +5022,21 @@ ArrayList toList() { } } - /** Generated class from Pigeon that represents data sent in messages. */ + /** + * Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint types of + * [BitmapDescriptor], [PlatformBitmap] contains a single field which may hold the pigeon + * equivalent type of any of them. + * + *

Generated class from Pigeon that represents data sent in messages. + */ public static final class PlatformBitmap { + /** + * One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], [PlatformBitmapAssetImage], + * [PlatformBitmapBytesMap], [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. As Pigeon + * does not currently support data class inheritance, this approach allows for the different + * bitmap implementations to be valid argument and return types of the API methods. See + * https://github.com/flutter/flutter/issues/117819. + */ private @NonNull Object bitmap; public @NonNull Object getBitmap() { @@ -5088,7 +5102,12 @@ ArrayList toList() { } } - /** Generated class from Pigeon that represents data sent in messages. */ + /** + * Pigeon equivalent of [DefaultMarker]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#defaultMarker(float) + * + *

Generated class from Pigeon that represents data sent in messages. + */ public static final class PlatformBitmapDefaultMarker { private @Nullable Double hue; @@ -5150,7 +5169,12 @@ ArrayList toList() { } } - /** Generated class from Pigeon that represents data sent in messages. */ + /** + * Pigeon equivalent of [BytesBitmap]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#fromBitmap(android.graphics.Bitmap) + * + *

Generated class from Pigeon that represents data sent in messages. + */ public static final class PlatformBitmapBytes { private @NonNull byte[] byteData; @@ -5165,13 +5189,13 @@ public void setByteData(@NonNull byte[] setterArg) { this.byteData = setterArg; } - private @Nullable PlatformOffset size; + private @Nullable PlatformDoublePair size; - public @Nullable PlatformOffset getSize() { + public @Nullable PlatformDoublePair getSize() { return size; } - public void setSize(@Nullable PlatformOffset setterArg) { + public void setSize(@Nullable PlatformDoublePair setterArg) { this.size = setterArg; } @@ -5207,10 +5231,10 @@ public static final class Builder { return this; } - private @Nullable PlatformOffset size; + private @Nullable PlatformDoublePair size; @CanIgnoreReturnValue - public @NonNull Builder setSize(@Nullable PlatformOffset setterArg) { + public @NonNull Builder setSize(@Nullable PlatformDoublePair setterArg) { this.size = setterArg; return this; } @@ -5236,12 +5260,17 @@ ArrayList toList() { Object byteData = pigeonVar_list.get(0); pigeonResult.setByteData((byte[]) byteData); Object size = pigeonVar_list.get(1); - pigeonResult.setSize((PlatformOffset) size); + pigeonResult.setSize((PlatformDoublePair) size); return pigeonResult; } } - /** Generated class from Pigeon that represents data sent in messages. */ + /** + * Pigeon equivalent of [AssetBitmap]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname + * + *

Generated class from Pigeon that represents data sent in messages. + */ public static final class PlatformBitmapAsset { private @NonNull String name; @@ -5330,7 +5359,12 @@ ArrayList toList() { } } - /** Generated class from Pigeon that represents data sent in messages. */ + /** + * Pigeon equivalent of [AssetImageBitmap]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname + * + *

Generated class from Pigeon that represents data sent in messages. + */ public static final class PlatformBitmapAssetImage { private @NonNull String name; @@ -5358,13 +5392,13 @@ public void setScale(@NonNull Double setterArg) { this.scale = setterArg; } - private @Nullable PlatformOffset size; + private @Nullable PlatformDoublePair size; - public @Nullable PlatformOffset getSize() { + public @Nullable PlatformDoublePair getSize() { return size; } - public void setSize(@Nullable PlatformOffset setterArg) { + public void setSize(@Nullable PlatformDoublePair setterArg) { this.size = setterArg; } @@ -5406,10 +5440,10 @@ public static final class Builder { return this; } - private @Nullable PlatformOffset size; + private @Nullable PlatformDoublePair size; @CanIgnoreReturnValue - public @NonNull Builder setSize(@Nullable PlatformOffset setterArg) { + public @NonNull Builder setSize(@Nullable PlatformDoublePair setterArg) { this.size = setterArg; return this; } @@ -5439,12 +5473,17 @@ ArrayList toList() { Object scale = pigeonVar_list.get(1); pigeonResult.setScale((Double) scale); Object size = pigeonVar_list.get(2); - pigeonResult.setSize((PlatformOffset) size); + pigeonResult.setSize((PlatformDoublePair) size); return pigeonResult; } } - /** Generated class from Pigeon that represents data sent in messages. */ + /** + * Pigeon equivalent of [AssetMapBitmap]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname + * + *

Generated class from Pigeon that represents data sent in messages. + */ public static final class PlatformBitmapAssetMap { private @NonNull String assetName; @@ -5609,7 +5648,12 @@ ArrayList toList() { } } - /** Generated class from Pigeon that represents data sent in messages. */ + /** + * Pigeon equivalent of [BytesMapBitmap]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-frombitmap-bitmap-image + * + *

Generated class from Pigeon that represents data sent in messages. + */ public static final class PlatformBitmapBytesMap { private @NonNull byte[] byteData; @@ -5847,7 +5891,7 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { case (byte) 147: return PlatformClusterManager.fromList((ArrayList) readValue(buffer)); case (byte) 148: - return PlatformOffset.fromList((ArrayList) readValue(buffer)); + return PlatformDoublePair.fromList((ArrayList) readValue(buffer)); case (byte) 149: return PlatformInfoWindow.fromList((ArrayList) readValue(buffer)); case (byte) 150: @@ -5962,9 +6006,9 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } else if (value instanceof PlatformClusterManager) { stream.write(147); writeValue(stream, ((PlatformClusterManager) value).toList()); - } else if (value instanceof PlatformOffset) { + } else if (value instanceof PlatformDoublePair) { stream.write(148); - writeValue(stream, ((PlatformOffset) value).toList()); + writeValue(stream, ((PlatformDoublePair) value).toList()); } else if (value instanceof PlatformInfoWindow) { stream.write(149); writeValue(stream, ((PlatformInfoWindow) value).toList()); 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 2d596b8c9401..d35b7a8022fb 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 @@ -191,8 +191,8 @@ private Messages.PlatformMarker createPlatformMarker( .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) .build()) .build(); - Messages.PlatformOffset anchor = - new Messages.PlatformOffset.Builder().setDx(0.0).setDy(0.0).build(); + Messages.PlatformDoublePair anchor = + new Messages.PlatformDoublePair.Builder().setX(0.0).setY(0.0).build(); 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 b32a82ab5c2f..6df43c1a7f26 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 @@ -68,14 +68,14 @@ private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) .build()) .build(); - Messages.PlatformOffset anchor = - new Messages.PlatformOffset.Builder().setDx(0.5).setDy(0.0).build(); + Messages.PlatformDoublePair anchor = + new Messages.PlatformDoublePair.Builder().setX(0.5).setY(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()) + .setAnchor(new Messages.PlatformDoublePair.Builder().setX(0.0).setY(0.0).build()) .setFlat(false) .setDraggable(false) .setVisible(true) 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 afa95be57013..32a751825d71 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 @@ -681,12 +681,12 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { latitude: latLng.latitude, longitude: latLng.longitude); } - static PlatformOffset _platformOffsetFromOffset(Offset offset) { - return PlatformOffset(dx: offset.dx, dy: offset.dy); + static PlatformDoublePair _platformPairFromOffset(Offset offset) { + return PlatformDoublePair(x: offset.dx, y: offset.dy); } - static PlatformOffset _platformOffsetFromSize(Size size) { - return PlatformOffset(dx: size.width, dy: size.height); + static PlatformDoublePair _platformPairFromSize(Size size) { + return PlatformDoublePair(x: size.width, y: size.height); } static ScreenCoordinate _screenCoordinateFromPlatformPoint( @@ -728,13 +728,13 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { return PlatformInfoWindow( title: window.title, snippet: window.snippet, - anchor: _platformOffsetFromOffset(window.anchor)); + anchor: _platformPairFromOffset(window.anchor)); } static PlatformMarker _platformMarkerFromMarker(Marker marker) { return PlatformMarker( alpha: marker.alpha, - anchor: _platformOffsetFromOffset(marker.anchor), + anchor: _platformPairFromOffset(marker.anchor), consumeTapEvents: marker.consumeTapEvents, draggable: marker.draggable, flat: marker.flat, @@ -840,7 +840,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { amount: update.amount, focus: update.focus == null ? null - : _platformOffsetFromOffset(update.focus!))); + : _platformPairFromOffset(update.focus!))); case CameraUpdateType.zoomIn: update as CameraUpdateZoomIn; return PlatformCameraUpdate( @@ -891,7 +891,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { byteData: bytes.byteData, size: (bytes.size == null) ? null - : _platformOffsetFromSize(bytes.size!))); + : _platformPairFromSize(bytes.size!))); case final AssetBitmap asset: return PlatformBitmap( bitmap: PlatformBitmapAsset(name: asset.name, pkg: asset.package)); @@ -902,7 +902,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { scale: asset.scale, size: (asset.size == null) ? null - : _platformOffsetFromSize(asset.size!))); + : _platformPairFromSize(asset.size!))); case final AssetMapBitmap asset: return PlatformBitmap( bitmap: PlatformBitmapAssetMap( 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 5884406fd616..51bf2abd56f6 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 @@ -67,6 +67,7 @@ enum PlatformPatternItemType { gap, } +/// Pigeon equivalent of [MapBitmapScaling]. enum PlatformMapBitmapScaling { auto, none, @@ -271,7 +272,7 @@ class PlatformCameraUpdateZoomBy { double amount; - PlatformOffset? focus; + PlatformDoublePair? focus; Object encode() { return [ @@ -284,7 +285,7 @@ class PlatformCameraUpdateZoomBy { result as List; return PlatformCameraUpdateZoomBy( amount: result[0]! as double, - focus: result[1] as PlatformOffset?, + focus: result[1] as PlatformDoublePair?, ); } } @@ -442,29 +443,29 @@ class PlatformClusterManager { } } -/// Pigeon equivalent of the Offset class. -class PlatformOffset { - PlatformOffset({ - required this.dx, - required this.dy, +/// Pair of double values, such as for an offset or size. +class PlatformDoublePair { + PlatformDoublePair({ + required this.x, + required this.y, }); - double dx; + double x; - double dy; + double y; Object encode() { return [ - dx, - dy, + x, + y, ]; } - static PlatformOffset decode(Object result) { + static PlatformDoublePair decode(Object result) { result as List; - return PlatformOffset( - dx: result[0]! as double, - dy: result[1]! as double, + return PlatformDoublePair( + x: result[0]! as double, + y: result[1]! as double, ); } } @@ -481,7 +482,7 @@ class PlatformInfoWindow { String? snippet; - PlatformOffset anchor; + PlatformDoublePair anchor; Object encode() { return [ @@ -496,7 +497,7 @@ class PlatformInfoWindow { return PlatformInfoWindow( title: result[0] as String?, snippet: result[1] as String?, - anchor: result[2]! as PlatformOffset, + anchor: result[2]! as PlatformDoublePair, ); } } @@ -521,7 +522,7 @@ class PlatformMarker { double alpha; - PlatformOffset anchor; + PlatformDoublePair anchor; bool consumeTapEvents; @@ -567,7 +568,7 @@ class PlatformMarker { result as List; return PlatformMarker( alpha: result[0]! as double, - anchor: result[1]! as PlatformOffset, + anchor: result[1]! as PlatformDoublePair, consumeTapEvents: result[2]! as bool, draggable: result[3]! as bool, flat: result[4]! as bool, @@ -1296,11 +1297,21 @@ class PlatformZoomRange { } } +/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint +/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which +/// may hold the pigeon equivalent type of any of them. class PlatformBitmap { PlatformBitmap({ required this.bitmap, }); + /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], + /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], + /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. + /// As Pigeon does not currently support data class inheritance, this + /// approach allows for the different bitmap implementations to be valid + /// argument and return types of the API methods. See + /// https://github.com/flutter/flutter/issues/117819. Object bitmap; Object encode() { @@ -1317,6 +1328,8 @@ class PlatformBitmap { } } +/// Pigeon equivalent of [DefaultMarker]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#defaultMarker(float) class PlatformBitmapDefaultMarker { PlatformBitmapDefaultMarker({ this.hue, @@ -1338,6 +1351,8 @@ class PlatformBitmapDefaultMarker { } } +/// Pigeon equivalent of [BytesBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#fromBitmap(android.graphics.Bitmap) class PlatformBitmapBytes { PlatformBitmapBytes({ required this.byteData, @@ -1346,7 +1361,7 @@ class PlatformBitmapBytes { Uint8List byteData; - PlatformOffset? size; + PlatformDoublePair? size; Object encode() { return [ @@ -1359,11 +1374,13 @@ class PlatformBitmapBytes { result as List; return PlatformBitmapBytes( byteData: result[0]! as Uint8List, - size: result[1] as PlatformOffset?, + size: result[1] as PlatformDoublePair?, ); } } +/// Pigeon equivalent of [AssetBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname class PlatformBitmapAsset { PlatformBitmapAsset({ required this.name, @@ -1390,6 +1407,8 @@ class PlatformBitmapAsset { } } +/// Pigeon equivalent of [AssetImageBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname class PlatformBitmapAssetImage { PlatformBitmapAssetImage({ required this.name, @@ -1401,7 +1420,7 @@ class PlatformBitmapAssetImage { double scale; - PlatformOffset? size; + PlatformDoublePair? size; Object encode() { return [ @@ -1416,11 +1435,13 @@ class PlatformBitmapAssetImage { return PlatformBitmapAssetImage( name: result[0]! as String, scale: result[1]! as double, - size: result[2] as PlatformOffset?, + size: result[2] as PlatformDoublePair?, ); } } +/// Pigeon equivalent of [AssetMapBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname class PlatformBitmapAssetMap { PlatformBitmapAssetMap({ required this.assetName, @@ -1462,6 +1483,8 @@ class PlatformBitmapAssetMap { } } +/// Pigeon equivalent of [BytesMapBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-frombitmap-bitmap-image class PlatformBitmapBytesMap { PlatformBitmapBytesMap({ required this.byteData, @@ -1567,7 +1590,7 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is PlatformClusterManager) { buffer.putUint8(147); writeValue(buffer, value.encode()); - } else if (value is PlatformOffset) { + } else if (value is PlatformDoublePair) { buffer.putUint8(148); writeValue(buffer, value.encode()); } else if (value is PlatformInfoWindow) { @@ -1698,7 +1721,7 @@ class _PigeonCodec extends StandardMessageCodec { case 147: return PlatformClusterManager.decode(readValue(buffer)!); case 148: - return PlatformOffset.decode(readValue(buffer)!); + return PlatformDoublePair.decode(readValue(buffer)!); case 149: return PlatformInfoWindow.decode(readValue(buffer)!); case 150: 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 cade997ad140..4982a9390eae 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 PlatformCameraUpdateScrollBy { class PlatformCameraUpdateZoomBy { PlatformCameraUpdateZoomBy(this.amount, [this.focus]); final double amount; - final PlatformOffset? focus; + final PlatformDoublePair? focus; } /// Pigeon equivalent of ZoomIn/ZoomOut @@ -147,12 +147,12 @@ class PlatformClusterManager { final String identifier; } -/// Pigeon equivalent of the Offset class. -class PlatformOffset { - PlatformOffset(this.dx, this.dy); +/// Pair of double values, such as for an offset or size. +class PlatformDoublePair { + PlatformDoublePair(this.x, this.y); - final double dx; - final double dy; + final double x; + final double y; } /// Pigeon equivalent of the InfoWindow class. @@ -165,7 +165,7 @@ class PlatformInfoWindow { final String? title; final String? snippet; - final PlatformOffset anchor; + final PlatformDoublePair anchor; } /// Pigeon equivalent of the Marker class. @@ -187,7 +187,7 @@ class PlatformMarker { }); final double alpha; - final PlatformOffset anchor; + final PlatformDoublePair anchor; final bool consumeTapEvents; final bool draggable; final bool flat; @@ -504,25 +504,41 @@ class PlatformZoomRange { final double? max; } +/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint +/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which +/// may hold the pigeon equivalent type of any of them. class PlatformBitmap { PlatformBitmap({required this.bitmap}); + /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], + /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], + /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. + /// As Pigeon does not currently support data class inheritance, this + /// approach allows for the different bitmap implementations to be valid + /// argument and return types of the API methods. See + /// https://github.com/flutter/flutter/issues/117819. final Object bitmap; } +/// Pigeon equivalent of [DefaultMarker]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#defaultMarker(float) class PlatformBitmapDefaultMarker { PlatformBitmapDefaultMarker({this.hue}); final double? hue; } +/// Pigeon equivalent of [BytesBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#fromBitmap(android.graphics.Bitmap) class PlatformBitmapBytes { PlatformBitmapBytes({required this.byteData, this.size}); final Uint8List byteData; - final PlatformOffset? size; + final PlatformDoublePair? size; } +/// Pigeon equivalent of [AssetBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname class PlatformBitmapAsset { PlatformBitmapAsset({required this.name, this.pkg}); @@ -530,19 +546,24 @@ class PlatformBitmapAsset { final String? pkg; } +/// Pigeon equivalent of [AssetImageBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname class PlatformBitmapAssetImage { PlatformBitmapAssetImage( {required this.name, required this.scale, this.size}); final String name; final double scale; - final PlatformOffset? size; + final PlatformDoublePair? size; } +/// Pigeon equivalent of [MapBitmapScaling]. enum PlatformMapBitmapScaling { auto, none, } +/// Pigeon equivalent of [AssetMapBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname class PlatformBitmapAssetMap { PlatformBitmapAssetMap( {required this.assetName, @@ -557,6 +578,8 @@ class PlatformBitmapAssetMap { final double? height; } +/// Pigeon equivalent of [BytesMapBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-frombitmap-bitmap-image class PlatformBitmapBytesMap { PlatformBitmapBytesMap( {required this.byteData, 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 79c84fa0f2fb..2b3bd06edc0b 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,9 +408,9 @@ void main() { 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); + final PlatformDoublePair? offset = encoded?[1] as PlatformDoublePair?; + expect(offset?.x, object2new.anchor.dx); + expect(offset?.y, object2new.anchor.dy); expect(encoded?.getRange(2, 5).toList(), [ object2new.consumeTapEvents, object2new.draggable, @@ -425,8 +425,8 @@ void main() { 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); + expect(window?.anchor.x, object2new.infoWindow.anchor.dx); + expect(window?.anchor.y, object2new.infoWindow.anchor.dy); final PlatformLatLng? latLng = encoded?[7] as PlatformLatLng?; expect(latLng?.latitude, object2new.position.latitude); expect(latLng?.longitude, object2new.position.longitude); @@ -443,9 +443,9 @@ void main() { 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); + final PlatformDoublePair? offset = encoded?[1] as PlatformDoublePair?; + expect(offset?.x, object3.anchor.dx); + expect(offset?.y, object3.anchor.dy); expect(encoded?.getRange(2, 5).toList(), [ object3.consumeTapEvents, object3.draggable, @@ -460,8 +460,8 @@ void main() { 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); + expect(window?.anchor.x, object3.infoWindow.anchor.dx); + expect(window?.anchor.y, object3.infoWindow.anchor.dy); final PlatformLatLng? latLng = encoded?[7] as PlatformLatLng?; expect(latLng?.latitude, object3.position.latitude); expect(latLng?.longitude, object3.position.longitude); @@ -916,8 +916,8 @@ void main() { final PlatformCameraUpdateZoomBy typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoomBy; update as CameraUpdateZoomBy; - expect(typedUpdate.focus?.dx, update.focus?.dx); - expect(typedUpdate.focus?.dy, update.focus?.dy); + expect(typedUpdate.focus?.x, update.focus?.dx); + expect(typedUpdate.focus?.y, update.focus?.dy); expect(typedUpdate.amount, update.amount); }); From 80a40d62ff112eebc543f861bce27d8f6d58ed2d Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Mon, 14 Oct 2024 06:10:19 -0400 Subject: [PATCH 15/15] Clean comments --- .../java/io/flutter/plugins/googlemaps/Convert.java | 10 +++------- 1 file changed, 3 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 84c49ec6ee95..5701825f12d9 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 @@ -134,10 +134,6 @@ private static BitmapDescriptor getBitmapFromBytesLegacy( /** * Creates a BitmapDescriptor object from bytes data. * - *

This method requires the `byteData` map to contain specific keys: 'byteData' for image - * bytes, 'bitmapScaling' for scaling mode, and 'imagePixelRatio' for scale ratio. It may - * optionally include 'width' and/or 'height' for explicit image dimensions. - * * @param bytesMap a [PlatformBitmapBytesMap] containing the byte data from which to construct a * [BitmapDescriptor] and a bitmap scaling mode. The optional `width` affects scaling when * `height` is `null`, and the optional `height` affects scaling when `width` is `null. @@ -193,9 +189,9 @@ public static BitmapDescriptor getBitmapFromBytes( * Creates a BitmapDescriptor object from asset, using given details and density. * *

This method processes an asset specified by name and applies scaling based on the provided - * parameters. The `assetDetails` map must contain the keys 'assetName', 'bitmapScaling', and - * 'imagePixelRatio', and may optionally include 'width' and/or 'height' to explicitly set the - * dimensions of the output image. + * parameters. The `assetMap` object provides the asset name, bitmap scaling mode, and image pixel + * ratio, and may optionally include 'width' and/or 'height' to explicitly set the dimensions of + * the output image. * * @param assetMap a [PlatformBitmapAssetMap] containing the asset name from which to construct a * [BitmapDescriptor] and a bitmap scaling mode. The optional `width` affects scaling when