From 85ca2e5663e7f21ff4282552c664b56c02b57e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Thu, 26 Sep 2024 14:13:59 +0800 Subject: [PATCH 01/18] feat: implementing separate google map view on flutter side wip --- .../maps/flutter/navigation/messages.g.kt | 2132 ++++------- ios/Classes/messages.g.swift | 2607 +++++--------- lib/google_navigation_flutter.dart | 4 + lib/src/google_maps_map_view.dart | 288 ++ lib/src/google_maps_map_view_controller.dart | 681 ++++ lib/src/google_maps_navigation_view.dart | 288 ++ ...oogle_maps_navigation_view_controller.dart | 681 ++++ lib/src/google_navigation_flutter.dart | 962 ----- .../google_navigation_flutter_android.dart | 28 +- lib/src/google_navigation_flutter_ios.dart | 28 +- ...navigation_flutter_platform_interface.dart | 24 +- lib/src/method_channel/common_view_api.dart | 46 +- lib/src/method_channel/messages.g.dart | 1825 ++++------ .../types/view_initialization_options.dart | 72 +- pigeons/messages.dart | 25 +- test/messages_test.g.dart | 3178 ++++++----------- 16 files changed, 5424 insertions(+), 7445 deletions(-) create mode 100644 lib/src/google_maps_map_view.dart create mode 100644 lib/src/google_maps_map_view_controller.dart create mode 100644 lib/src/google_maps_navigation_view.dart create mode 100644 lib/src/google_maps_navigation_view_controller.dart diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/messages.g.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/messages.g.kt index 72efd2b..88d165d 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/messages.g.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/messages.g.kt @@ -1,17 +1,17 @@ // Copyright 2023 Google LLC -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // https://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Autogenerated from Pigeon (v15.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -31,7 +31,11 @@ private fun wrapResult(result: Any?): List { private fun wrapError(exception: Throwable): List { if (exception is FlutterError) { - return listOf(exception.code, exception.message, exception.details) + return listOf( + exception.code, + exception.message, + exception.details + ) } else { return listOf( exception.javaClass.simpleName, @@ -42,29 +46,40 @@ private fun wrapError(exception: Throwable): List { } private fun createConnectionError(channelName: String): FlutterError { - return FlutterError( - "channel-error", - "Unable to establish connection on channel: '$channelName'.", - "" - ) -} + return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")} /** * Error class for passing custom error details to Flutter via a thrown PlatformException. - * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class FlutterError( +class FlutterError ( val code: String, override val message: String? = null, val details: Any? = null ) : Throwable() +/** Describes the type of map to construct. */ +enum class MapViewTypeDto(val raw: Int) { + /** Navigation view supports navigation overlay, and current navigation session is displayed on the map. */ + NAVIGATION(0), + /** Classic map view, without navigation overlay. */ + MAP(1); + + companion object { + fun ofRaw(raw: Int): MapViewTypeDto? { + return values().firstOrNull { it.raw == raw } + } + } +} + /** Determines the initial visibility of the navigation UI on map initialization. */ enum class NavigationUIEnabledPreferenceDto(val raw: Int) { - /** Navigation UI gets enabled if the navigation session has already been successfully started. */ + /** + * Navigation UI gets enabled if the navigation + * session has already been successfully started. + */ AUTOMATIC(0), /** Navigation UI is disabled. */ DISABLED(1); @@ -326,9 +341,7 @@ enum class ManeuverDto(val raw: Int) { OFFRAMPUTURNCOUNTERCLOCKWISE(22), /** Keep to the left side of the road when entering a turnpike or freeway as the road diverges. */ ONRAMPKEEPLEFT(23), - /** - * Keep to the right side of the road when entering a turnpike or freeway as the road diverges. - */ + /** Keep to the right side of the road when entering a turnpike or freeway as the road diverges. */ ONRAMPKEEPRIGHT(24), /** Regular left turn to enter a turnpike or freeway. */ ONRAMPLEFT(25), @@ -384,15 +397,9 @@ enum class ManeuverDto(val raw: Int) { ROUNDABOUTSTRAIGHTCLOCKWISE(50), /** Enter a roundabout in the counterclockwise direction and continue straight. */ ROUNDABOUTSTRAIGHTCOUNTERCLOCKWISE(51), - /** - * Enter a roundabout in the clockwise direction and turn clockwise onto the opposite side of the - * street. - */ + /** Enter a roundabout in the clockwise direction and turn clockwise onto the opposite side of the street. */ ROUNDABOUTUTURNCLOCKWISE(52), - /** - * Enter a roundabout in the counterclockwise direction and turn counterclockwise onto the - * opposite side of the street. - */ + /** Enter a roundabout in the counterclockwise direction and turn counterclockwise onto the opposite side of the street. */ ROUNDABOUTUTURNCOUNTERCLOCKWISE(53), /** Continue straight. */ STRAIGHT(54), @@ -495,7 +502,7 @@ enum class LaneShapeDto(val raw: Int) { * * Generated class from Pigeon that represents data sent in messages. */ -data class MapOptionsDto( +data class MapOptionsDto ( /** The initial positioning of the camera in the map view. */ val cameraPosition: CameraPositionDto, /** The type of map to display (e.g., satellite, terrain, hybrid, etc.). */ @@ -525,6 +532,7 @@ data class MapOptionsDto( * the camera target does not move outside these bounds. */ val cameraTargetBounds: LatLngBoundsDto? = null + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -541,26 +549,12 @@ data class MapOptionsDto( val minZoomPreference = list[9] as Double? val maxZoomPreference = list[10] as Double? val zoomControlsEnabled = list[11] as Boolean - val cameraTargetBounds: LatLngBoundsDto? = - (list[12] as List?)?.let { LatLngBoundsDto.fromList(it) } - return MapOptionsDto( - cameraPosition, - mapType, - compassEnabled, - rotateGesturesEnabled, - scrollGesturesEnabled, - tiltGesturesEnabled, - zoomGesturesEnabled, - scrollGesturesEnabledDuringRotateOrZoom, - mapToolbarEnabled, - minZoomPreference, - maxZoomPreference, - zoomControlsEnabled, - cameraTargetBounds - ) + val cameraTargetBounds: LatLngBoundsDto? = (list[12] as List?)?.let { + LatLngBoundsDto.fromList(it) + } + return MapOptionsDto(cameraPosition, mapType, compassEnabled, rotateGesturesEnabled, scrollGesturesEnabled, tiltGesturesEnabled, zoomGesturesEnabled, scrollGesturesEnabledDuringRotateOrZoom, mapToolbarEnabled, minZoomPreference, maxZoomPreference, zoomControlsEnabled, cameraTargetBounds) } } - fun toList(): List { return listOf( cameraPosition.toList(), @@ -585,9 +579,10 @@ data class MapOptionsDto( * * Generated class from Pigeon that represents data sent in messages. */ -data class NavigationViewOptionsDto( +data class NavigationViewOptionsDto ( /** Determines the initial visibility of the navigation UI on map initialization. */ val navigationUIEnabledPreference: NavigationUIEnabledPreferenceDto + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -596,7 +591,6 @@ data class NavigationViewOptionsDto( return NavigationViewOptionsDto(navigationUIEnabledPreference) } } - fun toList(): List { return listOf( navigationUIEnabledPreference.raw, @@ -607,37 +601,44 @@ data class NavigationViewOptionsDto( /** * A message for creating a new navigation view. * - * This message is used to initialize a new navigation view with a specified initial parameters. + * This message is used to initialize a new navigation view with a + * specified initial parameters. * * Generated class from Pigeon that represents data sent in messages. */ -data class NavigationViewCreationOptionsDto( +data class ViewCreationOptionsDto ( + val mapViewType: MapViewTypeDto, val mapOptions: MapOptionsDto, - val navigationViewOptions: NavigationViewOptionsDto + val navigationViewOptions: NavigationViewOptionsDto? = null + ) { companion object { @Suppress("UNCHECKED_CAST") - fun fromList(list: List): NavigationViewCreationOptionsDto { - val mapOptions = MapOptionsDto.fromList(list[0] as List) - val navigationViewOptions = NavigationViewOptionsDto.fromList(list[1] as List) - return NavigationViewCreationOptionsDto(mapOptions, navigationViewOptions) + fun fromList(list: List): ViewCreationOptionsDto { + val mapViewType = MapViewTypeDto.ofRaw(list[0] as Int)!! + val mapOptions = MapOptionsDto.fromList(list[1] as List) + val navigationViewOptions: NavigationViewOptionsDto? = (list[2] as List?)?.let { + NavigationViewOptionsDto.fromList(it) + } + return ViewCreationOptionsDto(mapViewType, mapOptions, navigationViewOptions) } } - fun toList(): List { return listOf( + mapViewType.raw, mapOptions.toList(), - navigationViewOptions.toList(), + navigationViewOptions?.toList(), ) } } /** Generated class from Pigeon that represents data sent in messages. */ -data class CameraPositionDto( +data class CameraPositionDto ( val bearing: Double, val target: LatLngDto, val tilt: Double, val zoom: Double + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -649,7 +650,6 @@ data class CameraPositionDto( return CameraPositionDto(bearing, target, tilt, zoom) } } - fun toList(): List { return listOf( bearing, @@ -661,11 +661,12 @@ data class CameraPositionDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class MarkerDto( +data class MarkerDto ( /** Identifies marker */ val markerId: String, /** Options for marker */ val options: MarkerOptionsDto + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -675,7 +676,6 @@ data class MarkerDto( return MarkerDto(markerId, options) } } - fun toList(): List { return listOf( markerId, @@ -685,7 +685,7 @@ data class MarkerDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class MarkerOptionsDto( +data class MarkerOptionsDto ( val alpha: Double, val anchor: MarkerAnchorDto, val draggable: Boolean, @@ -697,6 +697,7 @@ data class MarkerOptionsDto( val visible: Boolean, val zIndex: Double, val icon: ImageDescriptorDto + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -712,22 +713,9 @@ data class MarkerOptionsDto( val visible = list[8] as Boolean val zIndex = list[9] as Double val icon = ImageDescriptorDto.fromList(list[10] as List) - return MarkerOptionsDto( - alpha, - anchor, - draggable, - flat, - consumeTapEvents, - position, - rotation, - infoWindow, - visible, - zIndex, - icon - ) + return MarkerOptionsDto(alpha, anchor, draggable, flat, consumeTapEvents, position, rotation, infoWindow, visible, zIndex, icon) } } - fun toList(): List { return listOf( alpha, @@ -746,11 +734,12 @@ data class MarkerOptionsDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class ImageDescriptorDto( +data class ImageDescriptorDto ( val registeredImageId: String? = null, val imagePixelRatio: Double? = null, val width: Double? = null, val height: Double? = null + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -762,7 +751,6 @@ data class ImageDescriptorDto( return ImageDescriptorDto(registeredImageId, imagePixelRatio, width, height) } } - fun toList(): List { return listOf( registeredImageId, @@ -774,10 +762,11 @@ data class ImageDescriptorDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class InfoWindowDto( +data class InfoWindowDto ( val title: String? = null, val snippet: String? = null, val anchor: MarkerAnchorDto + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -788,7 +777,6 @@ data class InfoWindowDto( return InfoWindowDto(title, snippet, anchor) } } - fun toList(): List { return listOf( title, @@ -799,8 +787,11 @@ data class InfoWindowDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class MarkerAnchorDto(val u: Double, val v: Double) { +data class MarkerAnchorDto ( + val u: Double, + val v: Double +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): MarkerAnchorDto { @@ -809,7 +800,6 @@ data class MarkerAnchorDto(val u: Double, val v: Double) { return MarkerAnchorDto(u, v) } } - fun toList(): List { return listOf( u, @@ -819,8 +809,11 @@ data class MarkerAnchorDto(val u: Double, val v: Double) { } /** Generated class from Pigeon that represents data sent in messages. */ -data class PolygonDto(val polygonId: String, val options: PolygonOptionsDto) { +data class PolygonDto ( + val polygonId: String, + val options: PolygonOptionsDto +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): PolygonDto { @@ -829,7 +822,6 @@ data class PolygonDto(val polygonId: String, val options: PolygonOptionsDto) { return PolygonDto(polygonId, options) } } - fun toList(): List { return listOf( polygonId, @@ -839,7 +831,7 @@ data class PolygonDto(val polygonId: String, val options: PolygonOptionsDto) { } /** Generated class from Pigeon that represents data sent in messages. */ -data class PolygonOptionsDto( +data class PolygonOptionsDto ( val points: List, val holes: List, val clickable: Boolean, @@ -849,6 +841,7 @@ data class PolygonOptionsDto( val strokeWidth: Double, val visible: Boolean, val zIndex: Double + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -862,20 +855,9 @@ data class PolygonOptionsDto( val strokeWidth = list[6] as Double val visible = list[7] as Boolean val zIndex = list[8] as Double - return PolygonOptionsDto( - points, - holes, - clickable, - fillColor, - geodesic, - strokeColor, - strokeWidth, - visible, - zIndex - ) + return PolygonOptionsDto(points, holes, clickable, fillColor, geodesic, strokeColor, strokeWidth, visible, zIndex) } } - fun toList(): List { return listOf( points, @@ -892,8 +874,10 @@ data class PolygonOptionsDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class PolygonHoleDto(val points: List) { +data class PolygonHoleDto ( + val points: List +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): PolygonHoleDto { @@ -901,7 +885,6 @@ data class PolygonHoleDto(val points: List) { return PolygonHoleDto(points) } } - fun toList(): List { return listOf( points, @@ -910,10 +893,11 @@ data class PolygonHoleDto(val points: List) { } /** Generated class from Pigeon that represents data sent in messages. */ -data class StyleSpanStrokeStyleDto( +data class StyleSpanStrokeStyleDto ( val solidColor: Long? = null, val fromColor: Long? = null, val toColor: Long? = null + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -924,7 +908,6 @@ data class StyleSpanStrokeStyleDto( return StyleSpanStrokeStyleDto(solidColor, fromColor, toColor) } } - fun toList(): List { return listOf( solidColor, @@ -935,8 +918,11 @@ data class StyleSpanStrokeStyleDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class StyleSpanDto(val length: Double, val style: StyleSpanStrokeStyleDto) { +data class StyleSpanDto ( + val length: Double, + val style: StyleSpanStrokeStyleDto +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): StyleSpanDto { @@ -945,7 +931,6 @@ data class StyleSpanDto(val length: Double, val style: StyleSpanStrokeStyleDto) return StyleSpanDto(length, style) } } - fun toList(): List { return listOf( length, @@ -955,8 +940,11 @@ data class StyleSpanDto(val length: Double, val style: StyleSpanStrokeStyleDto) } /** Generated class from Pigeon that represents data sent in messages. */ -data class PolylineDto(val polylineId: String, val options: PolylineOptionsDto) { +data class PolylineDto ( + val polylineId: String, + val options: PolylineOptionsDto +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): PolylineDto { @@ -965,7 +953,6 @@ data class PolylineDto(val polylineId: String, val options: PolylineOptionsDto) return PolylineDto(polylineId, options) } } - fun toList(): List { return listOf( polylineId, @@ -975,8 +962,11 @@ data class PolylineDto(val polylineId: String, val options: PolylineOptionsDto) } /** Generated class from Pigeon that represents data sent in messages. */ -data class PatternItemDto(val type: PatternTypeDto, val length: Double? = null) { +data class PatternItemDto ( + val type: PatternTypeDto, + val length: Double? = null +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): PatternItemDto { @@ -985,7 +975,6 @@ data class PatternItemDto(val type: PatternTypeDto, val length: Double? = null) return PatternItemDto(type, length) } } - fun toList(): List { return listOf( type.raw, @@ -995,7 +984,7 @@ data class PatternItemDto(val type: PatternTypeDto, val length: Double? = null) } /** Generated class from Pigeon that represents data sent in messages. */ -data class PolylineOptionsDto( +data class PolylineOptionsDto ( val points: List? = null, val clickable: Boolean? = null, val geodesic: Boolean? = null, @@ -1006,6 +995,7 @@ data class PolylineOptionsDto( val visible: Boolean? = null, val zIndex: Double? = null, val spans: List + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1014,28 +1004,17 @@ data class PolylineOptionsDto( val clickable = list[1] as Boolean? val geodesic = list[2] as Boolean? val strokeColor = list[3].let { if (it is Int) it.toLong() else it as Long? } - val strokeJointType: StrokeJointTypeDto? = - (list[4] as Int?)?.let { StrokeJointTypeDto.ofRaw(it) } + val strokeJointType: StrokeJointTypeDto? = (list[4] as Int?)?.let { + StrokeJointTypeDto.ofRaw(it) + } val strokePattern = list[5] as List? val strokeWidth = list[6] as Double? val visible = list[7] as Boolean? val zIndex = list[8] as Double? val spans = list[9] as List - return PolylineOptionsDto( - points, - clickable, - geodesic, - strokeColor, - strokeJointType, - strokePattern, - strokeWidth, - visible, - zIndex, - spans - ) + return PolylineOptionsDto(points, clickable, geodesic, strokeColor, strokeJointType, strokePattern, strokeWidth, visible, zIndex, spans) } } - fun toList(): List { return listOf( points, @@ -1053,11 +1032,12 @@ data class PolylineOptionsDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class CircleDto( +data class CircleDto ( /** Identifies circle. */ val circleId: String, /** Options for circle. */ val options: CircleOptionsDto + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1067,7 +1047,6 @@ data class CircleDto( return CircleDto(circleId, options) } } - fun toList(): List { return listOf( circleId, @@ -1077,7 +1056,7 @@ data class CircleDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class CircleOptionsDto( +data class CircleOptionsDto ( val position: LatLngDto, val radius: Double, val strokeWidth: Double, @@ -1087,6 +1066,7 @@ data class CircleOptionsDto( val zIndex: Double, val visible: Boolean, val clickable: Boolean + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1100,20 +1080,9 @@ data class CircleOptionsDto( val zIndex = list[6] as Double val visible = list[7] as Boolean val clickable = list[8] as Boolean - return CircleOptionsDto( - position, - radius, - strokeWidth, - strokeColor, - strokePattern, - fillColor, - zIndex, - visible, - clickable - ) + return CircleOptionsDto(position, radius, strokeWidth, strokeColor, strokePattern, fillColor, zIndex, visible, clickable) } } - fun toList(): List { return listOf( position.toList(), @@ -1130,17 +1099,21 @@ data class CircleOptionsDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class RouteTokenOptionsDto(val routeToken: String, val travelMode: TravelModeDto? = null) { +data class RouteTokenOptionsDto ( + val routeToken: String, + val travelMode: TravelModeDto? = null +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): RouteTokenOptionsDto { val routeToken = list[0] as String - val travelMode: TravelModeDto? = (list[1] as Int?)?.let { TravelModeDto.ofRaw(it) } + val travelMode: TravelModeDto? = (list[1] as Int?)?.let { + TravelModeDto.ofRaw(it) + } return RouteTokenOptionsDto(routeToken, travelMode) } } - fun toList(): List { return listOf( routeToken, @@ -1150,25 +1123,27 @@ data class RouteTokenOptionsDto(val routeToken: String, val travelMode: TravelMo } /** Generated class from Pigeon that represents data sent in messages. */ -data class DestinationsDto( +data class DestinationsDto ( val waypoints: List, val displayOptions: NavigationDisplayOptionsDto, val routingOptions: RoutingOptionsDto? = null, val routeTokenOptions: RouteTokenOptionsDto? = null + ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): DestinationsDto { val waypoints = list[0] as List val displayOptions = NavigationDisplayOptionsDto.fromList(list[1] as List) - val routingOptions: RoutingOptionsDto? = - (list[2] as List?)?.let { RoutingOptionsDto.fromList(it) } - val routeTokenOptions: RouteTokenOptionsDto? = - (list[3] as List?)?.let { RouteTokenOptionsDto.fromList(it) } + val routingOptions: RoutingOptionsDto? = (list[2] as List?)?.let { + RoutingOptionsDto.fromList(it) + } + val routeTokenOptions: RouteTokenOptionsDto? = (list[3] as List?)?.let { + RouteTokenOptionsDto.fromList(it) + } return DestinationsDto(waypoints, displayOptions, routingOptions, routeTokenOptions) } } - fun toList(): List { return listOf( waypoints, @@ -1180,7 +1155,7 @@ data class DestinationsDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class RoutingOptionsDto( +data class RoutingOptionsDto ( val alternateRoutesStrategy: AlternateRoutesStrategyDto? = null, val routingStrategy: RoutingStrategyDto? = null, val targetDistanceMeters: List? = null, @@ -1189,33 +1164,28 @@ data class RoutingOptionsDto( val avoidFerries: Boolean? = null, val avoidHighways: Boolean? = null, val locationTimeoutMs: Long? = null + ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): RoutingOptionsDto { - val alternateRoutesStrategy: AlternateRoutesStrategyDto? = - (list[0] as Int?)?.let { AlternateRoutesStrategyDto.ofRaw(it) } - val routingStrategy: RoutingStrategyDto? = - (list[1] as Int?)?.let { RoutingStrategyDto.ofRaw(it) } + val alternateRoutesStrategy: AlternateRoutesStrategyDto? = (list[0] as Int?)?.let { + AlternateRoutesStrategyDto.ofRaw(it) + } + val routingStrategy: RoutingStrategyDto? = (list[1] as Int?)?.let { + RoutingStrategyDto.ofRaw(it) + } val targetDistanceMeters = list[2] as List? - val travelMode: TravelModeDto? = (list[3] as Int?)?.let { TravelModeDto.ofRaw(it) } + val travelMode: TravelModeDto? = (list[3] as Int?)?.let { + TravelModeDto.ofRaw(it) + } val avoidTolls = list[4] as Boolean? val avoidFerries = list[5] as Boolean? val avoidHighways = list[6] as Boolean? val locationTimeoutMs = list[7].let { if (it is Int) it.toLong() else it as Long? } - return RoutingOptionsDto( - alternateRoutesStrategy, - routingStrategy, - targetDistanceMeters, - travelMode, - avoidTolls, - avoidFerries, - avoidHighways, - locationTimeoutMs - ) + return RoutingOptionsDto(alternateRoutesStrategy, routingStrategy, targetDistanceMeters, travelMode, avoidTolls, avoidFerries, avoidHighways, locationTimeoutMs) } } - fun toList(): List { return listOf( alternateRoutesStrategy?.raw, @@ -1231,10 +1201,11 @@ data class RoutingOptionsDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class NavigationDisplayOptionsDto( +data class NavigationDisplayOptionsDto ( val showDestinationMarkers: Boolean? = null, val showStopSigns: Boolean? = null, val showTrafficLights: Boolean? = null + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1245,7 +1216,6 @@ data class NavigationDisplayOptionsDto( return NavigationDisplayOptionsDto(showDestinationMarkers, showStopSigns, showTrafficLights) } } - fun toList(): List { return listOf( showDestinationMarkers, @@ -1256,31 +1226,27 @@ data class NavigationDisplayOptionsDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class NavigationWaypointDto( +data class NavigationWaypointDto ( val title: String, val target: LatLngDto? = null, val placeID: String? = null, val preferSameSideOfRoad: Boolean? = null, val preferredSegmentHeading: Long? = null + ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): NavigationWaypointDto { val title = list[0] as String - val target: LatLngDto? = (list[1] as List?)?.let { LatLngDto.fromList(it) } + val target: LatLngDto? = (list[1] as List?)?.let { + LatLngDto.fromList(it) + } val placeID = list[2] as String? val preferSameSideOfRoad = list[3] as Boolean? val preferredSegmentHeading = list[4].let { if (it is Int) it.toLong() else it as Long? } - return NavigationWaypointDto( - title, - target, - placeID, - preferSameSideOfRoad, - preferredSegmentHeading - ) + return NavigationWaypointDto(title, target, placeID, preferSameSideOfRoad, preferredSegmentHeading) } } - fun toList(): List { return listOf( title, @@ -1293,8 +1259,11 @@ data class NavigationWaypointDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class NavigationTimeAndDistanceDto(val time: Double, val distance: Double) { +data class NavigationTimeAndDistanceDto ( + val time: Double, + val distance: Double +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): NavigationTimeAndDistanceDto { @@ -1303,7 +1272,6 @@ data class NavigationTimeAndDistanceDto(val time: Double, val distance: Double) return NavigationTimeAndDistanceDto(time, distance) } } - fun toList(): List { return listOf( time, @@ -1313,26 +1281,23 @@ data class NavigationTimeAndDistanceDto(val time: Double, val distance: Double) } /** Generated class from Pigeon that represents data sent in messages. */ -data class NavigationAudioGuidanceSettingsDto( +data class NavigationAudioGuidanceSettingsDto ( val isBluetoothAudioEnabled: Boolean? = null, val isVibrationEnabled: Boolean? = null, val guidanceType: AudioGuidanceTypeDto? = null + ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): NavigationAudioGuidanceSettingsDto { val isBluetoothAudioEnabled = list[0] as Boolean? val isVibrationEnabled = list[1] as Boolean? - val guidanceType: AudioGuidanceTypeDto? = - (list[2] as Int?)?.let { AudioGuidanceTypeDto.ofRaw(it) } - return NavigationAudioGuidanceSettingsDto( - isBluetoothAudioEnabled, - isVibrationEnabled, - guidanceType - ) + val guidanceType: AudioGuidanceTypeDto? = (list[2] as Int?)?.let { + AudioGuidanceTypeDto.ofRaw(it) + } + return NavigationAudioGuidanceSettingsDto(isBluetoothAudioEnabled, isVibrationEnabled, guidanceType) } } - fun toList(): List { return listOf( isBluetoothAudioEnabled, @@ -1343,8 +1308,10 @@ data class NavigationAudioGuidanceSettingsDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class SimulationOptionsDto(val speedMultiplier: Double) { +data class SimulationOptionsDto ( + val speedMultiplier: Double +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): SimulationOptionsDto { @@ -1352,7 +1319,6 @@ data class SimulationOptionsDto(val speedMultiplier: Double) { return SimulationOptionsDto(speedMultiplier) } } - fun toList(): List { return listOf( speedMultiplier, @@ -1361,8 +1327,11 @@ data class SimulationOptionsDto(val speedMultiplier: Double) { } /** Generated class from Pigeon that represents data sent in messages. */ -data class LatLngDto(val latitude: Double, val longitude: Double) { +data class LatLngDto ( + val latitude: Double, + val longitude: Double +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): LatLngDto { @@ -1371,7 +1340,6 @@ data class LatLngDto(val latitude: Double, val longitude: Double) { return LatLngDto(latitude, longitude) } } - fun toList(): List { return listOf( latitude, @@ -1381,8 +1349,11 @@ data class LatLngDto(val latitude: Double, val longitude: Double) { } /** Generated class from Pigeon that represents data sent in messages. */ -data class LatLngBoundsDto(val southwest: LatLngDto, val northeast: LatLngDto) { +data class LatLngBoundsDto ( + val southwest: LatLngDto, + val northeast: LatLngDto +) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): LatLngBoundsDto { @@ -1391,7 +1362,6 @@ data class LatLngBoundsDto(val southwest: LatLngDto, val northeast: LatLngDto) { return LatLngBoundsDto(southwest, northeast) } } - fun toList(): List { return listOf( southwest.toList(), @@ -1401,9 +1371,10 @@ data class LatLngBoundsDto(val southwest: LatLngDto, val northeast: LatLngDto) { } /** Generated class from Pigeon that represents data sent in messages. */ -data class SpeedingUpdatedEventDto( +data class SpeedingUpdatedEventDto ( val percentageAboveLimit: Double, val severity: SpeedAlertSeverityDto + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1413,7 +1384,6 @@ data class SpeedingUpdatedEventDto( return SpeedingUpdatedEventDto(percentageAboveLimit, severity) } } - fun toList(): List { return listOf( percentageAboveLimit, @@ -1423,10 +1393,11 @@ data class SpeedingUpdatedEventDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class SpeedAlertOptionsDto( +data class SpeedAlertOptionsDto ( val severityUpgradeDurationSeconds: Double, val minorSpeedAlertThresholdPercentage: Double, val majorSpeedAlertThresholdPercentage: Double + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1434,14 +1405,9 @@ data class SpeedAlertOptionsDto( val severityUpgradeDurationSeconds = list[0] as Double val minorSpeedAlertThresholdPercentage = list[1] as Double val majorSpeedAlertThresholdPercentage = list[2] as Double - return SpeedAlertOptionsDto( - severityUpgradeDurationSeconds, - minorSpeedAlertThresholdPercentage, - majorSpeedAlertThresholdPercentage - ) + return SpeedAlertOptionsDto(severityUpgradeDurationSeconds, minorSpeedAlertThresholdPercentage, majorSpeedAlertThresholdPercentage) } } - fun toList(): List { return listOf( severityUpgradeDurationSeconds, @@ -1452,10 +1418,11 @@ data class SpeedAlertOptionsDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class RouteSegmentTrafficDataRoadStretchRenderingDataDto( +data class RouteSegmentTrafficDataRoadStretchRenderingDataDto ( val style: RouteSegmentTrafficDataRoadStretchRenderingDataStyleDto, val lengthMeters: Long, val offsetMeters: Long + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1466,7 +1433,6 @@ data class RouteSegmentTrafficDataRoadStretchRenderingDataDto( return RouteSegmentTrafficDataRoadStretchRenderingDataDto(style, lengthMeters, offsetMeters) } } - fun toList(): List { return listOf( style.raw, @@ -1477,20 +1443,19 @@ data class RouteSegmentTrafficDataRoadStretchRenderingDataDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class RouteSegmentTrafficDataDto( +data class RouteSegmentTrafficDataDto ( val status: RouteSegmentTrafficDataStatusDto, val roadStretchRenderingDataList: List + ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): RouteSegmentTrafficDataDto { val status = RouteSegmentTrafficDataStatusDto.ofRaw(list[0] as Int)!! - val roadStretchRenderingDataList = - list[1] as List + val roadStretchRenderingDataList = list[1] as List return RouteSegmentTrafficDataDto(status, roadStretchRenderingDataList) } } - fun toList(): List { return listOf( status.raw, @@ -1500,25 +1465,27 @@ data class RouteSegmentTrafficDataDto( } /** Generated class from Pigeon that represents data sent in messages. */ -data class RouteSegmentDto( +data class RouteSegmentDto ( val trafficData: RouteSegmentTrafficDataDto? = null, val destinationLatLng: LatLngDto, val latLngs: List? = null, val destinationWaypoint: NavigationWaypointDto? = null + ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): RouteSegmentDto { - val trafficData: RouteSegmentTrafficDataDto? = - (list[0] as List?)?.let { RouteSegmentTrafficDataDto.fromList(it) } + val trafficData: RouteSegmentTrafficDataDto? = (list[0] as List?)?.let { + RouteSegmentTrafficDataDto.fromList(it) + } val destinationLatLng = LatLngDto.fromList(list[1] as List) val latLngs = list[2] as List? - val destinationWaypoint: NavigationWaypointDto? = - (list[3] as List?)?.let { NavigationWaypointDto.fromList(it) } + val destinationWaypoint: NavigationWaypointDto? = (list[3] as List?)?.let { + NavigationWaypointDto.fromList(it) + } return RouteSegmentDto(trafficData, destinationLatLng, latLngs, destinationWaypoint) } } - fun toList(): List { return listOf( trafficData?.toList(), @@ -1530,16 +1497,16 @@ data class RouteSegmentDto( } /** - * One of the possible directions from a lane at the end of a route step, and whether it is on the - * recommended route. + * One of the possible directions from a lane at the end of a route step, and whether it is on the recommended route. * * Generated class from Pigeon that represents data sent in messages. */ -data class LaneDirectionDto( +data class LaneDirectionDto ( /** Shape for this lane direction. */ val laneShape: LaneShapeDto, /** Whether this lane is recommended. */ val isRecommended: Boolean + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1549,7 +1516,6 @@ data class LaneDirectionDto( return LaneDirectionDto(laneShape, isRecommended) } } - fun toList(): List { return listOf( laneShape.raw, @@ -1563,12 +1529,10 @@ data class LaneDirectionDto( * * Generated class from Pigeon that represents data sent in messages. */ -data class LaneDto( - /** - * List of possible directions a driver can follow when using this lane at the end of the - * respective route step - */ +data class LaneDto ( + /** List of possible directions a driver can follow when using this lane at the end of the respective route step */ val laneDirections: List + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1577,7 +1541,6 @@ data class LaneDto( return LaneDto(laneDirections) } } - fun toList(): List { return listOf( laneDirections, @@ -1590,7 +1553,7 @@ data class LaneDto( * * Generated class from Pigeon that represents data sent in messages. */ -data class StepInfoDto( +data class StepInfoDto ( /** Distance in meters from the previous step to this step. */ val distanceFromPrevStepMeters: Long, /** Time in seconds from the previous step to this step. */ @@ -1606,8 +1569,8 @@ data class StepInfoDto( /** The simplified version of the road name. */ val simpleRoadName: String, /** - * The counted number of the exit to take relative to the location where the roundabout was - * entered. + * The counted number of the exit to take relative to the location where the + * roundabout was entered. */ val roundaboutTurnNumber: Long, /** The list of available lanes at the end of this route step. */ @@ -1616,6 +1579,7 @@ data class StepInfoDto( val maneuver: ManeuverDto, /** The index of the step in the list of all steps in the route. */ val stepNumber: Long + ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1631,22 +1595,9 @@ data class StepInfoDto( val lanes = list[8] as List val maneuver = ManeuverDto.ofRaw(list[9] as Int)!! val stepNumber = list[10].let { if (it is Int) it.toLong() else it as Long } - return StepInfoDto( - distanceFromPrevStepMeters, - timeFromPrevStepSeconds, - drivingSide, - exitNumber, - fullInstructions, - fullRoadName, - simpleRoadName, - roundaboutTurnNumber, - lanes, - maneuver, - stepNumber - ) + return StepInfoDto(distanceFromPrevStepMeters, timeFromPrevStepSeconds, drivingSide, exitNumber, fullInstructions, fullRoadName, simpleRoadName, roundaboutTurnNumber, lanes, maneuver, stepNumber) } } - fun toList(): List { return listOf( distanceFromPrevStepMeters, @@ -1665,12 +1616,12 @@ data class StepInfoDto( } /** - * Contains information about the state of navigation, the current nav step if available, and - * remaining steps if available. + * Contains information about the state of navigation, the current nav step if + * available, and remaining steps if available. * * Generated class from Pigeon that represents data sent in messages. */ -data class NavInfoDto( +data class NavInfoDto ( /** The current state of navigation. */ val navState: NavStateDto, /** Information about the upcoming maneuver step. */ @@ -1679,11 +1630,14 @@ data class NavInfoDto( val remainingSteps: List, /** Whether the route has changed since the last sent message. */ val routeChanged: Boolean, - /** Estimated remaining distance in meters along the route to the current step. */ + /** + * Estimated remaining distance in meters along the route to the + * current step. + */ val distanceToCurrentStepMeters: Long? = null, /** - * The estimated remaining distance in meters to the final destination which is the last - * destination in a multi-destination trip. + * The estimated remaining distance in meters to the final destination which + * is the last destination in a multi-destination trip. */ val distanceToFinalDestinationMeters: Long? = null, /** @@ -1692,11 +1646,14 @@ data class NavInfoDto( * Android only. */ val distanceToNextDestinationMeters: Long? = null, - /** The estimated remaining time in seconds along the route to the current step. */ + /** + * The estimated remaining time in seconds along the route to the + * current step. + */ val timeToCurrentStepSeconds: Long? = null, /** - * The estimated remaining time in seconds to the final destination which is the last destination - * in a multi-destination trip. + * The estimated remaining time in seconds to the final destination which is + * the last destination in a multi-destination trip. */ val timeToFinalDestinationSeconds: Long? = null, /** @@ -1705,38 +1662,26 @@ data class NavInfoDto( * Android only. */ val timeToNextDestinationSeconds: Long? = null + ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): NavInfoDto { val navState = NavStateDto.ofRaw(list[0] as Int)!! - val currentStep: StepInfoDto? = (list[1] as List?)?.let { StepInfoDto.fromList(it) } + val currentStep: StepInfoDto? = (list[1] as List?)?.let { + StepInfoDto.fromList(it) + } val remainingSteps = list[2] as List val routeChanged = list[3] as Boolean val distanceToCurrentStepMeters = list[4].let { if (it is Int) it.toLong() else it as Long? } - val distanceToFinalDestinationMeters = - list[5].let { if (it is Int) it.toLong() else it as Long? } - val distanceToNextDestinationMeters = - list[6].let { if (it is Int) it.toLong() else it as Long? } + val distanceToFinalDestinationMeters = list[5].let { if (it is Int) it.toLong() else it as Long? } + val distanceToNextDestinationMeters = list[6].let { if (it is Int) it.toLong() else it as Long? } val timeToCurrentStepSeconds = list[7].let { if (it is Int) it.toLong() else it as Long? } - val timeToFinalDestinationSeconds = - list[8].let { if (it is Int) it.toLong() else it as Long? } + val timeToFinalDestinationSeconds = list[8].let { if (it is Int) it.toLong() else it as Long? } val timeToNextDestinationSeconds = list[9].let { if (it is Int) it.toLong() else it as Long? } - return NavInfoDto( - navState, - currentStep, - remainingSteps, - routeChanged, - distanceToCurrentStepMeters, - distanceToFinalDestinationMeters, - distanceToNextDestinationMeters, - timeToCurrentStepSeconds, - timeToFinalDestinationSeconds, - timeToNextDestinationSeconds - ) + return NavInfoDto(navState, currentStep, remainingSteps, routeChanged, distanceToCurrentStepMeters, distanceToFinalDestinationMeters, distanceToNextDestinationMeters, timeToCurrentStepSeconds, timeToFinalDestinationSeconds, timeToNextDestinationSeconds) } } - fun toList(): List { return listOf( navState.raw, @@ -1758,30 +1703,39 @@ private object _NavigationViewCreationApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { CameraPositionDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + CameraPositionDto.fromList(it) + } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { LatLngBoundsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LatLngBoundsDto.fromList(it) + } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LatLngDto.fromList(it) + } } 131.toByte() -> { - return (readValue(buffer) as? List)?.let { MapOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + MapOptionsDto.fromList(it) + } } 132.toByte() -> { return (readValue(buffer) as? List)?.let { - NavigationViewCreationOptionsDto.fromList(it) + NavigationViewOptionsDto.fromList(it) } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { NavigationViewOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + ViewCreationOptionsDto.fromList(it) + } } else -> super.readValueOfType(type, buffer) } } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is CameraPositionDto -> { stream.write(128) @@ -1799,11 +1753,11 @@ private object _NavigationViewCreationApiCodec : StandardMessageCodec() { stream.write(131) writeValue(stream, value.toList()) } - is NavigationViewCreationOptionsDto -> { + is NavigationViewOptionsDto -> { stream.write(132) writeValue(stream, value.toList()) } - is NavigationViewOptionsDto -> { + is ViewCreationOptionsDto -> { stream.write(133) writeValue(stream, value.toList()) } @@ -1813,35 +1767,29 @@ private object _NavigationViewCreationApiCodec : StandardMessageCodec() { } /** - * Pigeon only generates messages if the messages are used in API. [MapOptionsDto] is encoded and - * decoded directly to generate a PlatformView creation message. This API should never be used - * directly. + * Pigeon only generates messages if the messages are used in API. + * [MapOptionsDto] is encoded and decoded directly to generate + * a PlatformView creation message. This API should never be used directly. * * Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface _NavigationViewCreationApi { - fun _create(msg: NavigationViewCreationOptionsDto) + fun _create(msg: ViewCreationOptionsDto) companion object { /** The codec used by _NavigationViewCreationApi. */ - val codec: MessageCodec by lazy { _NavigationViewCreationApiCodec } - /** - * Sets up an instance of `_NavigationViewCreationApi` to handle messages through the - * `binaryMessenger`. - */ + val codec: MessageCodec by lazy { + _NavigationViewCreationApiCodec + } + /** Sets up an instance of `_NavigationViewCreationApi` to handle messages through the `binaryMessenger`. */ @Suppress("UNCHECKED_CAST") fun setUp(binaryMessenger: BinaryMessenger, api: _NavigationViewCreationApi?) { run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val msgArg = args[0] as NavigationViewCreationOptionsDto + val msgArg = args[0] as ViewCreationOptionsDto var wrapped: List try { api._create(msgArg) @@ -1858,73 +1806,109 @@ interface _NavigationViewCreationApi { } } } - @Suppress("UNCHECKED_CAST") -private object NavigationViewApiCodec : StandardMessageCodec() { +private object MapViewApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { CameraPositionDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + CameraPositionDto.fromList(it) + } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { CircleDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + CircleDto.fromList(it) + } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { CircleOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + CircleOptionsDto.fromList(it) + } } 131.toByte() -> { - return (readValue(buffer) as? List)?.let { ImageDescriptorDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + ImageDescriptorDto.fromList(it) + } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { InfoWindowDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + InfoWindowDto.fromList(it) + } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { LatLngBoundsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LatLngBoundsDto.fromList(it) + } } 134.toByte() -> { - return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LatLngDto.fromList(it) + } } 135.toByte() -> { - return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LatLngDto.fromList(it) + } } 136.toByte() -> { - return (readValue(buffer) as? List)?.let { MarkerAnchorDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + MarkerAnchorDto.fromList(it) + } } 137.toByte() -> { - return (readValue(buffer) as? List)?.let { MarkerDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + MarkerDto.fromList(it) + } } 138.toByte() -> { - return (readValue(buffer) as? List)?.let { MarkerOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + MarkerOptionsDto.fromList(it) + } } 139.toByte() -> { - return (readValue(buffer) as? List)?.let { PatternItemDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + PatternItemDto.fromList(it) + } } 140.toByte() -> { - return (readValue(buffer) as? List)?.let { PolygonDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + PolygonDto.fromList(it) + } } 141.toByte() -> { - return (readValue(buffer) as? List)?.let { PolygonHoleDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + PolygonHoleDto.fromList(it) + } } 142.toByte() -> { - return (readValue(buffer) as? List)?.let { PolygonOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + PolygonOptionsDto.fromList(it) + } } 143.toByte() -> { - return (readValue(buffer) as? List)?.let { PolylineDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + PolylineDto.fromList(it) + } } 144.toByte() -> { - return (readValue(buffer) as? List)?.let { PolylineOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + PolylineOptionsDto.fromList(it) + } } 145.toByte() -> { - return (readValue(buffer) as? List)?.let { StyleSpanDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + StyleSpanDto.fromList(it) + } } 146.toByte() -> { - return (readValue(buffer) as? List)?.let { StyleSpanStrokeStyleDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + StyleSpanStrokeStyleDto.fromList(it) + } } else -> super.readValueOfType(type, buffer) } } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is CameraPositionDto -> { stream.write(128) @@ -2008,242 +1992,108 @@ private object NavigationViewApiCodec : StandardMessageCodec() { } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ -interface NavigationViewApi { +interface MapViewApi { fun awaitMapReady(viewId: Long, callback: (Result) -> Unit) - fun isMyLocationEnabled(viewId: Long): Boolean - fun setMyLocationEnabled(viewId: Long, enabled: Boolean) - fun getMyLocation(viewId: Long): LatLngDto? - fun getMapType(viewId: Long): MapTypeDto - fun setMapType(viewId: Long, mapType: MapTypeDto) - fun setMapStyle(viewId: Long, styleJson: String) - fun isNavigationTripProgressBarEnabled(viewId: Long): Boolean - fun setNavigationTripProgressBarEnabled(viewId: Long, enabled: Boolean) - fun isNavigationHeaderEnabled(viewId: Long): Boolean - fun setNavigationHeaderEnabled(viewId: Long, enabled: Boolean) - fun isNavigationFooterEnabled(viewId: Long): Boolean - fun setNavigationFooterEnabled(viewId: Long, enabled: Boolean) - fun isRecenterButtonEnabled(viewId: Long): Boolean - fun setRecenterButtonEnabled(viewId: Long, enabled: Boolean) - fun isSpeedLimitIconEnabled(viewId: Long): Boolean - fun setSpeedLimitIconEnabled(viewId: Long, enabled: Boolean) - fun isSpeedometerEnabled(viewId: Long): Boolean - fun setSpeedometerEnabled(viewId: Long, enabled: Boolean) - fun isTrafficIncidentCardsEnabled(viewId: Long): Boolean - fun setTrafficIncidentCardsEnabled(viewId: Long, enabled: Boolean) - fun isNavigationUIEnabled(viewId: Long): Boolean - fun setNavigationUIEnabled(viewId: Long, enabled: Boolean) - fun getCameraPosition(viewId: Long): CameraPositionDto - fun getVisibleRegion(viewId: Long): LatLngBoundsDto - fun followMyLocation(viewId: Long, perspective: CameraPerspectiveDto, zoomLevel: Double?) - - fun animateCameraToCameraPosition( - viewId: Long, - cameraPosition: CameraPositionDto, - duration: Long?, - callback: (Result) -> Unit - ) - - fun animateCameraToLatLng( - viewId: Long, - point: LatLngDto, - duration: Long?, - callback: (Result) -> Unit - ) - - fun animateCameraToLatLngBounds( - viewId: Long, - bounds: LatLngBoundsDto, - padding: Double, - duration: Long?, - callback: (Result) -> Unit - ) - - fun animateCameraToLatLngZoom( - viewId: Long, - point: LatLngDto, - zoom: Double, - duration: Long?, - callback: (Result) -> Unit - ) - - fun animateCameraByScroll( - viewId: Long, - scrollByDx: Double, - scrollByDy: Double, - duration: Long?, - callback: (Result) -> Unit - ) - - fun animateCameraByZoom( - viewId: Long, - zoomBy: Double, - focusDx: Double?, - focusDy: Double?, - duration: Long?, - callback: (Result) -> Unit - ) - - fun animateCameraToZoom( - viewId: Long, - zoom: Double, - duration: Long?, - callback: (Result) -> Unit - ) - + fun animateCameraToCameraPosition(viewId: Long, cameraPosition: CameraPositionDto, duration: Long?, callback: (Result) -> Unit) + fun animateCameraToLatLng(viewId: Long, point: LatLngDto, duration: Long?, callback: (Result) -> Unit) + fun animateCameraToLatLngBounds(viewId: Long, bounds: LatLngBoundsDto, padding: Double, duration: Long?, callback: (Result) -> Unit) + fun animateCameraToLatLngZoom(viewId: Long, point: LatLngDto, zoom: Double, duration: Long?, callback: (Result) -> Unit) + fun animateCameraByScroll(viewId: Long, scrollByDx: Double, scrollByDy: Double, duration: Long?, callback: (Result) -> Unit) + fun animateCameraByZoom(viewId: Long, zoomBy: Double, focusDx: Double?, focusDy: Double?, duration: Long?, callback: (Result) -> Unit) + fun animateCameraToZoom(viewId: Long, zoom: Double, duration: Long?, callback: (Result) -> Unit) fun moveCameraToCameraPosition(viewId: Long, cameraPosition: CameraPositionDto) - fun moveCameraToLatLng(viewId: Long, point: LatLngDto) - fun moveCameraToLatLngBounds(viewId: Long, bounds: LatLngBoundsDto, padding: Double) - fun moveCameraToLatLngZoom(viewId: Long, point: LatLngDto, zoom: Double) - fun moveCameraByScroll(viewId: Long, scrollByDx: Double, scrollByDy: Double) - fun moveCameraByZoom(viewId: Long, zoomBy: Double, focusDx: Double?, focusDy: Double?) - fun moveCameraToZoom(viewId: Long, zoom: Double) - fun showRouteOverview(viewId: Long) - fun getMinZoomPreference(viewId: Long): Double - fun getMaxZoomPreference(viewId: Long): Double - fun resetMinMaxZoomPreference(viewId: Long) - fun setMinZoomPreference(viewId: Long, minZoomPreference: Double) - fun setMaxZoomPreference(viewId: Long, maxZoomPreference: Double) - fun setMyLocationButtonEnabled(viewId: Long, enabled: Boolean) - fun setConsumeMyLocationButtonClickEventsEnabled(viewId: Long, enabled: Boolean) - fun setZoomGesturesEnabled(viewId: Long, enabled: Boolean) - fun setZoomControlsEnabled(viewId: Long, enabled: Boolean) - fun setCompassEnabled(viewId: Long, enabled: Boolean) - fun setRotateGesturesEnabled(viewId: Long, enabled: Boolean) - fun setScrollGesturesEnabled(viewId: Long, enabled: Boolean) - fun setScrollGesturesDuringRotateOrZoomEnabled(viewId: Long, enabled: Boolean) - fun setTiltGesturesEnabled(viewId: Long, enabled: Boolean) - fun setMapToolbarEnabled(viewId: Long, enabled: Boolean) - fun setTrafficEnabled(viewId: Long, enabled: Boolean) - fun isMyLocationButtonEnabled(viewId: Long): Boolean - fun isConsumeMyLocationButtonClickEventsEnabled(viewId: Long): Boolean - fun isZoomGesturesEnabled(viewId: Long): Boolean - fun isZoomControlsEnabled(viewId: Long): Boolean - fun isCompassEnabled(viewId: Long): Boolean - fun isRotateGesturesEnabled(viewId: Long): Boolean - fun isScrollGesturesEnabled(viewId: Long): Boolean - fun isScrollGesturesEnabledDuringRotateOrZoom(viewId: Long): Boolean - fun isTiltGesturesEnabled(viewId: Long): Boolean - fun isMapToolbarEnabled(viewId: Long): Boolean - fun isTrafficEnabled(viewId: Long): Boolean - fun getMarkers(viewId: Long): List - fun addMarkers(viewId: Long, markers: List): List - fun updateMarkers(viewId: Long, markers: List): List - fun removeMarkers(viewId: Long, markers: List) - fun clearMarkers(viewId: Long) - fun clear(viewId: Long) - fun getPolygons(viewId: Long): List - fun addPolygons(viewId: Long, polygons: List): List - fun updatePolygons(viewId: Long, polygons: List): List - fun removePolygons(viewId: Long, polygons: List) - fun clearPolygons(viewId: Long) - fun getPolylines(viewId: Long): List - fun addPolylines(viewId: Long, polylines: List): List - fun updatePolylines(viewId: Long, polylines: List): List - fun removePolylines(viewId: Long, polylines: List) - fun clearPolylines(viewId: Long) - fun getCircles(viewId: Long): List - fun addCircles(viewId: Long, circles: List): List - fun updateCircles(viewId: Long, circles: List): List - fun removeCircles(viewId: Long, circles: List) - fun clearCircles(viewId: Long) - fun registerOnCameraChangedListener(viewId: Long) companion object { - /** The codec used by NavigationViewApi. */ - val codec: MessageCodec by lazy { NavigationViewApiCodec } - /** - * Sets up an instance of `NavigationViewApi` to handle messages through the `binaryMessenger`. - */ + /** The codec used by MapViewApi. */ + val codec: MessageCodec by lazy { + MapViewApiCodec + } + /** Sets up an instance of `MapViewApi` to handle messages through the `binaryMessenger`. */ @Suppress("UNCHECKED_CAST") - fun setUp(binaryMessenger: BinaryMessenger, api: NavigationViewApi?) { + fun setUp(binaryMessenger: BinaryMessenger, api: MapViewApi?) { run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.awaitMapReady", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2262,12 +2112,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2285,12 +2130,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2310,12 +2150,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMyLocation", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2333,12 +2168,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMapType", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2356,12 +2186,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapType", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2381,12 +2206,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapStyle", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2406,12 +2226,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationTripProgressBarEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2429,12 +2244,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationTripProgressBarEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2454,12 +2264,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationHeaderEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2477,12 +2282,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationHeaderEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2502,12 +2302,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationFooterEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2525,12 +2320,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationFooterEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2550,12 +2340,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRecenterButtonEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2573,12 +2358,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRecenterButtonEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2598,12 +2378,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedLimitIconEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2621,12 +2396,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedLimitIconEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2646,12 +2416,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedometerEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2669,12 +2434,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedometerEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2694,12 +2454,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficIncidentCardsEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2717,12 +2472,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficIncidentCardsEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2742,12 +2492,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationUIEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2765,12 +2510,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationUIEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2790,12 +2530,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCameraPosition", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2813,12 +2548,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getVisibleRegion", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2836,12 +2566,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.followMyLocation", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2862,20 +2587,14 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToCameraPosition", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val viewIdArg = args[0].let { if (it is Int) it.toLong() else it as Long } val cameraPositionArg = args[1] as CameraPositionDto val durationArg = args[2].let { if (it is Int) it.toLong() else it as Long? } - api.animateCameraToCameraPosition(viewIdArg, cameraPositionArg, durationArg) { - result: Result -> + api.animateCameraToCameraPosition(viewIdArg, cameraPositionArg, durationArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2890,12 +2609,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLng", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2917,12 +2631,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngBounds", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2930,8 +2639,7 @@ interface NavigationViewApi { val boundsArg = args[1] as LatLngBoundsDto val paddingArg = args[2] as Double val durationArg = args[3].let { if (it is Int) it.toLong() else it as Long? } - api.animateCameraToLatLngBounds(viewIdArg, boundsArg, paddingArg, durationArg) { - result: Result -> + api.animateCameraToLatLngBounds(viewIdArg, boundsArg, paddingArg, durationArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2946,12 +2654,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngZoom", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2959,8 +2662,7 @@ interface NavigationViewApi { val pointArg = args[1] as LatLngDto val zoomArg = args[2] as Double val durationArg = args[3].let { if (it is Int) it.toLong() else it as Long? } - api.animateCameraToLatLngZoom(viewIdArg, pointArg, zoomArg, durationArg) { - result: Result -> + api.animateCameraToLatLngZoom(viewIdArg, pointArg, zoomArg, durationArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2975,12 +2677,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByScroll", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2988,8 +2685,7 @@ interface NavigationViewApi { val scrollByDxArg = args[1] as Double val scrollByDyArg = args[2] as Double val durationArg = args[3].let { if (it is Int) it.toLong() else it as Long? } - api.animateCameraByScroll(viewIdArg, scrollByDxArg, scrollByDyArg, durationArg) { - result: Result -> + api.animateCameraByScroll(viewIdArg, scrollByDxArg, scrollByDyArg, durationArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -3004,12 +2700,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByZoom", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3018,8 +2709,7 @@ interface NavigationViewApi { val focusDxArg = args[2] as Double? val focusDyArg = args[3] as Double? val durationArg = args[4].let { if (it is Int) it.toLong() else it as Long? } - api.animateCameraByZoom(viewIdArg, zoomByArg, focusDxArg, focusDyArg, durationArg) { - result: Result -> + api.animateCameraByZoom(viewIdArg, zoomByArg, focusDxArg, focusDyArg, durationArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -3034,12 +2724,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToZoom", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3061,12 +2746,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToCameraPosition", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3086,12 +2766,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLng", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3111,12 +2786,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngBounds", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3137,12 +2807,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngZoom", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3163,12 +2828,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByScroll", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3189,12 +2849,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByZoom", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3216,12 +2871,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToZoom", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3241,12 +2891,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.showRouteOverview", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3265,12 +2910,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMinZoomPreference", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3288,12 +2928,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMaxZoomPreference", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3311,12 +2946,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.resetMinMaxZoomPreference", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3335,12 +2965,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMinZoomPreference", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3360,12 +2985,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMaxZoomPreference", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3385,12 +3005,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationButtonEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3410,12 +3025,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setConsumeMyLocationButtonClickEventsEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3435,12 +3045,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomGesturesEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3460,12 +3065,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomControlsEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3485,12 +3085,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setCompassEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3510,12 +3105,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRotateGesturesEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3535,12 +3125,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3560,12 +3145,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesDuringRotateOrZoomEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3585,12 +3165,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTiltGesturesEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3610,12 +3185,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapToolbarEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3635,12 +3205,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3660,12 +3225,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationButtonEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3683,12 +3243,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isConsumeMyLocationButtonClickEventsEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3706,12 +3261,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomGesturesEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3729,12 +3279,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomControlsEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3752,12 +3297,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isCompassEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3775,12 +3315,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRotateGesturesEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3798,12 +3333,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3821,12 +3351,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabledDuringRotateOrZoom", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3844,12 +3369,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTiltGesturesEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3867,12 +3387,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMapToolbarEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3890,12 +3405,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficEnabled", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3913,12 +3423,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMarkers", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3936,12 +3441,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addMarkers", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3960,12 +3460,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateMarkers", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3984,12 +3479,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeMarkers", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4009,12 +3499,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearMarkers", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4033,12 +3518,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clear", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4057,12 +3537,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolygons", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4080,12 +3555,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolygons", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4104,12 +3574,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolygons", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4128,12 +3593,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolygons", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4153,12 +3613,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolygons", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4177,12 +3632,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolylines", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4200,12 +3650,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolylines", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4224,12 +3669,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolylines", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4248,12 +3688,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolylines", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4273,12 +3708,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolylines", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4297,12 +3727,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCircles", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4320,12 +3745,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addCircles", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4344,12 +3764,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateCircles", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4368,12 +3783,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeCircles", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4393,12 +3803,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearCircles", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4417,12 +3822,7 @@ interface NavigationViewApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.registerOnCameraChangedListener", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4443,22 +3843,24 @@ interface NavigationViewApi { } } } - @Suppress("UNCHECKED_CAST") private object ImageRegistryApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { ImageDescriptorDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + ImageDescriptorDto.fromList(it) + } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { ImageDescriptorDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + ImageDescriptorDto.fromList(it) + } } else -> super.readValueOfType(type, buffer) } } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is ImageDescriptorDto -> { stream.write(128) @@ -4475,35 +3877,21 @@ private object ImageRegistryApiCodec : StandardMessageCodec() { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface ImageRegistryApi { - fun registerBitmapImage( - imageId: String, - bytes: ByteArray, - imagePixelRatio: Double, - width: Double?, - height: Double? - ): ImageDescriptorDto - + fun registerBitmapImage(imageId: String, bytes: ByteArray, imagePixelRatio: Double, width: Double?, height: Double?): ImageDescriptorDto fun unregisterImage(imageDescriptor: ImageDescriptorDto) - fun getRegisteredImages(): List - fun clearRegisteredImages() companion object { /** The codec used by ImageRegistryApi. */ - val codec: MessageCodec by lazy { ImageRegistryApiCodec } - /** - * Sets up an instance of `ImageRegistryApi` to handle messages through the `binaryMessenger`. - */ + val codec: MessageCodec by lazy { + ImageRegistryApiCodec + } + /** Sets up an instance of `ImageRegistryApi` to handle messages through the `binaryMessenger`. */ @Suppress("UNCHECKED_CAST") fun setUp(binaryMessenger: BinaryMessenger, api: ImageRegistryApi?) { run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4514,16 +3902,7 @@ interface ImageRegistryApi { val heightArg = args[4] as Double? var wrapped: List try { - wrapped = - listOf( - api.registerBitmapImage( - imageIdArg, - bytesArg, - imagePixelRatioArg, - widthArg, - heightArg - ) - ) + wrapped = listOf(api.registerBitmapImage(imageIdArg, bytesArg, imagePixelRatioArg, widthArg, heightArg)) } catch (exception: Throwable) { wrapped = wrapError(exception) } @@ -4534,12 +3913,7 @@ interface ImageRegistryApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4558,12 +3932,7 @@ interface ImageRegistryApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4579,12 +3948,7 @@ interface ImageRegistryApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4603,22 +3967,24 @@ interface ImageRegistryApi { } } } - @Suppress("UNCHECKED_CAST") -private object NavigationViewEventApiCodec : StandardMessageCodec() { +private object ViewEventApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { CameraPositionDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + CameraPositionDto.fromList(it) + } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LatLngDto.fromList(it) + } } else -> super.readValueOfType(type, buffer) } } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is CameraPositionDto -> { stream.write(128) @@ -4635,15 +4001,15 @@ private object NavigationViewEventApiCodec : StandardMessageCodec() { /** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ @Suppress("UNCHECKED_CAST") -class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { +class ViewEventApi(private val binaryMessenger: BinaryMessenger) { companion object { - /** The codec used by NavigationViewEventApi. */ - val codec: MessageCodec by lazy { NavigationViewEventApiCodec } + /** The codec used by ViewEventApi. */ + val codec: MessageCodec by lazy { + ViewEventApiCodec + } } - fun onMapClickEvent(viewIdArg: Long, latLngArg: LatLngDto, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapClickEvent" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, latLngArg)) { if (it is List<*>) { @@ -4654,13 +4020,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onMapLongClickEvent(viewIdArg: Long, latLngArg: LatLngDto, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapLongClickEvent" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, latLngArg)) { if (it is List<*>) { @@ -4671,13 +4035,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onRecenterButtonClicked(viewIdArg: Long, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onRecenterButtonClicked" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg)) { if (it is List<*>) { @@ -4688,18 +4050,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - - fun onMarkerEvent( - viewIdArg: Long, - markerIdArg: String, - eventTypeArg: MarkerEventTypeDto, - callback: (Result) -> Unit - ) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerEvent" + fun onMarkerEvent(viewIdArg: Long, markerIdArg: String, eventTypeArg: MarkerEventTypeDto, callback: (Result) -> Unit) { + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, markerIdArg, eventTypeArg.raw)) { if (it is List<*>) { @@ -4710,19 +4065,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - - fun onMarkerDragEvent( - viewIdArg: Long, - markerIdArg: String, - eventTypeArg: MarkerDragEventTypeDto, - positionArg: LatLngDto, - callback: (Result) -> Unit - ) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerDragEvent" + fun onMarkerDragEvent(viewIdArg: Long, markerIdArg: String, eventTypeArg: MarkerDragEventTypeDto, positionArg: LatLngDto, callback: (Result) -> Unit) { + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, markerIdArg, eventTypeArg.raw, positionArg)) { if (it is List<*>) { @@ -4733,13 +4080,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onPolygonClicked(viewIdArg: Long, polygonIdArg: String, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolygonClicked" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, polygonIdArg)) { if (it is List<*>) { @@ -4750,13 +4095,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onPolylineClicked(viewIdArg: Long, polylineIdArg: String, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolylineClicked" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, polylineIdArg)) { if (it is List<*>) { @@ -4767,13 +4110,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onCircleClicked(viewIdArg: Long, circleIdArg: String, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCircleClicked" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, circleIdArg)) { if (it is List<*>) { @@ -4784,17 +4125,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - - fun onNavigationUIEnabledChanged( - viewIdArg: Long, - navigationUIEnabledArg: Boolean, - callback: (Result) -> Unit - ) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onNavigationUIEnabledChanged" + fun onNavigationUIEnabledChanged(viewIdArg: Long, navigationUIEnabledArg: Boolean, callback: (Result) -> Unit) { + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, navigationUIEnabledArg)) { if (it is List<*>) { @@ -4805,13 +4140,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onMyLocationClicked(viewIdArg: Long, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMyLocationClicked" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg)) { if (it is List<*>) { @@ -4822,13 +4155,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onMyLocationButtonClicked(viewIdArg: Long, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMyLocationButtonClicked" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg)) { if (it is List<*>) { @@ -4839,18 +4170,11 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - - fun onCameraChanged( - viewIdArg: Long, - eventTypeArg: CameraEventTypeDto, - positionArg: CameraPositionDto, - callback: (Result) -> Unit - ) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCameraChanged" + fun onCameraChanged(viewIdArg: Long, eventTypeArg: CameraEventTypeDto, positionArg: CameraPositionDto, callback: (Result) -> Unit) { + val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, eventTypeArg.raw, positionArg)) { if (it is List<*>) { @@ -4861,23 +4185,28 @@ class NavigationViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } - @Suppress("UNCHECKED_CAST") private object NavigationSessionApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { DestinationsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + DestinationsDto.fromList(it) + } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LatLngDto.fromList(it) + } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LatLngDto.fromList(it) + } } 131.toByte() -> { return (readValue(buffer) as? List)?.let { @@ -4885,25 +4214,39 @@ private object NavigationSessionApiCodec : StandardMessageCodec() { } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { NavigationDisplayOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + NavigationDisplayOptionsDto.fromList(it) + } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { NavigationTimeAndDistanceDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + NavigationTimeAndDistanceDto.fromList(it) + } } 134.toByte() -> { - return (readValue(buffer) as? List)?.let { NavigationWaypointDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + NavigationWaypointDto.fromList(it) + } } 135.toByte() -> { - return (readValue(buffer) as? List)?.let { NavigationWaypointDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + NavigationWaypointDto.fromList(it) + } } 136.toByte() -> { - return (readValue(buffer) as? List)?.let { RouteSegmentDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + RouteSegmentDto.fromList(it) + } } 137.toByte() -> { - return (readValue(buffer) as? List)?.let { RouteSegmentDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + RouteSegmentDto.fromList(it) + } } 138.toByte() -> { - return (readValue(buffer) as? List)?.let { RouteSegmentTrafficDataDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + RouteSegmentTrafficDataDto.fromList(it) + } } 139.toByte() -> { return (readValue(buffer) as? List)?.let { @@ -4911,22 +4254,29 @@ private object NavigationSessionApiCodec : StandardMessageCodec() { } } 140.toByte() -> { - return (readValue(buffer) as? List)?.let { RouteTokenOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + RouteTokenOptionsDto.fromList(it) + } } 141.toByte() -> { - return (readValue(buffer) as? List)?.let { RoutingOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + RoutingOptionsDto.fromList(it) + } } 142.toByte() -> { - return (readValue(buffer) as? List)?.let { SimulationOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + SimulationOptionsDto.fromList(it) + } } 143.toByte() -> { - return (readValue(buffer) as? List)?.let { SpeedAlertOptionsDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + SpeedAlertOptionsDto.fromList(it) + } } else -> super.readValueOfType(type, buffer) } } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is DestinationsDto -> { stream.write(128) @@ -5000,119 +4350,61 @@ private object NavigationSessionApiCodec : StandardMessageCodec() { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface NavigationSessionApi { /** General. */ - fun createNavigationSession( - abnormalTerminationReportingEnabled: Boolean, - callback: (Result) -> Unit - ) - + fun createNavigationSession(abnormalTerminationReportingEnabled: Boolean, callback: (Result) -> Unit) fun isInitialized(): Boolean - fun cleanup() - - fun showTermsAndConditionsDialog( - title: String, - companyName: String, - shouldOnlyShowDriverAwarenessDisclaimer: Boolean, - callback: (Result) -> Unit - ) - + fun showTermsAndConditionsDialog(title: String, companyName: String, shouldOnlyShowDriverAwarenessDisclaimer: Boolean, callback: (Result) -> Unit) fun areTermsAccepted(): Boolean - fun resetTermsAccepted() - fun getNavSDKVersion(): String /** Navigation. */ fun isGuidanceRunning(): Boolean - fun startGuidance() - fun stopGuidance() - fun setDestinations(destinations: DestinationsDto, callback: (Result) -> Unit) - fun clearDestinations() - fun continueToNextDestination(): NavigationWaypointDto? - fun getCurrentTimeAndDistance(): NavigationTimeAndDistanceDto - fun setAudioGuidance(settings: NavigationAudioGuidanceSettingsDto) - fun setSpeedAlertOptions(options: SpeedAlertOptionsDto) - fun getRouteSegments(): List - fun getTraveledRoute(): List - fun getCurrentRouteSegment(): RouteSegmentDto? /** Simulation */ fun setUserLocation(location: LatLngDto) - fun removeUserLocation() - fun simulateLocationsAlongExistingRoute() - fun simulateLocationsAlongExistingRouteWithOptions(options: SimulationOptionsDto) - - fun simulateLocationsAlongNewRoute( - waypoints: List, - callback: (Result) -> Unit - ) - - fun simulateLocationsAlongNewRouteWithRoutingOptions( - waypoints: List, - routingOptions: RoutingOptionsDto, - callback: (Result) -> Unit - ) - - fun simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( - waypoints: List, - routingOptions: RoutingOptionsDto, - simulationOptions: SimulationOptionsDto, - callback: (Result) -> Unit - ) - + fun simulateLocationsAlongNewRoute(waypoints: List, callback: (Result) -> Unit) + fun simulateLocationsAlongNewRouteWithRoutingOptions(waypoints: List, routingOptions: RoutingOptionsDto, callback: (Result) -> Unit) + fun simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(waypoints: List, routingOptions: RoutingOptionsDto, simulationOptions: SimulationOptionsDto, callback: (Result) -> Unit) fun pauseSimulation() - fun resumeSimulation() /** Simulation (iOS only) */ fun allowBackgroundLocationUpdates(allow: Boolean) /** Road snapped location updates. */ fun enableRoadSnappedLocationUpdates() - fun disableRoadSnappedLocationUpdates() /** Enable Turn-by-Turn navigation events. */ fun enableTurnByTurnNavigationEvents(numNextStepsToPreview: Long?) - fun disableTurnByTurnNavigationEvents() - - fun registerRemainingTimeOrDistanceChangedListener( - remainingTimeThresholdSeconds: Long, - remainingDistanceThresholdMeters: Long - ) + fun registerRemainingTimeOrDistanceChangedListener(remainingTimeThresholdSeconds: Long, remainingDistanceThresholdMeters: Long) companion object { /** The codec used by NavigationSessionApi. */ - val codec: MessageCodec by lazy { NavigationSessionApiCodec } - /** - * Sets up an instance of `NavigationSessionApi` to handle messages through the - * `binaryMessenger`. - */ + val codec: MessageCodec by lazy { + NavigationSessionApiCodec + } + /** Sets up an instance of `NavigationSessionApi` to handle messages through the `binaryMessenger`. */ @Suppress("UNCHECKED_CAST") fun setUp(binaryMessenger: BinaryMessenger, api: NavigationSessionApi?) { run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val abnormalTerminationReportingEnabledArg = args[0] as Boolean - api.createNavigationSession(abnormalTerminationReportingEnabledArg) { - result: Result -> + api.createNavigationSession(abnormalTerminationReportingEnabledArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -5126,12 +4418,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5147,12 +4434,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5169,23 +4451,14 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val titleArg = args[0] as String val companyNameArg = args[1] as String val shouldOnlyShowDriverAwarenessDisclaimerArg = args[2] as Boolean - api.showTermsAndConditionsDialog( - titleArg, - companyNameArg, - shouldOnlyShowDriverAwarenessDisclaimerArg - ) { result: Result -> + api.showTermsAndConditionsDialog(titleArg, companyNameArg, shouldOnlyShowDriverAwarenessDisclaimerArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -5200,12 +4473,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5221,12 +4489,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5243,12 +4506,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5264,12 +4522,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5285,12 +4538,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5307,12 +4555,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5329,12 +4572,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -5354,12 +4592,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5376,12 +4609,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5397,12 +4625,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5418,12 +4641,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -5442,12 +4660,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -5466,12 +4679,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5487,12 +4695,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5508,12 +4711,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5529,12 +4727,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -5553,12 +4746,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5575,12 +4763,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5597,12 +4780,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -5621,12 +4799,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -5646,19 +4819,13 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val waypointsArg = args[0] as List val routingOptionsArg = args[1] as RoutingOptionsDto - api.simulateLocationsAlongNewRouteWithRoutingOptions(waypointsArg, routingOptionsArg) { - result: Result -> + api.simulateLocationsAlongNewRouteWithRoutingOptions(waypointsArg, routingOptionsArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -5673,23 +4840,14 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val waypointsArg = args[0] as List val routingOptionsArg = args[1] as RoutingOptionsDto val simulationOptionsArg = args[2] as SimulationOptionsDto - api.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( - waypointsArg, - routingOptionsArg, - simulationOptionsArg - ) { result: Result -> + api.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(waypointsArg, routingOptionsArg, simulationOptionsArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -5704,12 +4862,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5726,12 +4879,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5748,12 +4896,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -5772,12 +4915,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5794,12 +4932,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5816,17 +4949,11 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val numNextStepsToPreviewArg = - args[0].let { if (it is Int) it.toLong() else it as Long? } + val numNextStepsToPreviewArg = args[0].let { if (it is Int) it.toLong() else it as Long? } var wrapped: List try { api.enableTurnByTurnNavigationEvents(numNextStepsToPreviewArg) @@ -5841,12 +4968,7 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents", codec) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -5863,25 +4985,15 @@ interface NavigationSessionApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val remainingTimeThresholdSecondsArg = - args[0].let { if (it is Int) it.toLong() else it as Long } - val remainingDistanceThresholdMetersArg = - args[1].let { if (it is Int) it.toLong() else it as Long } + val remainingTimeThresholdSecondsArg = args[0].let { if (it is Int) it.toLong() else it as Long } + val remainingDistanceThresholdMetersArg = args[1].let { if (it is Int) it.toLong() else it as Long } var wrapped: List try { - api.registerRemainingTimeOrDistanceChangedListener( - remainingTimeThresholdSecondsArg, - remainingDistanceThresholdMetersArg - ) + api.registerRemainingTimeOrDistanceChangedListener(remainingTimeThresholdSecondsArg, remainingDistanceThresholdMetersArg) wrapped = listOf(null) } catch (exception: Throwable) { wrapped = wrapError(exception) @@ -5895,40 +5007,54 @@ interface NavigationSessionApi { } } } - @Suppress("UNCHECKED_CAST") private object NavigationSessionEventApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { LaneDirectionDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LaneDirectionDto.fromList(it) + } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { LaneDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LaneDto.fromList(it) + } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + LatLngDto.fromList(it) + } } 131.toByte() -> { - return (readValue(buffer) as? List)?.let { NavInfoDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + NavInfoDto.fromList(it) + } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { NavigationWaypointDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + NavigationWaypointDto.fromList(it) + } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { SpeedingUpdatedEventDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + SpeedingUpdatedEventDto.fromList(it) + } } 134.toByte() -> { - return (readValue(buffer) as? List)?.let { StepInfoDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + StepInfoDto.fromList(it) + } } 135.toByte() -> { - return (readValue(buffer) as? List)?.let { StepInfoDto.fromList(it) } + return (readValue(buffer) as? List)?.let { + StepInfoDto.fromList(it) + } } else -> super.readValueOfType(type, buffer) } } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is LaneDirectionDto -> { stream.write(128) @@ -5972,12 +5098,12 @@ private object NavigationSessionEventApiCodec : StandardMessageCodec() { class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by NavigationSessionEventApi. */ - val codec: MessageCodec by lazy { NavigationSessionEventApiCodec } + val codec: MessageCodec by lazy { + NavigationSessionEventApiCodec + } } - fun onSpeedingUpdated(msgArg: SpeedingUpdatedEventDto, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(msgArg)) { if (it is List<*>) { @@ -5988,13 +5114,11 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onRoadSnappedLocationUpdated(locationArg: LatLngDto, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(locationArg)) { if (it is List<*>) { @@ -6005,13 +5129,11 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onRoadSnappedRawLocationUpdated(locationArg: LatLngDto, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(locationArg)) { if (it is List<*>) { @@ -6022,13 +5144,11 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onArrival(waypointArg: NavigationWaypointDto, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(waypointArg)) { if (it is List<*>) { @@ -6039,13 +5159,11 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onRouteChanged(callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -6056,17 +5174,11 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - - fun onRemainingTimeOrDistanceChanged( - remainingTimeArg: Double, - remainingDistanceArg: Double, - callback: (Result) -> Unit - ) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged" + fun onRemainingTimeOrDistanceChanged(remainingTimeArg: Double, remainingDistanceArg: Double, callback: (Result) -> Unit) { + val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(remainingTimeArg, remainingDistanceArg)) { if (it is List<*>) { @@ -6077,13 +5189,12 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Android-only event. */ fun onTrafficUpdated(callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -6094,13 +5205,12 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Android-only event. */ fun onRerouting(callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -6111,13 +5221,12 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Android-only event. */ fun onGpsAvailabilityUpdate(availableArg: Boolean, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(availableArg)) { if (it is List<*>) { @@ -6128,13 +5237,12 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Turn-by-Turn navigation events. */ fun onNavInfo(navInfoArg: NavInfoDto, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo" + val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(navInfoArg)) { if (it is List<*>) { @@ -6145,7 +5253,7 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } @@ -6155,20 +5263,14 @@ interface NavigationInspector { companion object { /** The codec used by NavigationInspector. */ - val codec: MessageCodec by lazy { StandardMessageCodec() } - /** - * Sets up an instance of `NavigationInspector` to handle messages through the - * `binaryMessenger`. - */ + val codec: MessageCodec by lazy { + StandardMessageCodec() + } + /** Sets up an instance of `NavigationInspector` to handle messages through the `binaryMessenger`. */ @Suppress("UNCHECKED_CAST") fun setUp(binaryMessenger: BinaryMessenger, api: NavigationInspector?) { run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession", - codec - ) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List diff --git a/ios/Classes/messages.g.swift b/ios/Classes/messages.g.swift index e00a7c6..9856d30 100644 --- a/ios/Classes/messages.g.swift +++ b/ios/Classes/messages.g.swift @@ -1,31 +1,31 @@ // Copyright 2023 Google LLC -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // https://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Autogenerated from Pigeon (v15.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation #if os(iOS) - import Flutter +import Flutter #elseif os(macOS) - import FlutterMacOS +import FlutterMacOS #else - #error("Unsupported platform.") +#error("Unsupported platform.") #endif private func wrapResult(_ result: Any?) -> [Any?] { - [result] + return [result] } private func wrapError(_ error: Any) -> [Any?] { @@ -33,26 +33,22 @@ private func wrapError(_ error: Any) -> [Any?] { return [ flutterError.code, flutterError.message, - flutterError.details, + flutterError.details ] } return [ "\(error)", "\(type(of: error))", - "Stacktrace: \(Thread.callStackSymbols)", + "Stacktrace: \(Thread.callStackSymbols)" ] } private func createConnectionError(withChannelName channelName: String) -> FlutterError { - FlutterError( - code: "channel-error", - message: "Unable to establish connection on channel: '\(channelName)'.", - details: "" - ) + return FlutterError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") } private func isNullish(_ value: Any?) -> Bool { - value is NSNull || value == nil + return value is NSNull || value == nil } private func nilOrValue(_ value: Any?) -> T? { @@ -60,6 +56,14 @@ private func nilOrValue(_ value: Any?) -> T? { return value as! T? } +/// Describes the type of map to construct. +enum MapViewTypeDto: Int { + /// Navigation view supports navigation overlay, and current navigation session is displayed on the map. + case navigation = 0 + /// Classic map view, without navigation overlay. + case map = 1 +} + /// Determines the initial visibility of the navigation UI on map initialization. enum NavigationUIEnabledPreferenceDto: Int { /// Navigation UI gets enabled if the navigation @@ -285,11 +289,9 @@ enum ManeuverDto: Int { case roundaboutStraightClockwise = 50 /// Enter a roundabout in the counterclockwise direction and continue straight. case roundaboutStraightCounterclockwise = 51 - /// Enter a roundabout in the clockwise direction and turn clockwise onto the opposite side of the - /// street. + /// Enter a roundabout in the clockwise direction and turn clockwise onto the opposite side of the street. case roundaboutUTurnClockwise = 52 - /// Enter a roundabout in the counterclockwise direction and turn counterclockwise onto the - /// opposite side of the street. + /// Enter a roundabout in the counterclockwise direction and turn counterclockwise onto the opposite side of the street. case roundaboutUTurnCounterclockwise = 53 /// Continue straight. case straight = 54 @@ -386,14 +388,14 @@ struct MapOptionsDto { /// If true, enables the map toolbar. var mapToolbarEnabled: Bool /// The minimum zoom level that can be set for the map. - var minZoomPreference: Double? + var minZoomPreference: Double? = nil /// The maximum zoom level that can be set for the map. - var maxZoomPreference: Double? + var maxZoomPreference: Double? = nil /// If true, enables zoom controls for the map. var zoomControlsEnabled: Bool /// Specifies a bounds to constrain the camera target, so that when users scroll and pan the map, /// the camera target does not move outside these bounds. - var cameraTargetBounds: LatLngBoundsDto? + var cameraTargetBounds: LatLngBoundsDto? = nil static func fromList(_ list: [Any?]) -> MapOptionsDto? { let cameraPosition = CameraPositionDto.fromList(list[0] as! [Any?])! @@ -408,7 +410,7 @@ struct MapOptionsDto { let minZoomPreference: Double? = nilOrValue(list[9]) let maxZoomPreference: Double? = nilOrValue(list[10]) let zoomControlsEnabled = list[11] as! Bool - var cameraTargetBounds: LatLngBoundsDto? + var cameraTargetBounds: LatLngBoundsDto? = nil if let cameraTargetBoundsList: [Any?] = nilOrValue(list[12]) { cameraTargetBounds = LatLngBoundsDto.fromList(cameraTargetBoundsList) } @@ -429,9 +431,8 @@ struct MapOptionsDto { cameraTargetBounds: cameraTargetBounds ) } - func toList() -> [Any?] { - [ + return [ cameraPosition.toList(), mapType.rawValue, compassEnabled, @@ -463,9 +464,8 @@ struct NavigationViewOptionsDto { navigationUIEnabledPreference: navigationUIEnabledPreference ) } - func toList() -> [Any?] { - [ + return [ navigationUIEnabledPreference.rawValue, ] } @@ -477,24 +477,30 @@ struct NavigationViewOptionsDto { /// specified initial parameters. /// /// Generated class from Pigeon that represents data sent in messages. -struct NavigationViewCreationOptionsDto { +struct ViewCreationOptionsDto { + var mapViewType: MapViewTypeDto var mapOptions: MapOptionsDto - var navigationViewOptions: NavigationViewOptionsDto + var navigationViewOptions: NavigationViewOptionsDto? = nil - static func fromList(_ list: [Any?]) -> NavigationViewCreationOptionsDto? { - let mapOptions = MapOptionsDto.fromList(list[0] as! [Any?])! - let navigationViewOptions = NavigationViewOptionsDto.fromList(list[1] as! [Any?])! + static func fromList(_ list: [Any?]) -> ViewCreationOptionsDto? { + let mapViewType = MapViewTypeDto(rawValue: list[0] as! Int)! + let mapOptions = MapOptionsDto.fromList(list[1] as! [Any?])! + var navigationViewOptions: NavigationViewOptionsDto? = nil + if let navigationViewOptionsList: [Any?] = nilOrValue(list[2]) { + navigationViewOptions = NavigationViewOptionsDto.fromList(navigationViewOptionsList) + } - return NavigationViewCreationOptionsDto( + return ViewCreationOptionsDto( + mapViewType: mapViewType, mapOptions: mapOptions, navigationViewOptions: navigationViewOptions ) } - func toList() -> [Any?] { - [ + return [ + mapViewType.rawValue, mapOptions.toList(), - navigationViewOptions.toList(), + navigationViewOptions?.toList(), ] } } @@ -519,9 +525,8 @@ struct CameraPositionDto { zoom: zoom ) } - func toList() -> [Any?] { - [ + return [ bearing, target.toList(), tilt, @@ -546,9 +551,8 @@ struct MarkerDto { options: options ) } - func toList() -> [Any?] { - [ + return [ markerId, options.toList(), ] @@ -596,9 +600,8 @@ struct MarkerOptionsDto { icon: icon ) } - func toList() -> [Any?] { - [ + return [ alpha, anchor.toList(), draggable, @@ -616,10 +619,10 @@ struct MarkerOptionsDto { /// Generated class from Pigeon that represents data sent in messages. struct ImageDescriptorDto { - var registeredImageId: String? - var imagePixelRatio: Double? - var width: Double? - var height: Double? + var registeredImageId: String? = nil + var imagePixelRatio: Double? = nil + var width: Double? = nil + var height: Double? = nil static func fromList(_ list: [Any?]) -> ImageDescriptorDto? { let registeredImageId: String? = nilOrValue(list[0]) @@ -634,9 +637,8 @@ struct ImageDescriptorDto { height: height ) } - func toList() -> [Any?] { - [ + return [ registeredImageId, imagePixelRatio, width, @@ -647,8 +649,8 @@ struct ImageDescriptorDto { /// Generated class from Pigeon that represents data sent in messages. struct InfoWindowDto { - var title: String? - var snippet: String? + var title: String? = nil + var snippet: String? = nil var anchor: MarkerAnchorDto static func fromList(_ list: [Any?]) -> InfoWindowDto? { @@ -662,9 +664,8 @@ struct InfoWindowDto { anchor: anchor ) } - func toList() -> [Any?] { - [ + return [ title, snippet, anchor.toList(), @@ -686,9 +687,8 @@ struct MarkerAnchorDto { v: v ) } - func toList() -> [Any?] { - [ + return [ u, v, ] @@ -709,9 +709,8 @@ struct PolygonDto { options: options ) } - func toList() -> [Any?] { - [ + return [ polygonId, options.toList(), ] @@ -753,9 +752,8 @@ struct PolygonOptionsDto { zIndex: zIndex ) } - func toList() -> [Any?] { - [ + return [ points, holes, clickable, @@ -780,9 +778,8 @@ struct PolygonHoleDto { points: points ) } - func toList() -> [Any?] { - [ + return [ points, ] } @@ -790,17 +787,14 @@ struct PolygonHoleDto { /// Generated class from Pigeon that represents data sent in messages. struct StyleSpanStrokeStyleDto { - var solidColor: Int64? - var fromColor: Int64? - var toColor: Int64? + var solidColor: Int64? = nil + var fromColor: Int64? = nil + var toColor: Int64? = nil static func fromList(_ list: [Any?]) -> StyleSpanStrokeStyleDto? { - let solidColor: Int64? = isNullish(list[0]) ? nil : - (list[0] is Int64? ? list[0] as! Int64? : Int64(list[0] as! Int32)) - let fromColor: Int64? = isNullish(list[1]) ? nil : - (list[1] is Int64? ? list[1] as! Int64? : Int64(list[1] as! Int32)) - let toColor: Int64? = isNullish(list[2]) ? nil : - (list[2] is Int64? ? list[2] as! Int64? : Int64(list[2] as! Int32)) + let solidColor: Int64? = isNullish(list[0]) ? nil : (list[0] is Int64? ? list[0] as! Int64? : Int64(list[0] as! Int32)) + let fromColor: Int64? = isNullish(list[1]) ? nil : (list[1] is Int64? ? list[1] as! Int64? : Int64(list[1] as! Int32)) + let toColor: Int64? = isNullish(list[2]) ? nil : (list[2] is Int64? ? list[2] as! Int64? : Int64(list[2] as! Int32)) return StyleSpanStrokeStyleDto( solidColor: solidColor, @@ -808,9 +802,8 @@ struct StyleSpanStrokeStyleDto { toColor: toColor ) } - func toList() -> [Any?] { - [ + return [ solidColor, fromColor, toColor, @@ -832,9 +825,8 @@ struct StyleSpanDto { style: style ) } - func toList() -> [Any?] { - [ + return [ length, style.toList(), ] @@ -855,9 +847,8 @@ struct PolylineDto { options: options ) } - func toList() -> [Any?] { - [ + return [ polylineId, options.toList(), ] @@ -867,7 +858,7 @@ struct PolylineDto { /// Generated class from Pigeon that represents data sent in messages. struct PatternItemDto { var type: PatternTypeDto - var length: Double? + var length: Double? = nil static func fromList(_ list: [Any?]) -> PatternItemDto? { let type = PatternTypeDto(rawValue: list[0] as! Int)! @@ -878,9 +869,8 @@ struct PatternItemDto { length: length ) } - func toList() -> [Any?] { - [ + return [ type.rawValue, length, ] @@ -889,24 +879,23 @@ struct PatternItemDto { /// Generated class from Pigeon that represents data sent in messages. struct PolylineOptionsDto { - var points: [LatLngDto?]? - var clickable: Bool? - var geodesic: Bool? - var strokeColor: Int64? - var strokeJointType: StrokeJointTypeDto? - var strokePattern: [PatternItemDto?]? - var strokeWidth: Double? - var visible: Bool? - var zIndex: Double? + var points: [LatLngDto?]? = nil + var clickable: Bool? = nil + var geodesic: Bool? = nil + var strokeColor: Int64? = nil + var strokeJointType: StrokeJointTypeDto? = nil + var strokePattern: [PatternItemDto?]? = nil + var strokeWidth: Double? = nil + var visible: Bool? = nil + var zIndex: Double? = nil var spans: [StyleSpanDto?] static func fromList(_ list: [Any?]) -> PolylineOptionsDto? { let points: [LatLngDto?]? = nilOrValue(list[0]) let clickable: Bool? = nilOrValue(list[1]) let geodesic: Bool? = nilOrValue(list[2]) - let strokeColor: Int64? = isNullish(list[3]) ? nil : - (list[3] is Int64? ? list[3] as! Int64? : Int64(list[3] as! Int32)) - var strokeJointType: StrokeJointTypeDto? + let strokeColor: Int64? = isNullish(list[3]) ? nil : (list[3] is Int64? ? list[3] as! Int64? : Int64(list[3] as! Int32)) + var strokeJointType: StrokeJointTypeDto? = nil let strokeJointTypeEnumVal: Int? = nilOrValue(list[4]) if let strokeJointTypeRawValue = strokeJointTypeEnumVal { strokeJointType = StrokeJointTypeDto(rawValue: strokeJointTypeRawValue)! @@ -930,9 +919,8 @@ struct PolylineOptionsDto { spans: spans ) } - func toList() -> [Any?] { - [ + return [ points, clickable, geodesic, @@ -963,9 +951,8 @@ struct CircleDto { options: options ) } - func toList() -> [Any?] { - [ + return [ circleId, options.toList(), ] @@ -1007,9 +994,8 @@ struct CircleOptionsDto { clickable: clickable ) } - func toList() -> [Any?] { - [ + return [ position.toList(), radius, strokeWidth, @@ -1026,11 +1012,11 @@ struct CircleOptionsDto { /// Generated class from Pigeon that represents data sent in messages. struct RouteTokenOptionsDto { var routeToken: String - var travelMode: TravelModeDto? + var travelMode: TravelModeDto? = nil static func fromList(_ list: [Any?]) -> RouteTokenOptionsDto? { let routeToken = list[0] as! String - var travelMode: TravelModeDto? + var travelMode: TravelModeDto? = nil let travelModeEnumVal: Int? = nilOrValue(list[1]) if let travelModeRawValue = travelModeEnumVal { travelMode = TravelModeDto(rawValue: travelModeRawValue)! @@ -1041,9 +1027,8 @@ struct RouteTokenOptionsDto { travelMode: travelMode ) } - func toList() -> [Any?] { - [ + return [ routeToken, travelMode?.rawValue, ] @@ -1054,17 +1039,17 @@ struct RouteTokenOptionsDto { struct DestinationsDto { var waypoints: [NavigationWaypointDto?] var displayOptions: NavigationDisplayOptionsDto - var routingOptions: RoutingOptionsDto? - var routeTokenOptions: RouteTokenOptionsDto? + var routingOptions: RoutingOptionsDto? = nil + var routeTokenOptions: RouteTokenOptionsDto? = nil static func fromList(_ list: [Any?]) -> DestinationsDto? { let waypoints = list[0] as! [NavigationWaypointDto?] let displayOptions = NavigationDisplayOptionsDto.fromList(list[1] as! [Any?])! - var routingOptions: RoutingOptionsDto? + var routingOptions: RoutingOptionsDto? = nil if let routingOptionsList: [Any?] = nilOrValue(list[2]) { routingOptions = RoutingOptionsDto.fromList(routingOptionsList) } - var routeTokenOptions: RouteTokenOptionsDto? + var routeTokenOptions: RouteTokenOptionsDto? = nil if let routeTokenOptionsList: [Any?] = nilOrValue(list[3]) { routeTokenOptions = RouteTokenOptionsDto.fromList(routeTokenOptionsList) } @@ -1076,9 +1061,8 @@ struct DestinationsDto { routeTokenOptions: routeTokenOptions ) } - func toList() -> [Any?] { - [ + return [ waypoints, displayOptions.toList(), routingOptions?.toList(), @@ -1089,29 +1073,28 @@ struct DestinationsDto { /// Generated class from Pigeon that represents data sent in messages. struct RoutingOptionsDto { - var alternateRoutesStrategy: AlternateRoutesStrategyDto? - var routingStrategy: RoutingStrategyDto? - var targetDistanceMeters: [Int64?]? - var travelMode: TravelModeDto? - var avoidTolls: Bool? - var avoidFerries: Bool? - var avoidHighways: Bool? - var locationTimeoutMs: Int64? + var alternateRoutesStrategy: AlternateRoutesStrategyDto? = nil + var routingStrategy: RoutingStrategyDto? = nil + var targetDistanceMeters: [Int64?]? = nil + var travelMode: TravelModeDto? = nil + var avoidTolls: Bool? = nil + var avoidFerries: Bool? = nil + var avoidHighways: Bool? = nil + var locationTimeoutMs: Int64? = nil static func fromList(_ list: [Any?]) -> RoutingOptionsDto? { - var alternateRoutesStrategy: AlternateRoutesStrategyDto? + var alternateRoutesStrategy: AlternateRoutesStrategyDto? = nil let alternateRoutesStrategyEnumVal: Int? = nilOrValue(list[0]) if let alternateRoutesStrategyRawValue = alternateRoutesStrategyEnumVal { - alternateRoutesStrategy = - AlternateRoutesStrategyDto(rawValue: alternateRoutesStrategyRawValue)! + alternateRoutesStrategy = AlternateRoutesStrategyDto(rawValue: alternateRoutesStrategyRawValue)! } - var routingStrategy: RoutingStrategyDto? + var routingStrategy: RoutingStrategyDto? = nil let routingStrategyEnumVal: Int? = nilOrValue(list[1]) if let routingStrategyRawValue = routingStrategyEnumVal { routingStrategy = RoutingStrategyDto(rawValue: routingStrategyRawValue)! } let targetDistanceMeters: [Int64?]? = nilOrValue(list[2]) - var travelMode: TravelModeDto? + var travelMode: TravelModeDto? = nil let travelModeEnumVal: Int? = nilOrValue(list[3]) if let travelModeRawValue = travelModeEnumVal { travelMode = TravelModeDto(rawValue: travelModeRawValue)! @@ -1119,8 +1102,7 @@ struct RoutingOptionsDto { let avoidTolls: Bool? = nilOrValue(list[4]) let avoidFerries: Bool? = nilOrValue(list[5]) let avoidHighways: Bool? = nilOrValue(list[6]) - let locationTimeoutMs: Int64? = isNullish(list[7]) ? nil : - (list[7] is Int64? ? list[7] as! Int64? : Int64(list[7] as! Int32)) + let locationTimeoutMs: Int64? = isNullish(list[7]) ? nil : (list[7] is Int64? ? list[7] as! Int64? : Int64(list[7] as! Int32)) return RoutingOptionsDto( alternateRoutesStrategy: alternateRoutesStrategy, @@ -1133,9 +1115,8 @@ struct RoutingOptionsDto { locationTimeoutMs: locationTimeoutMs ) } - func toList() -> [Any?] { - [ + return [ alternateRoutesStrategy?.rawValue, routingStrategy?.rawValue, targetDistanceMeters, @@ -1150,9 +1131,9 @@ struct RoutingOptionsDto { /// Generated class from Pigeon that represents data sent in messages. struct NavigationDisplayOptionsDto { - var showDestinationMarkers: Bool? - var showStopSigns: Bool? - var showTrafficLights: Bool? + var showDestinationMarkers: Bool? = nil + var showStopSigns: Bool? = nil + var showTrafficLights: Bool? = nil static func fromList(_ list: [Any?]) -> NavigationDisplayOptionsDto? { let showDestinationMarkers: Bool? = nilOrValue(list[0]) @@ -1165,9 +1146,8 @@ struct NavigationDisplayOptionsDto { showTrafficLights: showTrafficLights ) } - func toList() -> [Any?] { - [ + return [ showDestinationMarkers, showStopSigns, showTrafficLights, @@ -1178,21 +1158,20 @@ struct NavigationDisplayOptionsDto { /// Generated class from Pigeon that represents data sent in messages. struct NavigationWaypointDto { var title: String - var target: LatLngDto? - var placeID: String? - var preferSameSideOfRoad: Bool? - var preferredSegmentHeading: Int64? + var target: LatLngDto? = nil + var placeID: String? = nil + var preferSameSideOfRoad: Bool? = nil + var preferredSegmentHeading: Int64? = nil static func fromList(_ list: [Any?]) -> NavigationWaypointDto? { let title = list[0] as! String - var target: LatLngDto? + var target: LatLngDto? = nil if let targetList: [Any?] = nilOrValue(list[1]) { target = LatLngDto.fromList(targetList) } let placeID: String? = nilOrValue(list[2]) let preferSameSideOfRoad: Bool? = nilOrValue(list[3]) - let preferredSegmentHeading: Int64? = isNullish(list[4]) ? nil : - (list[4] is Int64? ? list[4] as! Int64? : Int64(list[4] as! Int32)) + let preferredSegmentHeading: Int64? = isNullish(list[4]) ? nil : (list[4] is Int64? ? list[4] as! Int64? : Int64(list[4] as! Int32)) return NavigationWaypointDto( title: title, @@ -1202,9 +1181,8 @@ struct NavigationWaypointDto { preferredSegmentHeading: preferredSegmentHeading ) } - func toList() -> [Any?] { - [ + return [ title, target?.toList(), placeID, @@ -1228,9 +1206,8 @@ struct NavigationTimeAndDistanceDto { distance: distance ) } - func toList() -> [Any?] { - [ + return [ time, distance, ] @@ -1239,14 +1216,14 @@ struct NavigationTimeAndDistanceDto { /// Generated class from Pigeon that represents data sent in messages. struct NavigationAudioGuidanceSettingsDto { - var isBluetoothAudioEnabled: Bool? - var isVibrationEnabled: Bool? - var guidanceType: AudioGuidanceTypeDto? + var isBluetoothAudioEnabled: Bool? = nil + var isVibrationEnabled: Bool? = nil + var guidanceType: AudioGuidanceTypeDto? = nil static func fromList(_ list: [Any?]) -> NavigationAudioGuidanceSettingsDto? { let isBluetoothAudioEnabled: Bool? = nilOrValue(list[0]) let isVibrationEnabled: Bool? = nilOrValue(list[1]) - var guidanceType: AudioGuidanceTypeDto? + var guidanceType: AudioGuidanceTypeDto? = nil let guidanceTypeEnumVal: Int? = nilOrValue(list[2]) if let guidanceTypeRawValue = guidanceTypeEnumVal { guidanceType = AudioGuidanceTypeDto(rawValue: guidanceTypeRawValue)! @@ -1258,9 +1235,8 @@ struct NavigationAudioGuidanceSettingsDto { guidanceType: guidanceType ) } - func toList() -> [Any?] { - [ + return [ isBluetoothAudioEnabled, isVibrationEnabled, guidanceType?.rawValue, @@ -1279,9 +1255,8 @@ struct SimulationOptionsDto { speedMultiplier: speedMultiplier ) } - func toList() -> [Any?] { - [ + return [ speedMultiplier, ] } @@ -1301,9 +1276,8 @@ struct LatLngDto { longitude: longitude ) } - func toList() -> [Any?] { - [ + return [ latitude, longitude, ] @@ -1324,9 +1298,8 @@ struct LatLngBoundsDto { northeast: northeast ) } - func toList() -> [Any?] { - [ + return [ southwest.toList(), northeast.toList(), ] @@ -1347,9 +1320,8 @@ struct SpeedingUpdatedEventDto { severity: severity ) } - func toList() -> [Any?] { - [ + return [ percentageAboveLimit, severity.rawValue, ] @@ -1373,9 +1345,8 @@ struct SpeedAlertOptionsDto { majorSpeedAlertThresholdPercentage: majorSpeedAlertThresholdPercentage ) } - func toList() -> [Any?] { - [ + return [ severityUpgradeDurationSeconds, minorSpeedAlertThresholdPercentage, majorSpeedAlertThresholdPercentage, @@ -1400,9 +1371,8 @@ struct RouteSegmentTrafficDataRoadStretchRenderingDataDto { offsetMeters: offsetMeters ) } - func toList() -> [Any?] { - [ + return [ style.rawValue, lengthMeters, offsetMeters, @@ -1417,17 +1387,15 @@ struct RouteSegmentTrafficDataDto { static func fromList(_ list: [Any?]) -> RouteSegmentTrafficDataDto? { let status = RouteSegmentTrafficDataStatusDto(rawValue: list[0] as! Int)! - let roadStretchRenderingDataList = - list[1] as! [RouteSegmentTrafficDataRoadStretchRenderingDataDto?] + let roadStretchRenderingDataList = list[1] as! [RouteSegmentTrafficDataRoadStretchRenderingDataDto?] return RouteSegmentTrafficDataDto( status: status, roadStretchRenderingDataList: roadStretchRenderingDataList ) } - func toList() -> [Any?] { - [ + return [ status.rawValue, roadStretchRenderingDataList, ] @@ -1436,19 +1404,19 @@ struct RouteSegmentTrafficDataDto { /// Generated class from Pigeon that represents data sent in messages. struct RouteSegmentDto { - var trafficData: RouteSegmentTrafficDataDto? + var trafficData: RouteSegmentTrafficDataDto? = nil var destinationLatLng: LatLngDto - var latLngs: [LatLngDto?]? - var destinationWaypoint: NavigationWaypointDto? + var latLngs: [LatLngDto?]? = nil + var destinationWaypoint: NavigationWaypointDto? = nil static func fromList(_ list: [Any?]) -> RouteSegmentDto? { - var trafficData: RouteSegmentTrafficDataDto? + var trafficData: RouteSegmentTrafficDataDto? = nil if let trafficDataList: [Any?] = nilOrValue(list[0]) { trafficData = RouteSegmentTrafficDataDto.fromList(trafficDataList) } let destinationLatLng = LatLngDto.fromList(list[1] as! [Any?])! let latLngs: [LatLngDto?]? = nilOrValue(list[2]) - var destinationWaypoint: NavigationWaypointDto? + var destinationWaypoint: NavigationWaypointDto? = nil if let destinationWaypointList: [Any?] = nilOrValue(list[3]) { destinationWaypoint = NavigationWaypointDto.fromList(destinationWaypointList) } @@ -1460,9 +1428,8 @@ struct RouteSegmentDto { destinationWaypoint: destinationWaypoint ) } - func toList() -> [Any?] { - [ + return [ trafficData?.toList(), destinationLatLng.toList(), latLngs, @@ -1471,8 +1438,7 @@ struct RouteSegmentDto { } } -/// One of the possible directions from a lane at the end of a route step, and whether it is on the -/// recommended route. +/// One of the possible directions from a lane at the end of a route step, and whether it is on the recommended route. /// /// Generated class from Pigeon that represents data sent in messages. struct LaneDirectionDto { @@ -1490,9 +1456,8 @@ struct LaneDirectionDto { isRecommended: isRecommended ) } - func toList() -> [Any?] { - [ + return [ laneShape.rawValue, isRecommended, ] @@ -1503,8 +1468,7 @@ struct LaneDirectionDto { /// /// Generated class from Pigeon that represents data sent in messages. struct LaneDto { - /// List of possible directions a driver can follow when using this lane at the end of the - /// respective route step + /// List of possible directions a driver can follow when using this lane at the end of the respective route step var laneDirections: [LaneDirectionDto?] static func fromList(_ list: [Any?]) -> LaneDto? { @@ -1514,9 +1478,8 @@ struct LaneDto { laneDirections: laneDirections ) } - func toList() -> [Any?] { - [ + return [ laneDirections, ] } @@ -1533,7 +1496,7 @@ struct StepInfoDto { /// Whether this step is on a drive-on-right or drive-on-left route. var drivingSide: DrivingSideDto /// The exit number if it exists. - var exitNumber: String? + var exitNumber: String? = nil /// The full text of the instruction for this step. var fullInstructions: String /// The full road name for this step. @@ -1577,9 +1540,8 @@ struct StepInfoDto { stepNumber: stepNumber ) } - func toList() -> [Any?] { - [ + return [ distanceFromPrevStepMeters, timeFromPrevStepSeconds, drivingSide.rawValue, @@ -1603,52 +1565,46 @@ struct NavInfoDto { /// The current state of navigation. var navState: NavStateDto /// Information about the upcoming maneuver step. - var currentStep: StepInfoDto? + var currentStep: StepInfoDto? = nil /// The remaining steps after the current step. var remainingSteps: [StepInfoDto?] /// Whether the route has changed since the last sent message. var routeChanged: Bool /// Estimated remaining distance in meters along the route to the /// current step. - var distanceToCurrentStepMeters: Int64? + var distanceToCurrentStepMeters: Int64? = nil /// The estimated remaining distance in meters to the final destination which /// is the last destination in a multi-destination trip. - var distanceToFinalDestinationMeters: Int64? + var distanceToFinalDestinationMeters: Int64? = nil /// The estimated remaining distance in meters to the next destination. /// /// Android only. - var distanceToNextDestinationMeters: Int64? + var distanceToNextDestinationMeters: Int64? = nil /// The estimated remaining time in seconds along the route to the /// current step. - var timeToCurrentStepSeconds: Int64? + var timeToCurrentStepSeconds: Int64? = nil /// The estimated remaining time in seconds to the final destination which is /// the last destination in a multi-destination trip. - var timeToFinalDestinationSeconds: Int64? + var timeToFinalDestinationSeconds: Int64? = nil /// The estimated remaining time in seconds to the next destination. /// /// Android only. - var timeToNextDestinationSeconds: Int64? + var timeToNextDestinationSeconds: Int64? = nil static func fromList(_ list: [Any?]) -> NavInfoDto? { let navState = NavStateDto(rawValue: list[0] as! Int)! - var currentStep: StepInfoDto? + var currentStep: StepInfoDto? = nil if let currentStepList: [Any?] = nilOrValue(list[1]) { currentStep = StepInfoDto.fromList(currentStepList) } let remainingSteps = list[2] as! [StepInfoDto?] let routeChanged = list[3] as! Bool - let distanceToCurrentStepMeters: Int64? = isNullish(list[4]) ? nil : - (list[4] is Int64? ? list[4] as! Int64? : Int64(list[4] as! Int32)) - let distanceToFinalDestinationMeters: Int64? = isNullish(list[5]) ? nil : - (list[5] is Int64? ? list[5] as! Int64? : Int64(list[5] as! Int32)) - let distanceToNextDestinationMeters: Int64? = isNullish(list[6]) ? nil : - (list[6] is Int64? ? list[6] as! Int64? : Int64(list[6] as! Int32)) - let timeToCurrentStepSeconds: Int64? = isNullish(list[7]) ? nil : - (list[7] is Int64? ? list[7] as! Int64? : Int64(list[7] as! Int32)) - let timeToFinalDestinationSeconds: Int64? = isNullish(list[8]) ? nil : - (list[8] is Int64? ? list[8] as! Int64? : Int64(list[8] as! Int32)) - let timeToNextDestinationSeconds: Int64? = isNullish(list[9]) ? nil : - (list[9] is Int64? ? list[9] as! Int64? : Int64(list[9] as! Int32)) + let distanceToCurrentStepMeters: Int64? = isNullish(list[4]) ? nil : (list[4] is Int64? ? list[4] as! Int64? : Int64(list[4] as! Int32)) + let distanceToFinalDestinationMeters: Int64? = isNullish(list[5]) ? nil : (list[5] is Int64? ? list[5] as! Int64? : Int64(list[5] as! Int32)) + let distanceToNextDestinationMeters: Int64? = isNullish(list[6]) ? nil : (list[6] is Int64? ? list[6] as! Int64? : Int64(list[6] as! Int32)) + let timeToCurrentStepSeconds: Int64? = isNullish(list[7]) ? nil : (list[7] is Int64? ? list[7] as! Int64? : Int64(list[7] as! Int32)) + let timeToFinalDestinationSeconds: Int64? = isNullish(list[8]) ? nil : (list[8] is Int64? ? list[8] as! Int64? : Int64(list[8] as! Int32)) + let timeToNextDestinationSeconds: Int64? = isNullish(list[9]) ? nil : (list[9] is Int64? ? list[9] as! Int64? : Int64(list[9] as! Int32)) return NavInfoDto( navState: navState, @@ -1663,9 +1619,8 @@ struct NavInfoDto { timeToNextDestinationSeconds: timeToNextDestinationSeconds ) } - func toList() -> [Any?] { - [ + return [ navState.rawValue, currentStep?.toList(), remainingSteps, @@ -1683,20 +1638,20 @@ struct NavInfoDto { private class _NavigationViewCreationApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return CameraPositionDto.fromList(readValue() as! [Any?]) - case 129: - return LatLngBoundsDto.fromList(readValue() as! [Any?]) - case 130: - return LatLngDto.fromList(readValue() as! [Any?]) - case 131: - return MapOptionsDto.fromList(readValue() as! [Any?]) - case 132: - return NavigationViewCreationOptionsDto.fromList(readValue() as! [Any?]) - case 133: - return NavigationViewOptionsDto.fromList(readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return CameraPositionDto.fromList(self.readValue() as! [Any?]) + case 129: + return LatLngBoundsDto.fromList(self.readValue() as! [Any?]) + case 130: + return LatLngDto.fromList(self.readValue() as! [Any?]) + case 131: + return MapOptionsDto.fromList(self.readValue() as! [Any?]) + case 132: + return NavigationViewOptionsDto.fromList(self.readValue() as! [Any?]) + case 133: + return ViewCreationOptionsDto.fromList(self.readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } @@ -1715,10 +1670,10 @@ private class _NavigationViewCreationApiCodecWriter: FlutterStandardWriter { } else if let value = value as? MapOptionsDto { super.writeByte(131) super.writeValue(value.toList()) - } else if let value = value as? NavigationViewCreationOptionsDto { + } else if let value = value as? NavigationViewOptionsDto { super.writeByte(132) super.writeValue(value.toList()) - } else if let value = value as? NavigationViewOptionsDto { + } else if let value = value as? ViewCreationOptionsDto { super.writeByte(133) super.writeValue(value.toList()) } else { @@ -1729,17 +1684,16 @@ private class _NavigationViewCreationApiCodecWriter: FlutterStandardWriter { private class _NavigationViewCreationApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - _NavigationViewCreationApiCodecReader(data: data) + return _NavigationViewCreationApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - _NavigationViewCreationApiCodecWriter(data: data) + return _NavigationViewCreationApiCodecWriter(data: data) } } class _NavigationViewCreationApiCodec: FlutterStandardMessageCodec { - static let shared = - _NavigationViewCreationApiCodec(readerWriter: _NavigationViewCreationApiCodecReaderWriter()) + static let shared = _NavigationViewCreationApiCodec(readerWriter: _NavigationViewCreationApiCodecReaderWriter()) } /// Pigeon only generates messages if the messages are used in API. @@ -1748,25 +1702,20 @@ class _NavigationViewCreationApiCodec: FlutterStandardMessageCodec { /// /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol _NavigationViewCreationApi { - func _create(msg: NavigationViewCreationOptionsDto) throws + func _create(msg: ViewCreationOptionsDto) throws } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -enum _NavigationViewCreationApiSetup { +class _NavigationViewCreationApiSetup { /// The codec used by _NavigationViewCreationApi. static var codec: FlutterStandardMessageCodec { _NavigationViewCreationApiCodec.shared } - /// Sets up an instance of `_NavigationViewCreationApi` to handle messages through the - /// `binaryMessenger`. + /// Sets up an instance of `_NavigationViewCreationApi` to handle messages through the `binaryMessenger`. static func setUp(binaryMessenger: FlutterBinaryMessenger, api: _NavigationViewCreationApi?) { - let _createChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let _createChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { _createChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let msgArg = args[0] as! NavigationViewCreationOptionsDto + let msgArg = args[0] as! ViewCreationOptionsDto do { try api._create(msg: msgArg) reply(wrapResult(nil)) @@ -1779,55 +1728,54 @@ enum _NavigationViewCreationApiSetup { } } } - -private class NavigationViewApiCodecReader: FlutterStandardReader { +private class MapViewApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return CameraPositionDto.fromList(readValue() as! [Any?]) - case 129: - return CircleDto.fromList(readValue() as! [Any?]) - case 130: - return CircleOptionsDto.fromList(readValue() as! [Any?]) - case 131: - return ImageDescriptorDto.fromList(readValue() as! [Any?]) - case 132: - return InfoWindowDto.fromList(readValue() as! [Any?]) - case 133: - return LatLngBoundsDto.fromList(readValue() as! [Any?]) - case 134: - return LatLngDto.fromList(readValue() as! [Any?]) - case 135: - return LatLngDto.fromList(readValue() as! [Any?]) - case 136: - return MarkerAnchorDto.fromList(readValue() as! [Any?]) - case 137: - return MarkerDto.fromList(readValue() as! [Any?]) - case 138: - return MarkerOptionsDto.fromList(readValue() as! [Any?]) - case 139: - return PatternItemDto.fromList(readValue() as! [Any?]) - case 140: - return PolygonDto.fromList(readValue() as! [Any?]) - case 141: - return PolygonHoleDto.fromList(readValue() as! [Any?]) - case 142: - return PolygonOptionsDto.fromList(readValue() as! [Any?]) - case 143: - return PolylineDto.fromList(readValue() as! [Any?]) - case 144: - return PolylineOptionsDto.fromList(readValue() as! [Any?]) - case 145: - return StyleSpanDto.fromList(readValue() as! [Any?]) - case 146: - return StyleSpanStrokeStyleDto.fromList(readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return CameraPositionDto.fromList(self.readValue() as! [Any?]) + case 129: + return CircleDto.fromList(self.readValue() as! [Any?]) + case 130: + return CircleOptionsDto.fromList(self.readValue() as! [Any?]) + case 131: + return ImageDescriptorDto.fromList(self.readValue() as! [Any?]) + case 132: + return InfoWindowDto.fromList(self.readValue() as! [Any?]) + case 133: + return LatLngBoundsDto.fromList(self.readValue() as! [Any?]) + case 134: + return LatLngDto.fromList(self.readValue() as! [Any?]) + case 135: + return LatLngDto.fromList(self.readValue() as! [Any?]) + case 136: + return MarkerAnchorDto.fromList(self.readValue() as! [Any?]) + case 137: + return MarkerDto.fromList(self.readValue() as! [Any?]) + case 138: + return MarkerOptionsDto.fromList(self.readValue() as! [Any?]) + case 139: + return PatternItemDto.fromList(self.readValue() as! [Any?]) + case 140: + return PolygonDto.fromList(self.readValue() as! [Any?]) + case 141: + return PolygonHoleDto.fromList(self.readValue() as! [Any?]) + case 142: + return PolygonOptionsDto.fromList(self.readValue() as! [Any?]) + case 143: + return PolylineDto.fromList(self.readValue() as! [Any?]) + case 144: + return PolylineOptionsDto.fromList(self.readValue() as! [Any?]) + case 145: + return StyleSpanDto.fromList(self.readValue() as! [Any?]) + case 146: + return StyleSpanStrokeStyleDto.fromList(self.readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } -private class NavigationViewApiCodecWriter: FlutterStandardWriter { +private class MapViewApiCodecWriter: FlutterStandardWriter { override func writeValue(_ value: Any) { if let value = value as? CameraPositionDto { super.writeByte(128) @@ -1892,22 +1840,22 @@ private class NavigationViewApiCodecWriter: FlutterStandardWriter { } } -private class NavigationViewApiCodecReaderWriter: FlutterStandardReaderWriter { +private class MapViewApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - NavigationViewApiCodecReader(data: data) + return MapViewApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - NavigationViewApiCodecWriter(data: data) + return MapViewApiCodecWriter(data: data) } } -class NavigationViewApiCodec: FlutterStandardMessageCodec { - static let shared = NavigationViewApiCodec(readerWriter: NavigationViewApiCodecReaderWriter()) +class MapViewApiCodec: FlutterStandardMessageCodec { + static let shared = MapViewApiCodec(readerWriter: MapViewApiCodecReaderWriter()) } /// Generated protocol from Pigeon that represents a handler of messages from Flutter. -protocol NavigationViewApi { +protocol MapViewApi { func awaitMapReady(viewId: Int64, completion: @escaping (Result) -> Void) func isMyLocationEnabled(viewId: Int64) throws -> Bool func setMyLocationEnabled(viewId: Int64, enabled: Bool) throws @@ -1934,22 +1882,13 @@ protocol NavigationViewApi { func getCameraPosition(viewId: Int64) throws -> CameraPositionDto func getVisibleRegion(viewId: Int64) throws -> LatLngBoundsDto func followMyLocation(viewId: Int64, perspective: CameraPerspectiveDto, zoomLevel: Double?) throws - func animateCameraToCameraPosition(viewId: Int64, cameraPosition: CameraPositionDto, - duration: Int64?, - completion: @escaping (Result) -> Void) - func animateCameraToLatLng(viewId: Int64, point: LatLngDto, duration: Int64?, - completion: @escaping (Result) -> Void) - func animateCameraToLatLngBounds(viewId: Int64, bounds: LatLngBoundsDto, padding: Double, - duration: Int64?, - completion: @escaping (Result) -> Void) - func animateCameraToLatLngZoom(viewId: Int64, point: LatLngDto, zoom: Double, duration: Int64?, - completion: @escaping (Result) -> Void) - func animateCameraByScroll(viewId: Int64, scrollByDx: Double, scrollByDy: Double, - duration: Int64?, completion: @escaping (Result) -> Void) - func animateCameraByZoom(viewId: Int64, zoomBy: Double, focusDx: Double?, focusDy: Double?, - duration: Int64?, completion: @escaping (Result) -> Void) - func animateCameraToZoom(viewId: Int64, zoom: Double, duration: Int64?, - completion: @escaping (Result) -> Void) + func animateCameraToCameraPosition(viewId: Int64, cameraPosition: CameraPositionDto, duration: Int64?, completion: @escaping (Result) -> Void) + func animateCameraToLatLng(viewId: Int64, point: LatLngDto, duration: Int64?, completion: @escaping (Result) -> Void) + func animateCameraToLatLngBounds(viewId: Int64, bounds: LatLngBoundsDto, padding: Double, duration: Int64?, completion: @escaping (Result) -> Void) + func animateCameraToLatLngZoom(viewId: Int64, point: LatLngDto, zoom: Double, duration: Int64?, completion: @escaping (Result) -> Void) + func animateCameraByScroll(viewId: Int64, scrollByDx: Double, scrollByDy: Double, duration: Int64?, completion: @escaping (Result) -> Void) + func animateCameraByZoom(viewId: Int64, zoomBy: Double, focusDx: Double?, focusDy: Double?, duration: Int64?, completion: @escaping (Result) -> Void) + func animateCameraToZoom(viewId: Int64, zoom: Double, duration: Int64?, completion: @escaping (Result) -> Void) func moveCameraToCameraPosition(viewId: Int64, cameraPosition: CameraPositionDto) throws func moveCameraToLatLng(viewId: Int64, point: LatLngDto) throws func moveCameraToLatLngBounds(viewId: Int64, bounds: LatLngBoundsDto, padding: Double) throws @@ -2010,38 +1949,30 @@ protocol NavigationViewApi { } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -enum NavigationViewApiSetup { - /// The codec used by NavigationViewApi. - static var codec: FlutterStandardMessageCodec { NavigationViewApiCodec.shared } - /// Sets up an instance of `NavigationViewApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: NavigationViewApi?) { - let awaitMapReadyChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.awaitMapReady", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { +class MapViewApiSetup { + /// The codec used by MapViewApi. + static var codec: FlutterStandardMessageCodec { MapViewApiCodec.shared } + /// Sets up an instance of `MapViewApi` to handle messages through the `binaryMessenger`. + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: MapViewApi?) { + let awaitMapReadyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { awaitMapReadyChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) api.awaitMapReady(viewId: viewIdArg) { result in switch result { - case .success: - reply(wrapResult(nil)) - case let .failure(error): - reply(wrapError(error)) + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) } } } } else { awaitMapReadyChannel.setMessageHandler(nil) } - let isMyLocationEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isMyLocationEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isMyLocationEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2055,12 +1986,8 @@ enum NavigationViewApiSetup { } else { isMyLocationEnabledChannel.setMessageHandler(nil) } - let setMyLocationEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setMyLocationEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setMyLocationEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2075,12 +2002,8 @@ enum NavigationViewApiSetup { } else { setMyLocationEnabledChannel.setMessageHandler(nil) } - let getMyLocationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMyLocation", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getMyLocationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getMyLocationChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2094,12 +2017,8 @@ enum NavigationViewApiSetup { } else { getMyLocationChannel.setMessageHandler(nil) } - let getMapTypeChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMapType", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getMapTypeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getMapTypeChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2113,12 +2032,8 @@ enum NavigationViewApiSetup { } else { getMapTypeChannel.setMessageHandler(nil) } - let setMapTypeChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapType", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setMapTypeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setMapTypeChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2133,12 +2048,8 @@ enum NavigationViewApiSetup { } else { setMapTypeChannel.setMessageHandler(nil) } - let setMapStyleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapStyle", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setMapStyleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setMapStyleChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2153,12 +2064,8 @@ enum NavigationViewApiSetup { } else { setMapStyleChannel.setMessageHandler(nil) } - let isNavigationTripProgressBarEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationTripProgressBarEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isNavigationTripProgressBarEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isNavigationTripProgressBarEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2172,12 +2079,8 @@ enum NavigationViewApiSetup { } else { isNavigationTripProgressBarEnabledChannel.setMessageHandler(nil) } - let setNavigationTripProgressBarEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationTripProgressBarEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setNavigationTripProgressBarEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setNavigationTripProgressBarEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2192,12 +2095,8 @@ enum NavigationViewApiSetup { } else { setNavigationTripProgressBarEnabledChannel.setMessageHandler(nil) } - let isNavigationHeaderEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationHeaderEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isNavigationHeaderEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isNavigationHeaderEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2211,12 +2110,8 @@ enum NavigationViewApiSetup { } else { isNavigationHeaderEnabledChannel.setMessageHandler(nil) } - let setNavigationHeaderEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationHeaderEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setNavigationHeaderEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setNavigationHeaderEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2231,12 +2126,8 @@ enum NavigationViewApiSetup { } else { setNavigationHeaderEnabledChannel.setMessageHandler(nil) } - let isNavigationFooterEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationFooterEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isNavigationFooterEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isNavigationFooterEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2250,12 +2141,8 @@ enum NavigationViewApiSetup { } else { isNavigationFooterEnabledChannel.setMessageHandler(nil) } - let setNavigationFooterEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationFooterEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setNavigationFooterEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setNavigationFooterEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2270,12 +2157,8 @@ enum NavigationViewApiSetup { } else { setNavigationFooterEnabledChannel.setMessageHandler(nil) } - let isRecenterButtonEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRecenterButtonEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isRecenterButtonEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isRecenterButtonEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2289,12 +2172,8 @@ enum NavigationViewApiSetup { } else { isRecenterButtonEnabledChannel.setMessageHandler(nil) } - let setRecenterButtonEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRecenterButtonEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setRecenterButtonEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setRecenterButtonEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2309,12 +2188,8 @@ enum NavigationViewApiSetup { } else { setRecenterButtonEnabledChannel.setMessageHandler(nil) } - let isSpeedLimitIconEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedLimitIconEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isSpeedLimitIconEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isSpeedLimitIconEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2328,12 +2203,8 @@ enum NavigationViewApiSetup { } else { isSpeedLimitIconEnabledChannel.setMessageHandler(nil) } - let setSpeedLimitIconEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedLimitIconEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setSpeedLimitIconEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setSpeedLimitIconEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2348,12 +2219,8 @@ enum NavigationViewApiSetup { } else { setSpeedLimitIconEnabledChannel.setMessageHandler(nil) } - let isSpeedometerEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedometerEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isSpeedometerEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isSpeedometerEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2367,12 +2234,8 @@ enum NavigationViewApiSetup { } else { isSpeedometerEnabledChannel.setMessageHandler(nil) } - let setSpeedometerEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedometerEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setSpeedometerEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setSpeedometerEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2387,12 +2250,8 @@ enum NavigationViewApiSetup { } else { setSpeedometerEnabledChannel.setMessageHandler(nil) } - let isTrafficIncidentCardsEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficIncidentCardsEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isTrafficIncidentCardsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isTrafficIncidentCardsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2406,12 +2265,8 @@ enum NavigationViewApiSetup { } else { isTrafficIncidentCardsEnabledChannel.setMessageHandler(nil) } - let setTrafficIncidentCardsEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficIncidentCardsEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setTrafficIncidentCardsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setTrafficIncidentCardsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2426,12 +2281,8 @@ enum NavigationViewApiSetup { } else { setTrafficIncidentCardsEnabledChannel.setMessageHandler(nil) } - let isNavigationUIEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationUIEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isNavigationUIEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isNavigationUIEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2445,12 +2296,8 @@ enum NavigationViewApiSetup { } else { isNavigationUIEnabledChannel.setMessageHandler(nil) } - let setNavigationUIEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationUIEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setNavigationUIEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setNavigationUIEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2465,12 +2312,8 @@ enum NavigationViewApiSetup { } else { setNavigationUIEnabledChannel.setMessageHandler(nil) } - let getCameraPositionChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCameraPosition", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getCameraPositionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getCameraPositionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2484,12 +2327,8 @@ enum NavigationViewApiSetup { } else { getCameraPositionChannel.setMessageHandler(nil) } - let getVisibleRegionChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getVisibleRegion", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getVisibleRegionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getVisibleRegionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2503,23 +2342,15 @@ enum NavigationViewApiSetup { } else { getVisibleRegionChannel.setMessageHandler(nil) } - let followMyLocationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.followMyLocation", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let followMyLocationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { followMyLocationChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let perspectiveArg = CameraPerspectiveDto(rawValue: args[1] as! Int)! let zoomLevelArg: Double? = nilOrValue(args[2]) do { - try api.followMyLocation( - viewId: viewIdArg, - perspective: perspectiveArg, - zoomLevel: zoomLevelArg - ) + try api.followMyLocation(viewId: viewIdArg, perspective: perspectiveArg, zoomLevel: zoomLevelArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2528,212 +2359,146 @@ enum NavigationViewApiSetup { } else { followMyLocationChannel.setMessageHandler(nil) } - let animateCameraToCameraPositionChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToCameraPosition", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let animateCameraToCameraPositionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { animateCameraToCameraPositionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let cameraPositionArg = args[1] as! CameraPositionDto - let durationArg: Int64? = isNullish(args[2]) ? nil : - (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) - api.animateCameraToCameraPosition( - viewId: viewIdArg, - cameraPosition: cameraPositionArg, - duration: durationArg - ) { result in + let durationArg: Int64? = isNullish(args[2]) ? nil : (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) + api.animateCameraToCameraPosition(viewId: viewIdArg, cameraPosition: cameraPositionArg, duration: durationArg) { result in switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) } } } } else { animateCameraToCameraPositionChannel.setMessageHandler(nil) } - let animateCameraToLatLngChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLng", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let animateCameraToLatLngChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { animateCameraToLatLngChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let pointArg = args[1] as! LatLngDto - let durationArg: Int64? = isNullish(args[2]) ? nil : - (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) - api - .animateCameraToLatLng(viewId: viewIdArg, point: pointArg, - duration: durationArg) { result in - switch result { - case let .success(res): + let durationArg: Int64? = isNullish(args[2]) ? nil : (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) + api.animateCameraToLatLng(viewId: viewIdArg, point: pointArg, duration: durationArg) { result in + switch result { + case .success(let res): reply(wrapResult(res)) - case let .failure(error): + case .failure(let error): reply(wrapError(error)) - } } + } } } else { animateCameraToLatLngChannel.setMessageHandler(nil) } - let animateCameraToLatLngBoundsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngBounds", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let animateCameraToLatLngBoundsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { animateCameraToLatLngBoundsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let boundsArg = args[1] as! LatLngBoundsDto let paddingArg = args[2] as! Double - let durationArg: Int64? = isNullish(args[3]) ? nil : - (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) - api.animateCameraToLatLngBounds( - viewId: viewIdArg, - bounds: boundsArg, - padding: paddingArg, - duration: durationArg - ) { result in + let durationArg: Int64? = isNullish(args[3]) ? nil : (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) + api.animateCameraToLatLngBounds(viewId: viewIdArg, bounds: boundsArg, padding: paddingArg, duration: durationArg) { result in switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) } } } } else { animateCameraToLatLngBoundsChannel.setMessageHandler(nil) } - let animateCameraToLatLngZoomChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngZoom", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let animateCameraToLatLngZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { animateCameraToLatLngZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let pointArg = args[1] as! LatLngDto let zoomArg = args[2] as! Double - let durationArg: Int64? = isNullish(args[3]) ? nil : - (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) - api.animateCameraToLatLngZoom( - viewId: viewIdArg, - point: pointArg, - zoom: zoomArg, - duration: durationArg - ) { result in + let durationArg: Int64? = isNullish(args[3]) ? nil : (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) + api.animateCameraToLatLngZoom(viewId: viewIdArg, point: pointArg, zoom: zoomArg, duration: durationArg) { result in switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) } } } } else { animateCameraToLatLngZoomChannel.setMessageHandler(nil) } - let animateCameraByScrollChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByScroll", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let animateCameraByScrollChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { animateCameraByScrollChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let scrollByDxArg = args[1] as! Double let scrollByDyArg = args[2] as! Double - let durationArg: Int64? = isNullish(args[3]) ? nil : - (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) - api.animateCameraByScroll( - viewId: viewIdArg, - scrollByDx: scrollByDxArg, - scrollByDy: scrollByDyArg, - duration: durationArg - ) { result in + let durationArg: Int64? = isNullish(args[3]) ? nil : (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) + api.animateCameraByScroll(viewId: viewIdArg, scrollByDx: scrollByDxArg, scrollByDy: scrollByDyArg, duration: durationArg) { result in switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) } } } } else { animateCameraByScrollChannel.setMessageHandler(nil) } - let animateCameraByZoomChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByZoom", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let animateCameraByZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { animateCameraByZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let zoomByArg = args[1] as! Double let focusDxArg: Double? = nilOrValue(args[2]) let focusDyArg: Double? = nilOrValue(args[3]) - let durationArg: Int64? = isNullish(args[4]) ? nil : - (args[4] is Int64? ? args[4] as! Int64? : Int64(args[4] as! Int32)) - api.animateCameraByZoom( - viewId: viewIdArg, - zoomBy: zoomByArg, - focusDx: focusDxArg, - focusDy: focusDyArg, - duration: durationArg - ) { result in + let durationArg: Int64? = isNullish(args[4]) ? nil : (args[4] is Int64? ? args[4] as! Int64? : Int64(args[4] as! Int32)) + api.animateCameraByZoom(viewId: viewIdArg, zoomBy: zoomByArg, focusDx: focusDxArg, focusDy: focusDyArg, duration: durationArg) { result in switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) } } } } else { animateCameraByZoomChannel.setMessageHandler(nil) } - let animateCameraToZoomChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToZoom", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let animateCameraToZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { animateCameraToZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let zoomArg = args[1] as! Double - let durationArg: Int64? = isNullish(args[2]) ? nil : - (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) + let durationArg: Int64? = isNullish(args[2]) ? nil : (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) api.animateCameraToZoom(viewId: viewIdArg, zoom: zoomArg, duration: durationArg) { result in switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) } } } } else { animateCameraToZoomChannel.setMessageHandler(nil) } - let moveCameraToCameraPositionChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToCameraPosition", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let moveCameraToCameraPositionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { moveCameraToCameraPositionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2748,12 +2513,8 @@ enum NavigationViewApiSetup { } else { moveCameraToCameraPositionChannel.setMessageHandler(nil) } - let moveCameraToLatLngChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLng", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let moveCameraToLatLngChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { moveCameraToLatLngChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2768,23 +2529,15 @@ enum NavigationViewApiSetup { } else { moveCameraToLatLngChannel.setMessageHandler(nil) } - let moveCameraToLatLngBoundsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngBounds", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let moveCameraToLatLngBoundsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { moveCameraToLatLngBoundsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let boundsArg = args[1] as! LatLngBoundsDto let paddingArg = args[2] as! Double do { - try api.moveCameraToLatLngBounds( - viewId: viewIdArg, - bounds: boundsArg, - padding: paddingArg - ) + try api.moveCameraToLatLngBounds(viewId: viewIdArg, bounds: boundsArg, padding: paddingArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2793,12 +2546,8 @@ enum NavigationViewApiSetup { } else { moveCameraToLatLngBoundsChannel.setMessageHandler(nil) } - let moveCameraToLatLngZoomChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngZoom", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let moveCameraToLatLngZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { moveCameraToLatLngZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2814,23 +2563,15 @@ enum NavigationViewApiSetup { } else { moveCameraToLatLngZoomChannel.setMessageHandler(nil) } - let moveCameraByScrollChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByScroll", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let moveCameraByScrollChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { moveCameraByScrollChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let scrollByDxArg = args[1] as! Double let scrollByDyArg = args[2] as! Double do { - try api.moveCameraByScroll( - viewId: viewIdArg, - scrollByDx: scrollByDxArg, - scrollByDy: scrollByDyArg - ) + try api.moveCameraByScroll(viewId: viewIdArg, scrollByDx: scrollByDxArg, scrollByDy: scrollByDyArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2839,12 +2580,8 @@ enum NavigationViewApiSetup { } else { moveCameraByScrollChannel.setMessageHandler(nil) } - let moveCameraByZoomChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByZoom", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let moveCameraByZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { moveCameraByZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2852,12 +2589,7 @@ enum NavigationViewApiSetup { let focusDxArg: Double? = nilOrValue(args[2]) let focusDyArg: Double? = nilOrValue(args[3]) do { - try api.moveCameraByZoom( - viewId: viewIdArg, - zoomBy: zoomByArg, - focusDx: focusDxArg, - focusDy: focusDyArg - ) + try api.moveCameraByZoom(viewId: viewIdArg, zoomBy: zoomByArg, focusDx: focusDxArg, focusDy: focusDyArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2866,12 +2598,8 @@ enum NavigationViewApiSetup { } else { moveCameraByZoomChannel.setMessageHandler(nil) } - let moveCameraToZoomChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToZoom", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let moveCameraToZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { moveCameraToZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2886,12 +2614,8 @@ enum NavigationViewApiSetup { } else { moveCameraToZoomChannel.setMessageHandler(nil) } - let showRouteOverviewChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.showRouteOverview", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let showRouteOverviewChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { showRouteOverviewChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2905,12 +2629,8 @@ enum NavigationViewApiSetup { } else { showRouteOverviewChannel.setMessageHandler(nil) } - let getMinZoomPreferenceChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMinZoomPreference", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getMinZoomPreferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getMinZoomPreferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2924,12 +2644,8 @@ enum NavigationViewApiSetup { } else { getMinZoomPreferenceChannel.setMessageHandler(nil) } - let getMaxZoomPreferenceChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMaxZoomPreference", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getMaxZoomPreferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getMaxZoomPreferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2943,12 +2659,8 @@ enum NavigationViewApiSetup { } else { getMaxZoomPreferenceChannel.setMessageHandler(nil) } - let resetMinMaxZoomPreferenceChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.resetMinMaxZoomPreference", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let resetMinMaxZoomPreferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { resetMinMaxZoomPreferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2962,12 +2674,8 @@ enum NavigationViewApiSetup { } else { resetMinMaxZoomPreferenceChannel.setMessageHandler(nil) } - let setMinZoomPreferenceChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMinZoomPreference", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setMinZoomPreferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setMinZoomPreferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2982,12 +2690,8 @@ enum NavigationViewApiSetup { } else { setMinZoomPreferenceChannel.setMessageHandler(nil) } - let setMaxZoomPreferenceChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMaxZoomPreference", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setMaxZoomPreferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setMaxZoomPreferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3002,12 +2706,8 @@ enum NavigationViewApiSetup { } else { setMaxZoomPreferenceChannel.setMessageHandler(nil) } - let setMyLocationButtonEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationButtonEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setMyLocationButtonEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setMyLocationButtonEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3022,21 +2722,14 @@ enum NavigationViewApiSetup { } else { setMyLocationButtonEnabledChannel.setMessageHandler(nil) } - let setConsumeMyLocationButtonClickEventsEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setConsumeMyLocationButtonClickEventsEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setConsumeMyLocationButtonClickEventsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setConsumeMyLocationButtonClickEventsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let enabledArg = args[1] as! Bool do { - try api.setConsumeMyLocationButtonClickEventsEnabled( - viewId: viewIdArg, - enabled: enabledArg - ) + try api.setConsumeMyLocationButtonClickEventsEnabled(viewId: viewIdArg, enabled: enabledArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3045,12 +2738,8 @@ enum NavigationViewApiSetup { } else { setConsumeMyLocationButtonClickEventsEnabledChannel.setMessageHandler(nil) } - let setZoomGesturesEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomGesturesEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setZoomGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setZoomGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3065,12 +2754,8 @@ enum NavigationViewApiSetup { } else { setZoomGesturesEnabledChannel.setMessageHandler(nil) } - let setZoomControlsEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomControlsEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setZoomControlsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setZoomControlsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3085,12 +2770,8 @@ enum NavigationViewApiSetup { } else { setZoomControlsEnabledChannel.setMessageHandler(nil) } - let setCompassEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setCompassEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setCompassEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setCompassEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3105,12 +2786,8 @@ enum NavigationViewApiSetup { } else { setCompassEnabledChannel.setMessageHandler(nil) } - let setRotateGesturesEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRotateGesturesEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setRotateGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setRotateGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3125,12 +2802,8 @@ enum NavigationViewApiSetup { } else { setRotateGesturesEnabledChannel.setMessageHandler(nil) } - let setScrollGesturesEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setScrollGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setScrollGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3145,12 +2818,8 @@ enum NavigationViewApiSetup { } else { setScrollGesturesEnabledChannel.setMessageHandler(nil) } - let setScrollGesturesDuringRotateOrZoomEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesDuringRotateOrZoomEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setScrollGesturesDuringRotateOrZoomEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setScrollGesturesDuringRotateOrZoomEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3165,12 +2834,8 @@ enum NavigationViewApiSetup { } else { setScrollGesturesDuringRotateOrZoomEnabledChannel.setMessageHandler(nil) } - let setTiltGesturesEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTiltGesturesEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setTiltGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setTiltGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3185,12 +2850,8 @@ enum NavigationViewApiSetup { } else { setTiltGesturesEnabledChannel.setMessageHandler(nil) } - let setMapToolbarEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapToolbarEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setMapToolbarEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setMapToolbarEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3205,12 +2866,8 @@ enum NavigationViewApiSetup { } else { setMapToolbarEnabledChannel.setMessageHandler(nil) } - let setTrafficEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setTrafficEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setTrafficEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3225,12 +2882,8 @@ enum NavigationViewApiSetup { } else { setTrafficEnabledChannel.setMessageHandler(nil) } - let isMyLocationButtonEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationButtonEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isMyLocationButtonEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isMyLocationButtonEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3244,12 +2897,8 @@ enum NavigationViewApiSetup { } else { isMyLocationButtonEnabledChannel.setMessageHandler(nil) } - let isConsumeMyLocationButtonClickEventsEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isConsumeMyLocationButtonClickEventsEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isConsumeMyLocationButtonClickEventsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isConsumeMyLocationButtonClickEventsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3263,12 +2912,8 @@ enum NavigationViewApiSetup { } else { isConsumeMyLocationButtonClickEventsEnabledChannel.setMessageHandler(nil) } - let isZoomGesturesEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomGesturesEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isZoomGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isZoomGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3282,12 +2927,8 @@ enum NavigationViewApiSetup { } else { isZoomGesturesEnabledChannel.setMessageHandler(nil) } - let isZoomControlsEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomControlsEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isZoomControlsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isZoomControlsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3301,12 +2942,8 @@ enum NavigationViewApiSetup { } else { isZoomControlsEnabledChannel.setMessageHandler(nil) } - let isCompassEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isCompassEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isCompassEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isCompassEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3320,12 +2957,8 @@ enum NavigationViewApiSetup { } else { isCompassEnabledChannel.setMessageHandler(nil) } - let isRotateGesturesEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRotateGesturesEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isRotateGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isRotateGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3339,12 +2972,8 @@ enum NavigationViewApiSetup { } else { isRotateGesturesEnabledChannel.setMessageHandler(nil) } - let isScrollGesturesEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isScrollGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isScrollGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3358,12 +2987,8 @@ enum NavigationViewApiSetup { } else { isScrollGesturesEnabledChannel.setMessageHandler(nil) } - let isScrollGesturesEnabledDuringRotateOrZoomChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabledDuringRotateOrZoom", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isScrollGesturesEnabledDuringRotateOrZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isScrollGesturesEnabledDuringRotateOrZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3377,12 +3002,8 @@ enum NavigationViewApiSetup { } else { isScrollGesturesEnabledDuringRotateOrZoomChannel.setMessageHandler(nil) } - let isTiltGesturesEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTiltGesturesEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isTiltGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isTiltGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3396,12 +3017,8 @@ enum NavigationViewApiSetup { } else { isTiltGesturesEnabledChannel.setMessageHandler(nil) } - let isMapToolbarEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMapToolbarEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isMapToolbarEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isMapToolbarEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3415,12 +3032,8 @@ enum NavigationViewApiSetup { } else { isMapToolbarEnabledChannel.setMessageHandler(nil) } - let isTrafficEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficEnabled", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isTrafficEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isTrafficEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3434,12 +3047,8 @@ enum NavigationViewApiSetup { } else { isTrafficEnabledChannel.setMessageHandler(nil) } - let getMarkersChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMarkers", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getMarkersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getMarkersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3453,12 +3062,8 @@ enum NavigationViewApiSetup { } else { getMarkersChannel.setMessageHandler(nil) } - let addMarkersChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addMarkers", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let addMarkersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { addMarkersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3473,12 +3078,8 @@ enum NavigationViewApiSetup { } else { addMarkersChannel.setMessageHandler(nil) } - let updateMarkersChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateMarkers", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let updateMarkersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { updateMarkersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3493,12 +3094,8 @@ enum NavigationViewApiSetup { } else { updateMarkersChannel.setMessageHandler(nil) } - let removeMarkersChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeMarkers", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let removeMarkersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { removeMarkersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3513,12 +3110,8 @@ enum NavigationViewApiSetup { } else { removeMarkersChannel.setMessageHandler(nil) } - let clearMarkersChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearMarkers", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let clearMarkersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { clearMarkersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3532,12 +3125,8 @@ enum NavigationViewApiSetup { } else { clearMarkersChannel.setMessageHandler(nil) } - let clearChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clear", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let clearChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { clearChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3551,12 +3140,8 @@ enum NavigationViewApiSetup { } else { clearChannel.setMessageHandler(nil) } - let getPolygonsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolygons", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getPolygonsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getPolygonsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3570,12 +3155,8 @@ enum NavigationViewApiSetup { } else { getPolygonsChannel.setMessageHandler(nil) } - let addPolygonsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolygons", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let addPolygonsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { addPolygonsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3590,12 +3171,8 @@ enum NavigationViewApiSetup { } else { addPolygonsChannel.setMessageHandler(nil) } - let updatePolygonsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolygons", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let updatePolygonsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { updatePolygonsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3610,12 +3187,8 @@ enum NavigationViewApiSetup { } else { updatePolygonsChannel.setMessageHandler(nil) } - let removePolygonsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolygons", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let removePolygonsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { removePolygonsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3630,12 +3203,8 @@ enum NavigationViewApiSetup { } else { removePolygonsChannel.setMessageHandler(nil) } - let clearPolygonsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolygons", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let clearPolygonsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { clearPolygonsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3649,12 +3218,8 @@ enum NavigationViewApiSetup { } else { clearPolygonsChannel.setMessageHandler(nil) } - let getPolylinesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolylines", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getPolylinesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getPolylinesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3668,12 +3233,8 @@ enum NavigationViewApiSetup { } else { getPolylinesChannel.setMessageHandler(nil) } - let addPolylinesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolylines", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let addPolylinesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { addPolylinesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3688,12 +3249,8 @@ enum NavigationViewApiSetup { } else { addPolylinesChannel.setMessageHandler(nil) } - let updatePolylinesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolylines", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let updatePolylinesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { updatePolylinesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3708,12 +3265,8 @@ enum NavigationViewApiSetup { } else { updatePolylinesChannel.setMessageHandler(nil) } - let removePolylinesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolylines", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let removePolylinesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { removePolylinesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3728,12 +3281,8 @@ enum NavigationViewApiSetup { } else { removePolylinesChannel.setMessageHandler(nil) } - let clearPolylinesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolylines", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let clearPolylinesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { clearPolylinesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3747,12 +3296,8 @@ enum NavigationViewApiSetup { } else { clearPolylinesChannel.setMessageHandler(nil) } - let getCirclesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCircles", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getCirclesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getCirclesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3766,12 +3311,8 @@ enum NavigationViewApiSetup { } else { getCirclesChannel.setMessageHandler(nil) } - let addCirclesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addCircles", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let addCirclesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { addCirclesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3786,12 +3327,8 @@ enum NavigationViewApiSetup { } else { addCirclesChannel.setMessageHandler(nil) } - let updateCirclesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateCircles", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let updateCirclesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { updateCirclesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3806,12 +3343,8 @@ enum NavigationViewApiSetup { } else { updateCirclesChannel.setMessageHandler(nil) } - let removeCirclesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeCircles", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let removeCirclesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { removeCirclesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3826,12 +3359,8 @@ enum NavigationViewApiSetup { } else { removeCirclesChannel.setMessageHandler(nil) } - let clearCirclesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearCircles", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let clearCirclesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { clearCirclesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3845,12 +3374,8 @@ enum NavigationViewApiSetup { } else { clearCirclesChannel.setMessageHandler(nil) } - let registerOnCameraChangedListenerChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.registerOnCameraChangedListener", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let registerOnCameraChangedListenerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { registerOnCameraChangedListenerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3866,16 +3391,15 @@ enum NavigationViewApiSetup { } } } - private class ImageRegistryApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return ImageDescriptorDto.fromList(readValue() as! [Any?]) - case 129: - return ImageDescriptorDto.fromList(readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return ImageDescriptorDto.fromList(self.readValue() as! [Any?]) + case 129: + return ImageDescriptorDto.fromList(self.readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } @@ -3896,11 +3420,11 @@ private class ImageRegistryApiCodecWriter: FlutterStandardWriter { private class ImageRegistryApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - ImageRegistryApiCodecReader(data: data) + return ImageRegistryApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - ImageRegistryApiCodecWriter(data: data) + return ImageRegistryApiCodecWriter(data: data) } } @@ -3910,26 +3434,20 @@ class ImageRegistryApiCodec: FlutterStandardMessageCodec { /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol ImageRegistryApi { - func registerBitmapImage(imageId: String, bytes: FlutterStandardTypedData, - imagePixelRatio: Double, width: Double?, - height: Double?) throws -> ImageDescriptorDto + func registerBitmapImage(imageId: String, bytes: FlutterStandardTypedData, imagePixelRatio: Double, width: Double?, height: Double?) throws -> ImageDescriptorDto func unregisterImage(imageDescriptor: ImageDescriptorDto) throws func getRegisteredImages() throws -> [ImageDescriptorDto] func clearRegisteredImages() throws } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -enum ImageRegistryApiSetup { +class ImageRegistryApiSetup { /// The codec used by ImageRegistryApi. static var codec: FlutterStandardMessageCodec { ImageRegistryApiCodec.shared } /// Sets up an instance of `ImageRegistryApi` to handle messages through the `binaryMessenger`. static func setUp(binaryMessenger: FlutterBinaryMessenger, api: ImageRegistryApi?) { - let registerBitmapImageChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let registerBitmapImageChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { registerBitmapImageChannel.setMessageHandler { message, reply in let args = message as! [Any?] let imageIdArg = args[0] as! String @@ -3938,13 +3456,7 @@ enum ImageRegistryApiSetup { let widthArg: Double? = nilOrValue(args[3]) let heightArg: Double? = nilOrValue(args[4]) do { - let result = try api.registerBitmapImage( - imageId: imageIdArg, - bytes: bytesArg, - imagePixelRatio: imagePixelRatioArg, - width: widthArg, - height: heightArg - ) + let result = try api.registerBitmapImage(imageId: imageIdArg, bytes: bytesArg, imagePixelRatio: imagePixelRatioArg, width: widthArg, height: heightArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3953,12 +3465,8 @@ enum ImageRegistryApiSetup { } else { registerBitmapImageChannel.setMessageHandler(nil) } - let unregisterImageChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let unregisterImageChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { unregisterImageChannel.setMessageHandler { message, reply in let args = message as! [Any?] let imageDescriptorArg = args[0] as! ImageDescriptorDto @@ -3972,12 +3480,8 @@ enum ImageRegistryApiSetup { } else { unregisterImageChannel.setMessageHandler(nil) } - let getRegisteredImagesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getRegisteredImagesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getRegisteredImagesChannel.setMessageHandler { _, reply in do { let result = try api.getRegisteredImages() @@ -3989,12 +3493,8 @@ enum ImageRegistryApiSetup { } else { getRegisteredImagesChannel.setMessageHandler(nil) } - let clearRegisteredImagesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let clearRegisteredImagesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { clearRegisteredImagesChannel.setMessageHandler { _, reply in do { try api.clearRegisteredImages() @@ -4008,21 +3508,20 @@ enum ImageRegistryApiSetup { } } } - -private class NavigationViewEventApiCodecReader: FlutterStandardReader { +private class ViewEventApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return CameraPositionDto.fromList(readValue() as! [Any?]) - case 129: - return LatLngDto.fromList(readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return CameraPositionDto.fromList(self.readValue() as! [Any?]) + case 129: + return LatLngDto.fromList(self.readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } -private class NavigationViewEventApiCodecWriter: FlutterStandardWriter { +private class ViewEventApiCodecWriter: FlutterStandardWriter { override func writeValue(_ value: Any) { if let value = value as? CameraPositionDto { super.writeByte(128) @@ -4036,409 +3535,297 @@ private class NavigationViewEventApiCodecWriter: FlutterStandardWriter { } } -private class NavigationViewEventApiCodecReaderWriter: FlutterStandardReaderWriter { +private class ViewEventApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - NavigationViewEventApiCodecReader(data: data) + return ViewEventApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - NavigationViewEventApiCodecWriter(data: data) + return ViewEventApiCodecWriter(data: data) } } -class NavigationViewEventApiCodec: FlutterStandardMessageCodec { - static let shared = - NavigationViewEventApiCodec(readerWriter: NavigationViewEventApiCodecReaderWriter()) +class ViewEventApiCodec: FlutterStandardMessageCodec { + static let shared = ViewEventApiCodec(readerWriter: ViewEventApiCodecReaderWriter()) } /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. -protocol NavigationViewEventApiProtocol { - func onMapClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, - completion: @escaping (Result) -> Void) - func onMapLongClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, - completion: @escaping (Result) -> Void) - func onRecenterButtonClicked(viewId viewIdArg: Int64, - completion: @escaping (Result) -> Void) - func onMarkerEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, - eventType eventTypeArg: MarkerEventTypeDto, - completion: @escaping (Result) -> Void) - func onMarkerDragEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, - eventType eventTypeArg: MarkerDragEventTypeDto, - position positionArg: LatLngDto, - completion: @escaping (Result) -> Void) - func onPolygonClicked(viewId viewIdArg: Int64, polygonId polygonIdArg: String, - completion: @escaping (Result) -> Void) - func onPolylineClicked(viewId viewIdArg: Int64, polylineId polylineIdArg: String, - completion: @escaping (Result) -> Void) - func onCircleClicked(viewId viewIdArg: Int64, circleId circleIdArg: String, - completion: @escaping (Result) -> Void) - func onNavigationUIEnabledChanged(viewId viewIdArg: Int64, - navigationUIEnabled navigationUIEnabledArg: Bool, - completion: @escaping (Result) -> Void) - func onMyLocationClicked(viewId viewIdArg: Int64, - completion: @escaping (Result) -> Void) - func onMyLocationButtonClicked(viewId viewIdArg: Int64, - completion: @escaping (Result) -> Void) - func onCameraChanged(viewId viewIdArg: Int64, eventType eventTypeArg: CameraEventTypeDto, - position positionArg: CameraPositionDto, - completion: @escaping (Result) -> Void) +protocol ViewEventApiProtocol { + func onMapClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, completion: @escaping (Result) -> Void) + func onMapLongClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, completion: @escaping (Result) -> Void) + func onRecenterButtonClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) + func onMarkerEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, eventType eventTypeArg: MarkerEventTypeDto, completion: @escaping (Result) -> Void) + func onMarkerDragEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, eventType eventTypeArg: MarkerDragEventTypeDto, position positionArg: LatLngDto, completion: @escaping (Result) -> Void) + func onPolygonClicked(viewId viewIdArg: Int64, polygonId polygonIdArg: String, completion: @escaping (Result) -> Void) + func onPolylineClicked(viewId viewIdArg: Int64, polylineId polylineIdArg: String, completion: @escaping (Result) -> Void) + func onCircleClicked(viewId viewIdArg: Int64, circleId circleIdArg: String, completion: @escaping (Result) -> Void) + func onNavigationUIEnabledChanged(viewId viewIdArg: Int64, navigationUIEnabled navigationUIEnabledArg: Bool, completion: @escaping (Result) -> Void) + func onMyLocationClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) + func onMyLocationButtonClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) + func onCameraChanged(viewId viewIdArg: Int64, eventType eventTypeArg: CameraEventTypeDto, position positionArg: CameraPositionDto, completion: @escaping (Result) -> Void) } - -class NavigationViewEventApi: NavigationViewEventApiProtocol { +class ViewEventApi: ViewEventApiProtocol { private let binaryMessenger: FlutterBinaryMessenger - init(binaryMessenger: FlutterBinaryMessenger) { + init(binaryMessenger: FlutterBinaryMessenger){ self.binaryMessenger = binaryMessenger } - var codec: FlutterStandardMessageCodec { - NavigationViewEventApiCodec.shared + return ViewEventApiCodec.shared } - - func onMapClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapClickEvent" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onMapClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg, latLngArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onMapLongClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapLongClickEvent" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onMapLongClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg, latLngArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onRecenterButtonClicked(viewId viewIdArg: Int64, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onRecenterButtonClicked" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onRecenterButtonClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onMarkerEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, - eventType eventTypeArg: MarkerEventTypeDto, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerEvent" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onMarkerEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, eventType eventTypeArg: MarkerEventTypeDto, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg, markerIdArg, eventTypeArg.rawValue] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onMarkerDragEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, - eventType eventTypeArg: MarkerDragEventTypeDto, - position positionArg: LatLngDto, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerDragEvent" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) - channel - .sendMessage([viewIdArg, markerIdArg, eventTypeArg.rawValue, - positionArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - - func onPolygonClicked(viewId viewIdArg: Int64, polygonId polygonIdArg: String, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolygonClicked" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onMarkerDragEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, eventType eventTypeArg: MarkerDragEventTypeDto, position positionArg: LatLngDto, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([viewIdArg, markerIdArg, eventTypeArg.rawValue, positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName:channelName))) + return + } + if (listResponse.count > 1) { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(FlutterError(code: code, message: message, details: details))); + } else { + completion(.success(Void())) + } + } + } + func onPolygonClicked(viewId viewIdArg: Int64, polygonId polygonIdArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg, polygonIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onPolylineClicked(viewId viewIdArg: Int64, polylineId polylineIdArg: String, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolylineClicked" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onPolylineClicked(viewId viewIdArg: Int64, polylineId polylineIdArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg, polylineIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onCircleClicked(viewId viewIdArg: Int64, circleId circleIdArg: String, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCircleClicked" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onCircleClicked(viewId viewIdArg: Int64, circleId circleIdArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg, circleIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onNavigationUIEnabledChanged(viewId viewIdArg: Int64, - navigationUIEnabled navigationUIEnabledArg: Bool, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onNavigationUIEnabledChanged" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onNavigationUIEnabledChanged(viewId viewIdArg: Int64, navigationUIEnabled navigationUIEnabledArg: Bool, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg, navigationUIEnabledArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onMyLocationClicked(viewId viewIdArg: Int64, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMyLocationClicked" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onMyLocationClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onMyLocationButtonClicked(viewId viewIdArg: Int64, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMyLocationButtonClicked" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onMyLocationButtonClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onCameraChanged(viewId viewIdArg: Int64, eventType eventTypeArg: CameraEventTypeDto, - position positionArg: CameraPositionDto, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCameraChanged" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onCameraChanged(viewId viewIdArg: Int64, eventType eventTypeArg: CameraEventTypeDto, position positionArg: CameraPositionDto, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([viewIdArg, eventTypeArg.rawValue, positionArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } } - private class NavigationSessionApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return DestinationsDto.fromList(readValue() as! [Any?]) - case 129: - return LatLngDto.fromList(readValue() as! [Any?]) - case 130: - return LatLngDto.fromList(readValue() as! [Any?]) - case 131: - return NavigationAudioGuidanceSettingsDto.fromList(readValue() as! [Any?]) - case 132: - return NavigationDisplayOptionsDto.fromList(readValue() as! [Any?]) - case 133: - return NavigationTimeAndDistanceDto.fromList(readValue() as! [Any?]) - case 134: - return NavigationWaypointDto.fromList(readValue() as! [Any?]) - case 135: - return NavigationWaypointDto.fromList(readValue() as! [Any?]) - case 136: - return RouteSegmentDto.fromList(readValue() as! [Any?]) - case 137: - return RouteSegmentDto.fromList(readValue() as! [Any?]) - case 138: - return RouteSegmentTrafficDataDto.fromList(readValue() as! [Any?]) - case 139: - return RouteSegmentTrafficDataRoadStretchRenderingDataDto.fromList(readValue() as! [Any?]) - case 140: - return RouteTokenOptionsDto.fromList(readValue() as! [Any?]) - case 141: - return RoutingOptionsDto.fromList(readValue() as! [Any?]) - case 142: - return SimulationOptionsDto.fromList(readValue() as! [Any?]) - case 143: - return SpeedAlertOptionsDto.fromList(readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return DestinationsDto.fromList(self.readValue() as! [Any?]) + case 129: + return LatLngDto.fromList(self.readValue() as! [Any?]) + case 130: + return LatLngDto.fromList(self.readValue() as! [Any?]) + case 131: + return NavigationAudioGuidanceSettingsDto.fromList(self.readValue() as! [Any?]) + case 132: + return NavigationDisplayOptionsDto.fromList(self.readValue() as! [Any?]) + case 133: + return NavigationTimeAndDistanceDto.fromList(self.readValue() as! [Any?]) + case 134: + return NavigationWaypointDto.fromList(self.readValue() as! [Any?]) + case 135: + return NavigationWaypointDto.fromList(self.readValue() as! [Any?]) + case 136: + return RouteSegmentDto.fromList(self.readValue() as! [Any?]) + case 137: + return RouteSegmentDto.fromList(self.readValue() as! [Any?]) + case 138: + return RouteSegmentTrafficDataDto.fromList(self.readValue() as! [Any?]) + case 139: + return RouteSegmentTrafficDataRoadStretchRenderingDataDto.fromList(self.readValue() as! [Any?]) + case 140: + return RouteTokenOptionsDto.fromList(self.readValue() as! [Any?]) + case 141: + return RoutingOptionsDto.fromList(self.readValue() as! [Any?]) + case 142: + return SimulationOptionsDto.fromList(self.readValue() as! [Any?]) + case 143: + return SpeedAlertOptionsDto.fromList(self.readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } @@ -4501,29 +3888,25 @@ private class NavigationSessionApiCodecWriter: FlutterStandardWriter { private class NavigationSessionApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - NavigationSessionApiCodecReader(data: data) + return NavigationSessionApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - NavigationSessionApiCodecWriter(data: data) + return NavigationSessionApiCodecWriter(data: data) } } class NavigationSessionApiCodec: FlutterStandardMessageCodec { - static let shared = - NavigationSessionApiCodec(readerWriter: NavigationSessionApiCodecReaderWriter()) + static let shared = NavigationSessionApiCodec(readerWriter: NavigationSessionApiCodecReaderWriter()) } /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol NavigationSessionApi { /// General. - func createNavigationSession(abnormalTerminationReportingEnabled: Bool, - completion: @escaping (Result) -> Void) + func createNavigationSession(abnormalTerminationReportingEnabled: Bool, completion: @escaping (Result) -> Void) func isInitialized() throws -> Bool func cleanup() throws - func showTermsAndConditionsDialog(title: String, companyName: String, - shouldOnlyShowDriverAwarenessDisclaimer: Bool, - completion: @escaping (Result) -> Void) + func showTermsAndConditionsDialog(title: String, companyName: String, shouldOnlyShowDriverAwarenessDisclaimer: Bool, completion: @escaping (Result) -> Void) func areTermsAccepted() throws -> Bool func resetTermsAccepted() throws func getNavSDKVersion() throws -> String @@ -4531,8 +3914,7 @@ protocol NavigationSessionApi { func isGuidanceRunning() throws -> Bool func startGuidance() throws func stopGuidance() throws - func setDestinations(destinations: DestinationsDto, - completion: @escaping (Result) -> Void) + func setDestinations(destinations: DestinationsDto, completion: @escaping (Result) -> Void) func clearDestinations() throws func continueToNextDestination() throws -> NavigationWaypointDto? func getCurrentTimeAndDistance() throws -> NavigationTimeAndDistanceDto @@ -4546,23 +3928,9 @@ protocol NavigationSessionApi { func removeUserLocation() throws func simulateLocationsAlongExistingRoute() throws func simulateLocationsAlongExistingRouteWithOptions(options: SimulationOptionsDto) throws - func simulateLocationsAlongNewRoute(waypoints: [NavigationWaypointDto], - completion: @escaping (Result) -> Void) - func simulateLocationsAlongNewRouteWithRoutingOptions(waypoints: [NavigationWaypointDto], - routingOptions: RoutingOptionsDto, - completion: @escaping (Result< - RouteStatusDto, - Error - >) -> Void) - func simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(waypoints: [ - NavigationWaypointDto - ], - routingOptions: RoutingOptionsDto, - simulationOptions: SimulationOptionsDto, - completion: @escaping (Result< - RouteStatusDto, - Error - >) -> Void) + func simulateLocationsAlongNewRoute(waypoints: [NavigationWaypointDto], completion: @escaping (Result) -> Void) + func simulateLocationsAlongNewRouteWithRoutingOptions(waypoints: [NavigationWaypointDto], routingOptions: RoutingOptionsDto, completion: @escaping (Result) -> Void) + func simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(waypoints: [NavigationWaypointDto], routingOptions: RoutingOptionsDto, simulationOptions: SimulationOptionsDto, completion: @escaping (Result) -> Void) func pauseSimulation() throws func resumeSimulation() throws /// Simulation (iOS only) @@ -4573,48 +3941,35 @@ protocol NavigationSessionApi { /// Enable Turn-by-Turn navigation events. func enableTurnByTurnNavigationEvents(numNextStepsToPreview: Int64?) throws func disableTurnByTurnNavigationEvents() throws - func registerRemainingTimeOrDistanceChangedListener(remainingTimeThresholdSeconds: Int64, - remainingDistanceThresholdMeters: Int64) throws + func registerRemainingTimeOrDistanceChangedListener(remainingTimeThresholdSeconds: Int64, remainingDistanceThresholdMeters: Int64) throws } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -enum NavigationSessionApiSetup { +class NavigationSessionApiSetup { /// The codec used by NavigationSessionApi. static var codec: FlutterStandardMessageCodec { NavigationSessionApiCodec.shared } - /// Sets up an instance of `NavigationSessionApi` to handle messages through the - /// `binaryMessenger`. + /// Sets up an instance of `NavigationSessionApi` to handle messages through the `binaryMessenger`. static func setUp(binaryMessenger: FlutterBinaryMessenger, api: NavigationSessionApi?) { /// General. - let createNavigationSessionChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let createNavigationSessionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { createNavigationSessionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let abnormalTerminationReportingEnabledArg = args[0] as! Bool - api - .createNavigationSession( - abnormalTerminationReportingEnabled: abnormalTerminationReportingEnabledArg - ) { result in - switch result { + api.createNavigationSession(abnormalTerminationReportingEnabled: abnormalTerminationReportingEnabledArg) { result in + switch result { case .success: reply(wrapResult(nil)) - case let .failure(error): + case .failure(let error): reply(wrapError(error)) - } } + } } } else { createNavigationSessionChannel.setMessageHandler(nil) } - let isInitializedChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isInitializedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isInitializedChannel.setMessageHandler { _, reply in do { let result = try api.isInitialized() @@ -4626,12 +3981,8 @@ enum NavigationSessionApiSetup { } else { isInitializedChannel.setMessageHandler(nil) } - let cleanupChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let cleanupChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { cleanupChannel.setMessageHandler { _, reply in do { try api.cleanup() @@ -4643,39 +3994,27 @@ enum NavigationSessionApiSetup { } else { cleanupChannel.setMessageHandler(nil) } - let showTermsAndConditionsDialogChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let showTermsAndConditionsDialogChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { showTermsAndConditionsDialogChannel.setMessageHandler { message, reply in let args = message as! [Any?] let titleArg = args[0] as! String let companyNameArg = args[1] as! String let shouldOnlyShowDriverAwarenessDisclaimerArg = args[2] as! Bool - api.showTermsAndConditionsDialog( - title: titleArg, - companyName: companyNameArg, - shouldOnlyShowDriverAwarenessDisclaimer: shouldOnlyShowDriverAwarenessDisclaimerArg - ) { result in + api.showTermsAndConditionsDialog(title: titleArg, companyName: companyNameArg, shouldOnlyShowDriverAwarenessDisclaimer: shouldOnlyShowDriverAwarenessDisclaimerArg) { result in switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) } } } } else { showTermsAndConditionsDialogChannel.setMessageHandler(nil) } - let areTermsAcceptedChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let areTermsAcceptedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { areTermsAcceptedChannel.setMessageHandler { _, reply in do { let result = try api.areTermsAccepted() @@ -4687,12 +4026,8 @@ enum NavigationSessionApiSetup { } else { areTermsAcceptedChannel.setMessageHandler(nil) } - let resetTermsAcceptedChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let resetTermsAcceptedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { resetTermsAcceptedChannel.setMessageHandler { _, reply in do { try api.resetTermsAccepted() @@ -4704,12 +4039,8 @@ enum NavigationSessionApiSetup { } else { resetTermsAcceptedChannel.setMessageHandler(nil) } - let getNavSDKVersionChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getNavSDKVersionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getNavSDKVersionChannel.setMessageHandler { _, reply in do { let result = try api.getNavSDKVersion() @@ -4722,12 +4053,8 @@ enum NavigationSessionApiSetup { getNavSDKVersionChannel.setMessageHandler(nil) } /// Navigation. - let isGuidanceRunningChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let isGuidanceRunningChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { isGuidanceRunningChannel.setMessageHandler { _, reply in do { let result = try api.isGuidanceRunning() @@ -4739,12 +4066,8 @@ enum NavigationSessionApiSetup { } else { isGuidanceRunningChannel.setMessageHandler(nil) } - let startGuidanceChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let startGuidanceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { startGuidanceChannel.setMessageHandler { _, reply in do { try api.startGuidance() @@ -4756,12 +4079,8 @@ enum NavigationSessionApiSetup { } else { startGuidanceChannel.setMessageHandler(nil) } - let stopGuidanceChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let stopGuidanceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { stopGuidanceChannel.setMessageHandler { _, reply in do { try api.stopGuidance() @@ -4773,33 +4092,25 @@ enum NavigationSessionApiSetup { } else { stopGuidanceChannel.setMessageHandler(nil) } - let setDestinationsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setDestinationsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setDestinationsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let destinationsArg = args[0] as! DestinationsDto api.setDestinations(destinations: destinationsArg) { result in switch result { - case let .success(res): - reply(wrapResult(res.rawValue)) - case let .failure(error): - reply(wrapError(error)) + case .success(let res): + reply(wrapResult(res.rawValue)) + case .failure(let error): + reply(wrapError(error)) } } } } else { setDestinationsChannel.setMessageHandler(nil) } - let clearDestinationsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let clearDestinationsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { clearDestinationsChannel.setMessageHandler { _, reply in do { try api.clearDestinations() @@ -4811,12 +4122,8 @@ enum NavigationSessionApiSetup { } else { clearDestinationsChannel.setMessageHandler(nil) } - let continueToNextDestinationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let continueToNextDestinationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { continueToNextDestinationChannel.setMessageHandler { _, reply in do { let result = try api.continueToNextDestination() @@ -4828,12 +4135,8 @@ enum NavigationSessionApiSetup { } else { continueToNextDestinationChannel.setMessageHandler(nil) } - let getCurrentTimeAndDistanceChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getCurrentTimeAndDistanceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getCurrentTimeAndDistanceChannel.setMessageHandler { _, reply in do { let result = try api.getCurrentTimeAndDistance() @@ -4845,12 +4148,8 @@ enum NavigationSessionApiSetup { } else { getCurrentTimeAndDistanceChannel.setMessageHandler(nil) } - let setAudioGuidanceChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setAudioGuidanceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setAudioGuidanceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let settingsArg = args[0] as! NavigationAudioGuidanceSettingsDto @@ -4864,12 +4163,8 @@ enum NavigationSessionApiSetup { } else { setAudioGuidanceChannel.setMessageHandler(nil) } - let setSpeedAlertOptionsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setSpeedAlertOptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setSpeedAlertOptionsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let optionsArg = args[0] as! SpeedAlertOptionsDto @@ -4883,12 +4178,8 @@ enum NavigationSessionApiSetup { } else { setSpeedAlertOptionsChannel.setMessageHandler(nil) } - let getRouteSegmentsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getRouteSegmentsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getRouteSegmentsChannel.setMessageHandler { _, reply in do { let result = try api.getRouteSegments() @@ -4900,12 +4191,8 @@ enum NavigationSessionApiSetup { } else { getRouteSegmentsChannel.setMessageHandler(nil) } - let getTraveledRouteChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getTraveledRouteChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getTraveledRouteChannel.setMessageHandler { _, reply in do { let result = try api.getTraveledRoute() @@ -4917,12 +4204,8 @@ enum NavigationSessionApiSetup { } else { getTraveledRouteChannel.setMessageHandler(nil) } - let getCurrentRouteSegmentChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let getCurrentRouteSegmentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { getCurrentRouteSegmentChannel.setMessageHandler { _, reply in do { let result = try api.getCurrentRouteSegment() @@ -4935,12 +4218,8 @@ enum NavigationSessionApiSetup { getCurrentRouteSegmentChannel.setMessageHandler(nil) } /// Simulation - let setUserLocationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let setUserLocationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { setUserLocationChannel.setMessageHandler { message, reply in let args = message as! [Any?] let locationArg = args[0] as! LatLngDto @@ -4954,12 +4233,8 @@ enum NavigationSessionApiSetup { } else { setUserLocationChannel.setMessageHandler(nil) } - let removeUserLocationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let removeUserLocationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { removeUserLocationChannel.setMessageHandler { _, reply in do { try api.removeUserLocation() @@ -4971,12 +4246,8 @@ enum NavigationSessionApiSetup { } else { removeUserLocationChannel.setMessageHandler(nil) } - let simulateLocationsAlongExistingRouteChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let simulateLocationsAlongExistingRouteChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { simulateLocationsAlongExistingRouteChannel.setMessageHandler { _, reply in do { try api.simulateLocationsAlongExistingRoute() @@ -4988,12 +4259,8 @@ enum NavigationSessionApiSetup { } else { simulateLocationsAlongExistingRouteChannel.setMessageHandler(nil) } - let simulateLocationsAlongExistingRouteWithOptionsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let simulateLocationsAlongExistingRouteWithOptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { simulateLocationsAlongExistingRouteWithOptionsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let optionsArg = args[0] as! SimulationOptionsDto @@ -5007,87 +4274,62 @@ enum NavigationSessionApiSetup { } else { simulateLocationsAlongExistingRouteWithOptionsChannel.setMessageHandler(nil) } - let simulateLocationsAlongNewRouteChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let simulateLocationsAlongNewRouteChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { simulateLocationsAlongNewRouteChannel.setMessageHandler { message, reply in let args = message as! [Any?] let waypointsArg = args[0] as! [NavigationWaypointDto] api.simulateLocationsAlongNewRoute(waypoints: waypointsArg) { result in switch result { - case let .success(res): - reply(wrapResult(res.rawValue)) - case let .failure(error): - reply(wrapError(error)) + case .success(let res): + reply(wrapResult(res.rawValue)) + case .failure(let error): + reply(wrapError(error)) } } } } else { simulateLocationsAlongNewRouteChannel.setMessageHandler(nil) } - let simulateLocationsAlongNewRouteWithRoutingOptionsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let simulateLocationsAlongNewRouteWithRoutingOptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { simulateLocationsAlongNewRouteWithRoutingOptionsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let waypointsArg = args[0] as! [NavigationWaypointDto] let routingOptionsArg = args[1] as! RoutingOptionsDto - api.simulateLocationsAlongNewRouteWithRoutingOptions( - waypoints: waypointsArg, - routingOptions: routingOptionsArg - ) { result in + api.simulateLocationsAlongNewRouteWithRoutingOptions(waypoints: waypointsArg, routingOptions: routingOptionsArg) { result in switch result { - case let .success(res): - reply(wrapResult(res.rawValue)) - case let .failure(error): - reply(wrapError(error)) + case .success(let res): + reply(wrapResult(res.rawValue)) + case .failure(let error): + reply(wrapError(error)) } } } } else { simulateLocationsAlongNewRouteWithRoutingOptionsChannel.setMessageHandler(nil) } - let simulateLocationsAlongNewRouteWithRoutingAndSimulationOptionsChannel = - FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { - simulateLocationsAlongNewRouteWithRoutingAndSimulationOptionsChannel - .setMessageHandler { message, reply in - let args = message as! [Any?] - let waypointsArg = args[0] as! [NavigationWaypointDto] - let routingOptionsArg = args[1] as! RoutingOptionsDto - let simulationOptionsArg = args[2] as! SimulationOptionsDto - api.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( - waypoints: waypointsArg, - routingOptions: routingOptionsArg, - simulationOptions: simulationOptionsArg - ) { result in - switch result { - case let .success(res): + let simulateLocationsAlongNewRouteWithRoutingAndSimulationOptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + simulateLocationsAlongNewRouteWithRoutingAndSimulationOptionsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let waypointsArg = args[0] as! [NavigationWaypointDto] + let routingOptionsArg = args[1] as! RoutingOptionsDto + let simulationOptionsArg = args[2] as! SimulationOptionsDto + api.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(waypoints: waypointsArg, routingOptions: routingOptionsArg, simulationOptions: simulationOptionsArg) { result in + switch result { + case .success(let res): reply(wrapResult(res.rawValue)) - case let .failure(error): + case .failure(let error): reply(wrapError(error)) - } } } + } } else { simulateLocationsAlongNewRouteWithRoutingAndSimulationOptionsChannel.setMessageHandler(nil) } - let pauseSimulationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let pauseSimulationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { pauseSimulationChannel.setMessageHandler { _, reply in do { try api.pauseSimulation() @@ -5099,12 +4341,8 @@ enum NavigationSessionApiSetup { } else { pauseSimulationChannel.setMessageHandler(nil) } - let resumeSimulationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let resumeSimulationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { resumeSimulationChannel.setMessageHandler { _, reply in do { try api.resumeSimulation() @@ -5117,12 +4355,8 @@ enum NavigationSessionApiSetup { resumeSimulationChannel.setMessageHandler(nil) } /// Simulation (iOS only) - let allowBackgroundLocationUpdatesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let allowBackgroundLocationUpdatesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { allowBackgroundLocationUpdatesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let allowArg = args[0] as! Bool @@ -5137,12 +4371,8 @@ enum NavigationSessionApiSetup { allowBackgroundLocationUpdatesChannel.setMessageHandler(nil) } /// Road snapped location updates. - let enableRoadSnappedLocationUpdatesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let enableRoadSnappedLocationUpdatesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { enableRoadSnappedLocationUpdatesChannel.setMessageHandler { _, reply in do { try api.enableRoadSnappedLocationUpdates() @@ -5154,12 +4384,8 @@ enum NavigationSessionApiSetup { } else { enableRoadSnappedLocationUpdatesChannel.setMessageHandler(nil) } - let disableRoadSnappedLocationUpdatesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let disableRoadSnappedLocationUpdatesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { disableRoadSnappedLocationUpdatesChannel.setMessageHandler { _, reply in do { try api.disableRoadSnappedLocationUpdates() @@ -5172,16 +4398,11 @@ enum NavigationSessionApiSetup { disableRoadSnappedLocationUpdatesChannel.setMessageHandler(nil) } /// Enable Turn-by-Turn navigation events. - let enableTurnByTurnNavigationEventsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let enableTurnByTurnNavigationEventsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { enableTurnByTurnNavigationEventsChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let numNextStepsToPreviewArg: Int64? = isNullish(args[0]) ? nil : - (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let numNextStepsToPreviewArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) do { try api.enableTurnByTurnNavigationEvents(numNextStepsToPreview: numNextStepsToPreviewArg) reply(wrapResult(nil)) @@ -5192,12 +4413,8 @@ enum NavigationSessionApiSetup { } else { enableTurnByTurnNavigationEventsChannel.setMessageHandler(nil) } - let disableTurnByTurnNavigationEventsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let disableTurnByTurnNavigationEventsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { disableTurnByTurnNavigationEventsChannel.setMessageHandler { _, reply in do { try api.disableTurnByTurnNavigationEvents() @@ -5209,23 +4426,14 @@ enum NavigationSessionApiSetup { } else { disableTurnByTurnNavigationEventsChannel.setMessageHandler(nil) } - let registerRemainingTimeOrDistanceChangedListenerChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener", - binaryMessenger: binaryMessenger, - codec: codec - ) - if let api { + let registerRemainingTimeOrDistanceChangedListenerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { registerRemainingTimeOrDistanceChangedListenerChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let remainingTimeThresholdSecondsArg = args[0] is Int64 ? args[0] as! Int64 : - Int64(args[0] as! Int32) - let remainingDistanceThresholdMetersArg = args[1] is Int64 ? args[1] as! Int64 : - Int64(args[1] as! Int32) + let remainingTimeThresholdSecondsArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let remainingDistanceThresholdMetersArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) do { - try api.registerRemainingTimeOrDistanceChangedListener( - remainingTimeThresholdSeconds: remainingTimeThresholdSecondsArg, - remainingDistanceThresholdMeters: remainingDistanceThresholdMetersArg - ) + try api.registerRemainingTimeOrDistanceChangedListener(remainingTimeThresholdSeconds: remainingTimeThresholdSecondsArg, remainingDistanceThresholdMeters: remainingDistanceThresholdMetersArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -5236,28 +4444,27 @@ enum NavigationSessionApiSetup { } } } - private class NavigationSessionEventApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return LaneDirectionDto.fromList(readValue() as! [Any?]) - case 129: - return LaneDto.fromList(readValue() as! [Any?]) - case 130: - return LatLngDto.fromList(readValue() as! [Any?]) - case 131: - return NavInfoDto.fromList(readValue() as! [Any?]) - case 132: - return NavigationWaypointDto.fromList(readValue() as! [Any?]) - case 133: - return SpeedingUpdatedEventDto.fromList(readValue() as! [Any?]) - case 134: - return StepInfoDto.fromList(readValue() as! [Any?]) - case 135: - return StepInfoDto.fromList(readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return LaneDirectionDto.fromList(self.readValue() as! [Any?]) + case 129: + return LaneDto.fromList(self.readValue() as! [Any?]) + case 130: + return LatLngDto.fromList(self.readValue() as! [Any?]) + case 131: + return NavInfoDto.fromList(self.readValue() as! [Any?]) + case 132: + return NavigationWaypointDto.fromList(self.readValue() as! [Any?]) + case 133: + return SpeedingUpdatedEventDto.fromList(self.readValue() as! [Any?]) + case 134: + return StepInfoDto.fromList(self.readValue() as! [Any?]) + case 135: + return StepInfoDto.fromList(self.readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } @@ -5296,324 +4503,240 @@ private class NavigationSessionEventApiCodecWriter: FlutterStandardWriter { private class NavigationSessionEventApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - NavigationSessionEventApiCodecReader(data: data) + return NavigationSessionEventApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - NavigationSessionEventApiCodecWriter(data: data) + return NavigationSessionEventApiCodecWriter(data: data) } } class NavigationSessionEventApiCodec: FlutterStandardMessageCodec { - static let shared = - NavigationSessionEventApiCodec(readerWriter: NavigationSessionEventApiCodecReaderWriter()) + static let shared = NavigationSessionEventApiCodec(readerWriter: NavigationSessionEventApiCodecReaderWriter()) } /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. protocol NavigationSessionEventApiProtocol { - func onSpeedingUpdated(msg msgArg: SpeedingUpdatedEventDto, - completion: @escaping (Result) -> Void) - func onRoadSnappedLocationUpdated(location locationArg: LatLngDto, - completion: @escaping (Result) -> Void) - func onRoadSnappedRawLocationUpdated(location locationArg: LatLngDto, - completion: @escaping (Result) -> Void) - func onArrival(waypoint waypointArg: NavigationWaypointDto, - completion: @escaping (Result) -> Void) + func onSpeedingUpdated(msg msgArg: SpeedingUpdatedEventDto, completion: @escaping (Result) -> Void) + func onRoadSnappedLocationUpdated(location locationArg: LatLngDto, completion: @escaping (Result) -> Void) + func onRoadSnappedRawLocationUpdated(location locationArg: LatLngDto, completion: @escaping (Result) -> Void) + func onArrival(waypoint waypointArg: NavigationWaypointDto, completion: @escaping (Result) -> Void) func onRouteChanged(completion: @escaping (Result) -> Void) - func onRemainingTimeOrDistanceChanged(remainingTime remainingTimeArg: Double, - remainingDistance remainingDistanceArg: Double, - completion: @escaping (Result) -> Void) + func onRemainingTimeOrDistanceChanged(remainingTime remainingTimeArg: Double, remainingDistance remainingDistanceArg: Double, completion: @escaping (Result) -> Void) /// Android-only event. func onTrafficUpdated(completion: @escaping (Result) -> Void) /// Android-only event. func onRerouting(completion: @escaping (Result) -> Void) /// Android-only event. - func onGpsAvailabilityUpdate(available availableArg: Bool, - completion: @escaping (Result) -> Void) + func onGpsAvailabilityUpdate(available availableArg: Bool, completion: @escaping (Result) -> Void) /// Turn-by-Turn navigation events. - func onNavInfo(navInfo navInfoArg: NavInfoDto, - completion: @escaping (Result) -> Void) + func onNavInfo(navInfo navInfoArg: NavInfoDto, completion: @escaping (Result) -> Void) } - class NavigationSessionEventApi: NavigationSessionEventApiProtocol { private let binaryMessenger: FlutterBinaryMessenger - init(binaryMessenger: FlutterBinaryMessenger) { + init(binaryMessenger: FlutterBinaryMessenger){ self.binaryMessenger = binaryMessenger } - var codec: FlutterStandardMessageCodec { - NavigationSessionEventApiCodec.shared + return NavigationSessionEventApiCodec.shared } - - func onSpeedingUpdated(msg msgArg: SpeedingUpdatedEventDto, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onSpeedingUpdated(msg msgArg: SpeedingUpdatedEventDto, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([msgArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onRoadSnappedLocationUpdated(location locationArg: LatLngDto, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onRoadSnappedLocationUpdated(location locationArg: LatLngDto, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([locationArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onRoadSnappedRawLocationUpdated(location locationArg: LatLngDto, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onRoadSnappedRawLocationUpdated(location locationArg: LatLngDto, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([locationArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onArrival(waypoint waypointArg: NavigationWaypointDto, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onArrival(waypoint waypointArg: NavigationWaypointDto, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([waypointArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - func onRouteChanged(completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - - func onRemainingTimeOrDistanceChanged(remainingTime remainingTimeArg: Double, - remainingDistance remainingDistanceArg: Double, - completion: @escaping (Result) - -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onRemainingTimeOrDistanceChanged(remainingTime remainingTimeArg: Double, remainingDistance remainingDistanceArg: Double, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([remainingTimeArg, remainingDistanceArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - /// Android-only event. func onTrafficUpdated(completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - /// Android-only event. func onRerouting(completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - /// Android-only event. - func onGpsAvailabilityUpdate(available availableArg: Bool, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onGpsAvailabilityUpdate(available availableArg: Bool, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([availableArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } - /// Turn-by-Turn navigation events. - func onNavInfo(navInfo navInfoArg: NavInfoDto, - completion: @escaping (Result) -> Void) { - let channelName = - "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo" - let channel = FlutterBasicMessageChannel( - name: channelName, - binaryMessenger: binaryMessenger, - codec: codec - ) + func onNavInfo(navInfo navInfoArg: NavInfoDto, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([navInfoArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) + completion(.failure(createConnectionError(withChannelName:channelName))) return } - if listResponse.count > 1 { + if (listResponse.count > 1) { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) + completion(.failure(FlutterError(code: code, message: message, details: details))); } else { - completion(.success(())) + completion(.success(Void())) } } } } - /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol NavigationInspector { func isViewAttachedToSession(viewId: Int64) throws -> Bool } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -enum NavigationInspectorSetup { +class NavigationInspectorSetup { /// The codec used by NavigationInspector. /// Sets up an instance of `NavigationInspector` to handle messages through the `binaryMessenger`. static func setUp(binaryMessenger: FlutterBinaryMessenger, api: NavigationInspector?) { - let isViewAttachedToSessionChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession", - binaryMessenger: binaryMessenger - ) - if let api { + let isViewAttachedToSessionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession", binaryMessenger: binaryMessenger) + if let api = api { isViewAttachedToSessionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) diff --git a/lib/google_navigation_flutter.dart b/lib/google_navigation_flutter.dart index 8b01d9a..6143322 100644 --- a/lib/google_navigation_flutter.dart +++ b/lib/google_navigation_flutter.dart @@ -18,3 +18,7 @@ export 'src/google_navigation_flutter_android.dart'; export 'src/google_navigation_flutter_ios.dart'; export 'src/navigator/google_navigation_flutter_navigator.dart'; export 'src/types/types.dart'; +export 'src/google_maps_navigation_view.dart'; +export 'src/google_maps_map_view.dart'; +export 'src/google_maps_map_view_controller.dart'; +export 'src/google_maps_navigation_view_controller.dart'; diff --git a/lib/src/google_maps_map_view.dart b/lib/src/google_maps_map_view.dart new file mode 100644 index 0000000..f68362d --- /dev/null +++ b/lib/src/google_maps_map_view.dart @@ -0,0 +1,288 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; + +import '../google_navigation_flutter.dart'; +import 'google_navigation_flutter_platform_interface.dart'; + +/// On Google Map view created callback. +typedef OnMapViewCreatedCallback = void Function( + GoogleMapViewController controller, +); + +/// The main map view widget for Google Maps Navigation. +/// {@category Navigation View} +class GoogleMapsMapView extends StatefulWidget { + /// The main widget for embedding Google Maps Navigation into a Flutter application. + /// + /// After creating the map view, the [onViewCreated] callback is triggered, providing a + /// [GoogleNavigationViewController] that you can use to interact with the map programmatically. + /// + /// Example usage: + /// ```dart + /// GoogleMapsMapView( + /// onViewCreated: (controller) { + /// // Use the controller to interact with the map. + /// }, + /// initialCameraPosition: CameraPosition( + /// // Initial camera position parameters + /// ), + /// // Other initial map settings... + /// ) + /// ``` + const GoogleMapsMapView( + {super.key, + required this.onViewCreated, + this.initialCameraPosition = const CameraPosition(), + this.initialMapType = MapType.normal, + this.initialCompassEnabled = true, + this.initialRotateGesturesEnabled = true, + this.initialScrollGesturesEnabled = true, + this.initialTiltGesturesEnabled = true, + this.initialZoomGesturesEnabled = true, + this.initialScrollGesturesEnabledDuringRotateOrZoom = true, + this.initialMapToolbarEnabled = true, + this.initialMinZoomPreference, + this.initialMaxZoomPreference, + this.initialZoomControlsEnabled = true, + this.initialCameraTargetBounds, + this.initialNavigationUIEnabledPreference = + NavigationUIEnabledPreference.automatic, + this.layoutDirection, + this.gestureRecognizers = const >{}, + this.onRecenterButtonClicked, + this.onMarkerClicked, + this.onMarkerDrag, + this.onMarkerDragStart, + this.onMarkerDragEnd, + this.onMarkerInfoWindowClicked, + this.onMarkerInfoWindowClosed, + this.onMarkerInfoWindowLongClicked, + this.onMapClicked, + this.onMapLongClicked, + this.onPolygonClicked, + this.onPolylineClicked, + this.onCircleClicked, + this.onNavigationUIEnabledChanged, + this.onMyLocationClicked, + this.onMyLocationButtonClicked, + this.onCameraMoveStarted, + this.onCameraMove, + this.onCameraIdle, + this.onCameraStartedFollowingLocation, + this.onCameraStoppedFollowingLocation}); + + /// On view created callback. + final OnMapViewCreatedCallback onViewCreated; + + /// The initial positioning of the camera in the map view. + final CameraPosition initialCameraPosition; + + /// The directionality to be used for text layout within the embedded view. + final TextDirection? layoutDirection; + + /// The type of map to display, specified using [MapType] enum values. + final MapType initialMapType; + + /// Specifies whether the compass should be enabled. + /// + /// The compass is an icon on the map that indicates the direction of north on the map. + /// If enabled, it is only shown when the camera is tilted or rotated away from + /// its default orientation (tilt of 0 and a bearing of 0). + /// + /// By default, the compass is enabled. + final bool initialCompassEnabled; + + /// Specifies whether rotate gestures should be enabled. + /// + /// If enabled, users can use a two-finger rotate gesture to rotate the camera. + /// If disabled, users cannot rotate the camera via gestures. + /// This setting doesn't restrict the user from tapping the compass icon to reset the camera orientation, + /// nor does it restrict programmatic movements and animation of the camera. + /// + /// By default, the rotation gestures are enabled. + final bool initialRotateGesturesEnabled; + + /// Specifies whether scroll gestures should be enabled. + /// + /// By default, the scroll gestures are enabled. + final bool initialScrollGesturesEnabled; + + /// Specifies whether tilt gestures should be enabled. + /// + /// By default, the tilt gestures are enabled. + final bool initialTiltGesturesEnabled; + + /// Specifies whether zoom gestures should be enabled. + /// + /// By default, the zoom gestures enabled. + final bool initialZoomGesturesEnabled; + + /// Specifies whether scroll gestures during rotate or zoom should be enabled. + /// + /// If enabled, users can swipe to pan the camera. If disabled, swiping has no effect. + /// This setting doesn't restrict programmatic movement and animation of the camera. + /// + /// By default, the zoom gestures enabled. + final bool initialScrollGesturesEnabledDuringRotateOrZoom; + + /// Specifies whether the map toolbar should be enabled. Only applicable on Android. + /// + /// If enabled, and the map toolbar can be shown in the current context, + /// users will see a bar with various context-dependent actions. + /// + /// By default, the map toolbar is enabled. + final bool initialMapToolbarEnabled; + + /// Specifies a preferred lower bound for camera zoom. + /// + /// Null by default (not limited). + final double? initialMinZoomPreference; + + /// Specifies a preferred upper bound for camera zoom. + /// + /// Null by default (not limited). + final double? initialMaxZoomPreference; + + /// Specifies whether the zoom controls should be enabled. Only applicable on Android. + /// + /// By default, the zoom controls are enabled. + final bool initialZoomControlsEnabled; + + /// Specifies a bounds to constrain the camera target, so that when users scroll and pan the map, + /// the camera target does not move outside these bounds. + /// + /// Null by default (unbounded). + final LatLngBounds? initialCameraTargetBounds; + + /// Determines the initial visibility of the navigation UI on map initialization. + /// + /// By default set to [NavigationUIEnabledPreference.automatic], + /// meaning the navigation UI gets enabled if the navigation + /// session has already been successfully started. + /// + /// If set to [NavigationUIEnabledPreference.disabled] the navigation view + /// initially displays a classic map view. + /// + /// Note on Android enabling the navigation UI for the view requires that the + /// navigation session has already been successfully started with + /// [GoogleMapsNavigator.initializeNavigationSession]. On iOS accepting + /// the terms and conditions is enough. + final NavigationUIEnabledPreference initialNavigationUIEnabledPreference; + + /// Which gestures should be forwarded to the PlatformView. + /// + /// When this set is empty, the map will only handle pointer events for gestures that + /// were not claimed by any other gesture recognizer. + /// + /// See [PlatformViewSurface.gestureRecognizers] for details. + final Set> gestureRecognizers; + + /// On recenter button clicked event callback. + final OnRecenterButtonClicked? onRecenterButtonClicked; + + /// On marker clicked callback. + final OnMarkerClicked? onMarkerClicked; + + /// On marker drag callback. + final OnMarkerDrag? onMarkerDrag; + + /// On marker drag start callback. + final OnMarkerDragStart? onMarkerDragStart; + + /// On marker drag end callback. + final OnMarkerDragEnd? onMarkerDragEnd; + + /// On marker info window clicked callback. + final OnMarkerInfoWindowClicked? onMarkerInfoWindowClicked; + + /// On marker info window closed callback. + final OnMarkerInfoWindowClosed? onMarkerInfoWindowClosed; + + /// On marker info window long clicked callback. + final OnMarkerInfoWindowLongClicked? onMarkerInfoWindowLongClicked; + + /// On map clicked callback. + final OnMapClicked? onMapClicked; + + /// On map long clicked callback. + final OnMapLongClicked? onMapLongClicked; + + /// On polygon clicked callback. + final OnPolygonClicked? onPolygonClicked; + + /// On polyline clicked callback. + final OnPolylineClicked? onPolylineClicked; + + /// On circle clicked callback. + final OnCircleClicked? onCircleClicked; + + /// On navigation UI enabled changed callback. + final OnNavigationUIEnabledChanged? onNavigationUIEnabledChanged; + + /// On my location clicked callback. + final OnMyLocationClicked? onMyLocationClicked; + + /// On my location button clicked callback. + final OnMyLocationButtonClicked? onMyLocationButtonClicked; + + /// On camera move started callback. + final OnCameraMoveStarted? onCameraMoveStarted; + + /// On camera move callback. + final OnCameraMove? onCameraMove; + + /// On camera idle callback. + final OnCameraIdle? onCameraIdle; + + /// On camera started following location callback (Android-only). + final OnCameraStartedFollowingLocation? onCameraStartedFollowingLocation; + + /// On camera stopped following location callback (Android-only). + final OnCameraStoppedFollowingLocation? onCameraStoppedFollowingLocation; + + /// Creates a [State] for this [GoogleMapsMapView]. + @override + State createState() => GoogleMapsMapViewState(); +} + +/// Google Maps Navigation. +/// {@category Navigation View} +class GoogleMapsMapViewState extends State { + @override + Widget build(BuildContext context) { + return GoogleMapsNavigationPlatform.instance.buildMapView( + initializationOptions: MapViewInitializationOptions( + layoutDirection: widget.layoutDirection ?? + Directionality.maybeOf(context) ?? + TextDirection.ltr, + gestureRecognizers: widget.gestureRecognizers, + mapOptions: MapOptions( + cameraPosition: widget.initialCameraPosition, + mapType: widget.initialMapType, + compassEnabled: widget.initialCompassEnabled, + rotateGesturesEnabled: widget.initialRotateGesturesEnabled, + scrollGesturesEnabled: widget.initialScrollGesturesEnabled, + tiltGesturesEnabled: widget.initialTiltGesturesEnabled, + zoomGesturesEnabled: widget.initialZoomGesturesEnabled, + scrollGesturesEnabledDuringRotateOrZoom: + widget.initialScrollGesturesEnabledDuringRotateOrZoom, + mapToolbarEnabled: widget.initialMapToolbarEnabled, + minZoomPreference: widget.initialMinZoomPreference, + maxZoomPreference: widget.initialMaxZoomPreference, + zoomControlsEnabled: widget.initialZoomControlsEnabled, + cameraTargetBounds: widget.initialCameraTargetBounds, + ), + navigationViewOptions: NavigationViewOptions( + navigationUIEnabledPreference: + widget.initialNavigationUIEnabledPreference)), + onMapReady: _onPlatformViewCreated); + } + + /// Callback method when platform view is created. + void _onPlatformViewCreated(int viewId) { + final GoogleMapViewController viewController = + GoogleMapViewController(viewId, this); + widget.onViewCreated(viewController); + } +} diff --git a/lib/src/google_maps_map_view_controller.dart b/lib/src/google_maps_map_view_controller.dart new file mode 100644 index 0000000..7014f66 --- /dev/null +++ b/lib/src/google_maps_map_view_controller.dart @@ -0,0 +1,681 @@ +import '../google_navigation_flutter.dart'; +import 'google_navigation_flutter_platform_interface.dart'; + +/// Navigation View Controller class to handle navigation view events. +/// {@category Navigation View} +class GoogleMapViewController { + /// Basic constructor. + /// + /// Don't create this directly, but access through + /// [GoogleMapsNavigationView.onViewCreated] callback. + GoogleMapViewController(this._viewId, [this._viewState]) + : settings = NavigationViewUISettings(_viewId) { + _initListeners(); + } + + final int _viewId; + + final GoogleMapsMapViewState? _viewState; + + /// Settings for the user interface of the map. + final NavigationViewUISettings settings; + + /// Getter for view ID. + int getViewId() { + return _viewId; + } + + /// Initializes the event channel listeners for the map view instance. + void _initListeners() { + _setOnMapClickedListeners(); + _setOnRecenterButtonClickedListener(); + _setOnMarkerClickedListeners(); + _setOnMarkerDragListeners(); + _setOnPolygonClickedListener(); + _setOnPolylineClickedListener(); + _setOnCircleClickedListener(); + _setOnNavigationUIEnabledChangedListener(); + _setOnMyLocationClickedListener(); + _setOnMyLocationButtonClickedListener(); + _setOnCameraChangedListener(); + } + + /// Sets the event channel listener for the map click event listeners. + void _setOnMapClickedListeners() { + if (_viewState != null) { + if (_viewState.widget.onMapClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMapClickEventStream(viewId: _viewId) + .listen((MapClickEvent event) { + _viewState.widget.onMapClicked!(event.target); + }); + } + if (_viewState.widget.onMapLongClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMapLongClickEventStream(viewId: _viewId) + .listen((MapLongClickEvent event) { + _viewState.widget.onMapLongClicked!(event.target); + }); + } + } + } + + /// Sets the event channel listener for the on recenter button clicked event. + void _setOnRecenterButtonClickedListener() { + if (_viewState != null && + _viewState.widget.onRecenterButtonClicked != null) { + GoogleMapsNavigationPlatform.instance + .getNavigationRecenterButtonClickedEventStream(viewId: _viewId) + .listen(_viewState.widget.onRecenterButtonClicked); + } + } + + /// Sets the event channel listener for the marker clicked events. + void _setOnMarkerClickedListeners() { + GoogleMapsNavigationPlatform.instance + .getMarkerEventStream(viewId: _viewId) + .listen((MarkerEvent event) { + switch (event.eventType) { + case MarkerEventType.clicked: + _viewState?.widget.onMarkerClicked?.call(event.markerId); + case MarkerEventType.infoWindowClicked: + _viewState?.widget.onMarkerInfoWindowClicked?.call(event.markerId); + case MarkerEventType.infoWindowClosed: + _viewState?.widget.onMarkerInfoWindowClosed?.call(event.markerId); + case MarkerEventType.infoWindowLongClicked: + _viewState?.widget.onMarkerInfoWindowLongClicked + ?.call(event.markerId); + } + }); + } + + /// Sets the event channel listener for the on my location clicked event. + void _setOnMyLocationClickedListener() { + if (_viewState != null && _viewState.widget.onMyLocationClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMyLocationClickedEventStream(viewId: _viewId) + .listen(_viewState.widget.onMyLocationClicked); + } + } + + /// Sets the event channel listener for the on my location button clicked event. + void _setOnMyLocationButtonClickedListener() { + if (_viewState != null && + _viewState.widget.onMyLocationButtonClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMyLocationButtonClickedEventStream(viewId: _viewId) + .listen(_viewState.widget.onMyLocationButtonClicked); + } + } + + /// Sets the event channel listener for camera changed events. + void _setOnCameraChangedListener() { + // Register listeners if any of the callbacks are not null. + if (_viewState?.widget.onCameraMoveStarted != null || + _viewState?.widget.onCameraMove != null || + _viewState?.widget.onCameraIdle != null) { + GoogleMapsNavigationPlatform.instance + .registerOnCameraChangedListener(viewId: _viewId); + } + GoogleMapsNavigationPlatform.instance + .getCameraChangedEventStream(viewId: _viewId) + .listen((CameraChangedEvent event) { + switch (event.eventType) { + case CameraEventType.moveStartedByApi: + _viewState?.widget.onCameraMoveStarted?.call(event.position, false); + case CameraEventType.moveStartedByGesture: + _viewState?.widget.onCameraMoveStarted?.call(event.position, true); + case CameraEventType.onCameraMove: + _viewState?.widget.onCameraMove?.call(event.position); + case CameraEventType.onCameraIdle: + _viewState?.widget.onCameraIdle?.call(event.position); + case CameraEventType.onCameraStartedFollowingLocation: + _viewState?.widget.onCameraStartedFollowingLocation + ?.call(event.position); + case CameraEventType.onCameraStoppedFollowingLocation: + _viewState?.widget.onCameraStoppedFollowingLocation + ?.call(event.position); + } + }); + } + + /// Sets the event channel listener for the marker drag event. + void _setOnMarkerDragListeners() { + GoogleMapsNavigationPlatform.instance + .getMarkerDragEventStream(viewId: _viewId) + .listen((MarkerDragEvent event) { + switch (event.eventType) { + case MarkerDragEventType.drag: + _viewState?.widget.onMarkerDrag?.call(event.markerId, event.position); + case MarkerDragEventType.dragEnd: + _viewState?.widget.onMarkerDragEnd + ?.call(event.markerId, event.position); + case MarkerDragEventType.dragStart: + _viewState?.widget.onMarkerDragStart + ?.call(event.markerId, event.position); + } + }); + } + + /// Sets the event channel listener for the polygon clicked event. + void _setOnPolygonClickedListener() { + GoogleMapsNavigationPlatform.instance + .getPolygonClickedEventStream(viewId: _viewId) + .listen((PolygonClickedEvent event) { + _viewState?.widget.onPolygonClicked?.call(event.polygonId); + }); + } + + /// Sets the event channel listener for the polyline clicked event. + void _setOnPolylineClickedListener() { + GoogleMapsNavigationPlatform.instance + .getPolylineClickedEventStream(viewId: _viewId) + .listen((PolylineClickedEvent event) { + _viewState?.widget.onPolylineClicked?.call(event.polylineId); + }); + } + + /// Sets the event channel listener for the circle clicked event. + void _setOnCircleClickedListener() { + GoogleMapsNavigationPlatform.instance + .getCircleClickedEventStream(viewId: _viewId) + .listen((CircleClickedEvent event) { + _viewState?.widget.onCircleClicked?.call(event.circleId); + }); + } + + /// Sets the event channel listener for the navigation UI enabled changed event. + void _setOnNavigationUIEnabledChangedListener() { + GoogleMapsNavigationPlatform.instance + .getNavigationUIEnabledChangedEventStream(viewId: _viewId) + .listen((NavigationUIEnabledChangedEvent event) { + _viewState?.widget.onNavigationUIEnabledChanged + ?.call(event.navigationUIEnabled); + }); + } + + /// Change status of my location enabled. + /// + /// By default, the my location layer is disabled, but gets + /// automatically enabled on Android when the navigation starts. + /// + /// On iOS this property doesn't control the my location indication during + /// the navigation. + Future setMyLocationEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance + .setMyLocationEnabled(viewId: _viewId, enabled: enabled); + } + + /// This method returns the current map type of the Google Maps view instance. + Future getMapType() { + return GoogleMapsNavigationPlatform.instance.getMapType(viewId: _viewId); + } + + /// Changes the type of the map being displayed on the Google Maps view. + /// + /// The [mapType] parameter specifies the new map type to be set. + /// It should be one of the values defined in the [MapType] enum, + /// such as [MapType.normal], [MapType.satellite], [MapType.terrain], + /// or [MapType.hybrid]. + /// + /// Example usage: + /// ```dart + /// _navigationViewController.changeMapType(MapType.satellite); + /// ``` + Future setMapType({required MapType mapType}) async { + return GoogleMapsNavigationPlatform.instance + .setMapType(viewId: _viewId, mapType: mapType); + } + + /// Sets the styling of the base map using a string containing JSON. + /// Null value will reset the base map to default style. + /// If [styleJson] is invalid throws [MapStyleException]. + /// + /// For more details see the official documentation: + /// https://developers.google.com/maps/documentation/ios-sdk/styling + /// https://developers.google.com/maps/documentation/android-sdk/styling + Future setMapStyle(String? styleJson) async { + return GoogleMapsNavigationPlatform.instance + .setMapStyle(_viewId, styleJson); + } + + /// Gets whether the my location is enabled or disabled. + /// + /// By default, the my location layer is disabled, but gets + /// automatically enabled on Android when the navigation starts. + /// + /// On iOS this property doesn't control the my location indication during + /// the navigation. + Future isMyLocationEnabled() async { + return GoogleMapsNavigationPlatform.instance + .isMyLocationEnabled(viewId: _viewId); + } + + /// Ask the camera to follow the user's location. + /// + /// Use [perspective] to specify the orientation of the camera + /// and optional [zoomLevel] to control the map zoom. + /// + /// Automatically started in the perspective [CameraPerspective.tilted] when + /// the navigation is initialized with [GoogleMapsNavigator.initializeNavigationSession] + /// or when navigation UI gets re-enabled with [setNavigationUIEnabled]. + /// + /// In Android, you can use [GoogleMapsNavigationView.onCameraStartedFollowingLocation] + /// and [GoogleMapsNavigationView.onCameraStoppedFollowingLocation] callbacks + /// to detect when the follow location mode is enabled or disabled. + /// + /// Note there are small differences on how Android and iOS handle the camera + /// during the follow my location mode (tilt, zoom, transitions, etc.). + /// + /// See also [GoogleMapsNavigator.startGuidance], [showRouteOverview] and [animateCamera]. + Future followMyLocation(CameraPerspective perspective, + {double? zoomLevel}) async { + return GoogleMapsNavigationPlatform.instance.followMyLocation( + viewId: _viewId, perspective: perspective, zoomLevel: zoomLevel); + } + + /// Gets user's current location. + Future getMyLocation() async { + return GoogleMapsNavigationPlatform.instance.getMyLocation(viewId: _viewId); + } + + /// Gets the current visible map region or camera bounds. + Future getVisibleRegion() async { + return GoogleMapsNavigationPlatform.instance + .getVisibleRegion(viewId: _viewId); + } + + /// Gets the current position of the camera. + Future getCameraPosition() async { + return GoogleMapsNavigationPlatform.instance + .getCameraPosition(viewId: _viewId); + } + + /// Animates the movement of the camera from the current position + /// to the position defined in the [cameraUpdate]. + /// + /// See [CameraUpdate] for more information on how to create different camera + /// animations. + /// + /// On Android you can override the default animation [duration] and + /// set [onFinished] callback that is called when the animation completes + /// (passes true) or is cancelled (passes false). + /// + /// Example usage: + /// ```dart + /// controller.animateCamera(CameraUpdate.zoomIn(), + /// duration: Duration(milliseconds: 600), + /// onFinished: (bool success) => {}); + /// ``` + /// On iOS [duration] and [onFinished] are not supported and defining them + /// does nothing. + /// + /// See also [moveCamera], [followMyLocation], [showRouteOverview]. + Future animateCamera(CameraUpdate cameraUpdate, + {Duration? duration, AnimationFinishedCallback? onFinished}) { + return GoogleMapsNavigationPlatform.instance.animateCamera( + viewId: _viewId, + cameraUpdate: cameraUpdate, + duration: duration?.inMilliseconds, + onFinished: onFinished); + } + + /// Moves the camera from the current position to the position + /// defined in the [cameraUpdate]. + /// + /// See [CameraUpdate] for more information + /// on how to create different camera movements. + Future moveCamera(CameraUpdate cameraUpdate) { + return GoogleMapsNavigationPlatform.instance + .moveCamera(viewId: _viewId, cameraUpdate: cameraUpdate); + } + + /// Is the navigation trip progress bar enabled. + Future isNavigationTripProgressBarEnabled() { + return GoogleMapsNavigationPlatform.instance + .isNavigationTripProgressBarEnabled(viewId: _viewId); + } + + /// Enable or disable the navigation trip progress bar. + /// + /// By default, the navigation trip progress bar is disabled. + Future setNavigationTripProgressBarEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance + .setNavigationTripProgressBarEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Is the navigation header enabled. + Future isNavigationHeaderEnabled() { + return GoogleMapsNavigationPlatform.instance + .isNavigationHeaderEnabled(viewId: _viewId); + } + + /// Enable or disable the navigation header. + /// + /// By default, the navigation header is enabled. + Future setNavigationHeaderEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setNavigationHeaderEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Is the navigation footer enabled. + Future isNavigationFooterEnabled() { + return GoogleMapsNavigationPlatform.instance + .isNavigationFooterEnabled(viewId: _viewId); + } + + /// Enable or disable the navigation footer. + /// + /// By default, the navigation footer is enabled. + /// + /// Also known as ETA card, for example in Android + /// calls [setEtaCardEnabled().](https://developers.google.com/maps/documentation/navigation/android-sdk/v1/reference/com/google/android/libraries/navigation/NavigationView#setEtaCardEnabled(boolean)) + Future setNavigationFooterEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setNavigationFooterEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Is the recenter button enabled. + Future isRecenterButtonEnabled() { + return GoogleMapsNavigationPlatform.instance + .isRecenterButtonEnabled(viewId: _viewId); + } + + /// Enable or disable the recenter button. + /// + /// By default, the recenter button is enabled. + Future setRecenterButtonEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setRecenterButtonEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Can the speed limit indication be displayed. + Future isSpeedLimitIconEnabled() { + return GoogleMapsNavigationPlatform.instance + .isSpeedLimitIconEnabled(viewId: _viewId); + } + + /// Allow showing the speed limit indicator. + /// + /// By default, the speed limit is not displayed. + Future setSpeedLimitIconEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setSpeedLimitIconEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Can the speedometer be displayed. + Future isSpeedometerEnabled() { + return GoogleMapsNavigationPlatform.instance + .isSpeedometerEnabled(viewId: _viewId); + } + + /// Allow showing the speedometer. + /// + /// By default, the speedometer is not displayed. + Future setSpeedometerEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setSpeedometerEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Are the incident cards displayed. + Future isTrafficIncidentCardsEnabled() { + return GoogleMapsNavigationPlatform.instance + .isTrafficIncidentCardsEnabled(viewId: _viewId); + } + + /// Enable or disable showing of the incident cards. + /// + /// By default, the incident cards are shown. + Future setTrafficIncidentCardsEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setTrafficIncidentCardsEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Check if the navigation user interface is shown. + Future isNavigationUIEnabled() { + return GoogleMapsNavigationPlatform.instance + .isNavigationUIEnabled(viewId: _viewId); + } + + /// Show or hide the navigation user interface shown on top of the map. + /// + /// When enabled also actives [followMyLocation] camera mode. + /// + /// Disabling hides routes on iOS, but on Android the routes stay visible. + /// + /// By default, the navigation UI is enabled when the session has been + /// initialized with [GoogleMapsNavigator.initializeNavigationSession]. + /// + /// Fails on Android if the navigation session has not been initialized, + /// and on iOS if the terms and conditions have not been accepted. + Future setNavigationUIEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setNavigationUIEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Move the map camera to show the route overview. + /// + /// See also [followMyLocation] and [animateCamera]. + Future showRouteOverview() { + return GoogleMapsNavigationPlatform.instance.showRouteOverview( + viewId: _viewId, + ); + } + + /// Returns the minimum zoom level preference from the map view. + /// If minimum zoom preference is not set previously, returns minimum possible + /// zoom level for the current map type. + Future getMinZoomPreference() { + return GoogleMapsNavigationPlatform.instance + .getMinZoomPreference(viewId: _viewId); + } + + /// Returns the maximum zoom level preference from the map view. + /// If maximum zoom preference is not set previously, returns maximum possible + /// zoom level for the current map type. + Future getMaxZoomPreference() { + return GoogleMapsNavigationPlatform.instance + .getMaxZoomPreference(viewId: _viewId); + } + + /// Removes any previously specified upper and lower zoom bounds. + Future resetMinMaxZoomPreference() { + return GoogleMapsNavigationPlatform.instance + .resetMinMaxZoomPreference(viewId: _viewId); + } + + /// Sets a preferred lower bound for the camera zoom. + /// + /// When the minimum zoom changes, the SDK adjusts all later camera updates + /// to respect that minimum if possible. Note that there are technical + /// considerations that may prevent the SDK from allowing users to zoom too low. + /// + /// Throws [MinZoomRangeException] if [minZoomPreference] is + /// greater than maximum zoom lavel. + Future setMinZoomPreference(double minZoomPreference) { + return GoogleMapsNavigationPlatform.instance.setMinZoomPreference( + viewId: _viewId, minZoomPreference: minZoomPreference); + } + + /// Sets a preferred upper bound for the camera zoom. + /// + /// When the maximum zoom changes, the SDK adjusts all later camera updates + /// to respect that maximum if possible. Note that there are technical + /// considerations that may prevent the SDK from allowing users to zoom too + /// deep into the map. For example, satellite or terrain may have a lower + /// maximum zoom than the base map tiles. + /// + /// Throws [MaxZoomRangeException] if [maxZoomPreference] is + /// less than minimum zoom lavel. + Future setMaxZoomPreference(double maxZoomPreference) { + return GoogleMapsNavigationPlatform.instance.setMaxZoomPreference( + viewId: _viewId, maxZoomPreference: maxZoomPreference); + } + + /// Retrieves all markers that have been added to the map view. + Future> getMarkers() { + return GoogleMapsNavigationPlatform.instance.getMarkers(viewId: _viewId); + } + + /// Add markers to the map view. + Future> addMarkers(List markerOptions) { + return GoogleMapsNavigationPlatform.instance + .addMarkers(viewId: _viewId, markerOptions: markerOptions); + } + + /// Update markers to the map view. + /// + /// Throws [MarkerNotFoundException] if the [markers] list contains one or + /// more markers that have not been added to the map view via [addMarkers] or + /// contains markers that have already been removed from the map view. + Future> updateMarkers(List markers) async { + return GoogleMapsNavigationPlatform.instance + .updateMarkers(viewId: _viewId, markers: markers); + } + + /// Remove markers from the map view. + /// + /// Throws [MarkerNotFoundException] if the [markers] list contains one or + /// more markers that have not been added to the map view via [addMarkers] or + /// contains markers that have already been removed from the map view. + Future removeMarkers(List markers) async { + return GoogleMapsNavigationPlatform.instance + .removeMarkers(viewId: _viewId, markers: markers); + } + + /// Remove all markers from the map view. + Future clearMarkers() { + return GoogleMapsNavigationPlatform.instance.clearMarkers(viewId: _viewId); + } + + /// Retrieves all polygons that have been added to the map view. + Future> getPolygons() { + return GoogleMapsNavigationPlatform.instance.getPolygons(viewId: _viewId); + } + + /// Add polygons to the map view. + Future> addPolygons(List polygonOptions) { + return GoogleMapsNavigationPlatform.instance + .addPolygons(viewId: _viewId, polygonOptions: polygonOptions); + } + + /// Update polygons to the map view. + /// + /// Throws [PolygonNotFoundException] if the [polygons] list contains + /// polygon that has not beed added to the map view via [addPolygons] or + /// contains polygon that has already been removed from the map view. + Future> updatePolygons(List polygons) async { + return GoogleMapsNavigationPlatform.instance + .updatePolygons(viewId: _viewId, polygons: polygons); + } + + /// Remove polygons from the map view. + /// + /// Throws [PolygonNotFoundException] if the [polygons] list contains + /// polygon that has not beed added to the map view via [addPolygons] or + /// contains polygon that has already been removed from the map view. + Future removePolygons(List polygons) async { + return GoogleMapsNavigationPlatform.instance + .removePolygons(viewId: _viewId, polygons: polygons); + } + + /// Remove all polygons from the map view. + Future clearPolygons() { + return GoogleMapsNavigationPlatform.instance.clearPolygons(viewId: _viewId); + } + + /// Retrieves all polylines that have been added to the map view. + Future> getPolylines() { + return GoogleMapsNavigationPlatform.instance.getPolylines(viewId: _viewId); + } + + /// Add polylines to the map view. + Future> addPolylines(List polylineOptions) { + return GoogleMapsNavigationPlatform.instance + .addPolylines(viewId: _viewId, polylineOptions: polylineOptions); + } + + /// Update polylines to the map view. + /// + /// Throws [PolylineNotFoundException] if the [polylines] list contains + /// polyline that has not beed added to the map view via [addPolylines] or + /// contains polyline that has already been removed from the map view. + Future> updatePolylines(List polylines) async { + return GoogleMapsNavigationPlatform.instance + .updatePolylines(viewId: _viewId, polylines: polylines); + } + + /// Remove polylines from the map view. + /// + /// Throws [PolylineNotFoundException] if the [polylines] list contains + /// polyline that has not beed added to the map view via [addPolylines] or + /// contains polyline that has already been removed from the map view. + Future removePolylines(List polylines) async { + return GoogleMapsNavigationPlatform.instance + .removePolylines(viewId: _viewId, polylines: polylines); + } + + /// Remove all polylines from the map view. + Future clearPolylines() { + return GoogleMapsNavigationPlatform.instance + .clearPolylines(viewId: _viewId); + } + + /// Gets all circles from the map view. + Future> getCircles() { + return GoogleMapsNavigationPlatform.instance.getCircles(viewId: _viewId); + } + + /// Add circles to the map view. + Future> addCircles(List options) { + return GoogleMapsNavigationPlatform.instance + .addCircles(viewId: _viewId, options: options); + } + + /// Update circles to the map view. + /// + /// Throws [CircleNotFoundException] if the [circles] list contains one or + /// more circles that have not been added to the map view via [addCircles] or + /// contains circles that have already been removed from the map view. + Future> updateCircles(List circles) async { + return GoogleMapsNavigationPlatform.instance + .updateCircles(viewId: _viewId, circles: circles); + } + + /// Remove circles from the map view. + /// + /// Throws [CircleNotFoundException] if the [circles] list contains one or + /// more circles that have not been added to the map view via [addCircles] or + /// contains circles that have already been removed from the map view. + Future removeCircles(List circles) async { + return GoogleMapsNavigationPlatform.instance + .removeCircles(viewId: _viewId, circles: circles); + } + + /// Remove all circles from the map view. + Future clearCircles() { + return GoogleMapsNavigationPlatform.instance.clearCircles(viewId: _viewId); + } + + /// Remove all markers, polylines, polygons, overlays, etc from the map view. + Future clear() { + return GoogleMapsNavigationPlatform.instance.clear(viewId: _viewId); + } +} diff --git a/lib/src/google_maps_navigation_view.dart b/lib/src/google_maps_navigation_view.dart new file mode 100644 index 0000000..e20a614 --- /dev/null +++ b/lib/src/google_maps_navigation_view.dart @@ -0,0 +1,288 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; + +import '../google_navigation_flutter.dart'; +import 'google_navigation_flutter_platform_interface.dart'; + +/// On Google Navigation view created callback. +typedef OnNavigationViewCreatedCallback = void Function( + GoogleNavigationViewController controller, +); + +/// The main map view widget for Google Maps Navigation. +/// {@category Navigation View} +class GoogleMapsNavigationView extends StatefulWidget { + /// The main widget for embedding Google Maps Navigation into a Flutter application. + /// + /// After creating the map view, the [onViewCreated] callback is triggered, providing a + /// [GoogleNavigationViewController] that you can use to interact with the map programmatically. + /// + /// Example usage: + /// ```dart + /// GoogleMapsNavigationView( + /// onViewCreated: (controller) { + /// // Use the controller to interact with the map. + /// }, + /// initialCameraPosition: CameraPosition( + /// // Initial camera position parameters + /// ), + /// // Other initial map settings... + /// ) + /// ``` + const GoogleMapsNavigationView( + {super.key, + required this.onViewCreated, + this.initialCameraPosition = const CameraPosition(), + this.initialMapType = MapType.normal, + this.initialCompassEnabled = true, + this.initialRotateGesturesEnabled = true, + this.initialScrollGesturesEnabled = true, + this.initialTiltGesturesEnabled = true, + this.initialZoomGesturesEnabled = true, + this.initialScrollGesturesEnabledDuringRotateOrZoom = true, + this.initialMapToolbarEnabled = true, + this.initialMinZoomPreference, + this.initialMaxZoomPreference, + this.initialZoomControlsEnabled = true, + this.initialCameraTargetBounds, + this.initialNavigationUIEnabledPreference = + NavigationUIEnabledPreference.automatic, + this.layoutDirection, + this.gestureRecognizers = const >{}, + this.onRecenterButtonClicked, + this.onMarkerClicked, + this.onMarkerDrag, + this.onMarkerDragStart, + this.onMarkerDragEnd, + this.onMarkerInfoWindowClicked, + this.onMarkerInfoWindowClosed, + this.onMarkerInfoWindowLongClicked, + this.onMapClicked, + this.onMapLongClicked, + this.onPolygonClicked, + this.onPolylineClicked, + this.onCircleClicked, + this.onNavigationUIEnabledChanged, + this.onMyLocationClicked, + this.onMyLocationButtonClicked, + this.onCameraMoveStarted, + this.onCameraMove, + this.onCameraIdle, + this.onCameraStartedFollowingLocation, + this.onCameraStoppedFollowingLocation}); + + /// On view created callback. + final OnNavigationViewCreatedCallback onViewCreated; + + /// The initial positioning of the camera in the map view. + final CameraPosition initialCameraPosition; + + /// The directionality to be used for text layout within the embedded view. + final TextDirection? layoutDirection; + + /// The type of map to display, specified using [MapType] enum values. + final MapType initialMapType; + + /// Specifies whether the compass should be enabled. + /// + /// The compass is an icon on the map that indicates the direction of north on the map. + /// If enabled, it is only shown when the camera is tilted or rotated away from + /// its default orientation (tilt of 0 and a bearing of 0). + /// + /// By default, the compass is enabled. + final bool initialCompassEnabled; + + /// Specifies whether rotate gestures should be enabled. + /// + /// If enabled, users can use a two-finger rotate gesture to rotate the camera. + /// If disabled, users cannot rotate the camera via gestures. + /// This setting doesn't restrict the user from tapping the compass icon to reset the camera orientation, + /// nor does it restrict programmatic movements and animation of the camera. + /// + /// By default, the rotation gestures are enabled. + final bool initialRotateGesturesEnabled; + + /// Specifies whether scroll gestures should be enabled. + /// + /// By default, the scroll gestures are enabled. + final bool initialScrollGesturesEnabled; + + /// Specifies whether tilt gestures should be enabled. + /// + /// By default, the tilt gestures are enabled. + final bool initialTiltGesturesEnabled; + + /// Specifies whether zoom gestures should be enabled. + /// + /// By default, the zoom gestures enabled. + final bool initialZoomGesturesEnabled; + + /// Specifies whether scroll gestures during rotate or zoom should be enabled. + /// + /// If enabled, users can swipe to pan the camera. If disabled, swiping has no effect. + /// This setting doesn't restrict programmatic movement and animation of the camera. + /// + /// By default, the zoom gestures enabled. + final bool initialScrollGesturesEnabledDuringRotateOrZoom; + + /// Specifies whether the map toolbar should be enabled. Only applicable on Android. + /// + /// If enabled, and the map toolbar can be shown in the current context, + /// users will see a bar with various context-dependent actions. + /// + /// By default, the map toolbar is enabled. + final bool initialMapToolbarEnabled; + + /// Specifies a preferred lower bound for camera zoom. + /// + /// Null by default (not limited). + final double? initialMinZoomPreference; + + /// Specifies a preferred upper bound for camera zoom. + /// + /// Null by default (not limited). + final double? initialMaxZoomPreference; + + /// Specifies whether the zoom controls should be enabled. Only applicable on Android. + /// + /// By default, the zoom controls are enabled. + final bool initialZoomControlsEnabled; + + /// Specifies a bounds to constrain the camera target, so that when users scroll and pan the map, + /// the camera target does not move outside these bounds. + /// + /// Null by default (unbounded). + final LatLngBounds? initialCameraTargetBounds; + + /// Determines the initial visibility of the navigation UI on map initialization. + /// + /// By default set to [NavigationUIEnabledPreference.automatic], + /// meaning the navigation UI gets enabled if the navigation + /// session has already been successfully started. + /// + /// If set to [NavigationUIEnabledPreference.disabled] the navigation view + /// initially displays a classic map view. + /// + /// Note on Android enabling the navigation UI for the view requires that the + /// navigation session has already been successfully started with + /// [GoogleMapsNavigator.initializeNavigationSession]. On iOS accepting + /// the terms and conditions is enough. + final NavigationUIEnabledPreference initialNavigationUIEnabledPreference; + + /// Which gestures should be forwarded to the PlatformView. + /// + /// When this set is empty, the map will only handle pointer events for gestures that + /// were not claimed by any other gesture recognizer. + /// + /// See [PlatformViewSurface.gestureRecognizers] for details. + final Set> gestureRecognizers; + + /// On recenter button clicked event callback. + final OnRecenterButtonClicked? onRecenterButtonClicked; + + /// On marker clicked callback. + final OnMarkerClicked? onMarkerClicked; + + /// On marker drag callback. + final OnMarkerDrag? onMarkerDrag; + + /// On marker drag start callback. + final OnMarkerDragStart? onMarkerDragStart; + + /// On marker drag end callback. + final OnMarkerDragEnd? onMarkerDragEnd; + + /// On marker info window clicked callback. + final OnMarkerInfoWindowClicked? onMarkerInfoWindowClicked; + + /// On marker info window closed callback. + final OnMarkerInfoWindowClosed? onMarkerInfoWindowClosed; + + /// On marker info window long clicked callback. + final OnMarkerInfoWindowLongClicked? onMarkerInfoWindowLongClicked; + + /// On map clicked callback. + final OnMapClicked? onMapClicked; + + /// On map long clicked callback. + final OnMapLongClicked? onMapLongClicked; + + /// On polygon clicked callback. + final OnPolygonClicked? onPolygonClicked; + + /// On polyline clicked callback. + final OnPolylineClicked? onPolylineClicked; + + /// On circle clicked callback. + final OnCircleClicked? onCircleClicked; + + /// On navigation UI enabled changed callback. + final OnNavigationUIEnabledChanged? onNavigationUIEnabledChanged; + + /// On my location clicked callback. + final OnMyLocationClicked? onMyLocationClicked; + + /// On my location button clicked callback. + final OnMyLocationButtonClicked? onMyLocationButtonClicked; + + /// On camera move started callback. + final OnCameraMoveStarted? onCameraMoveStarted; + + /// On camera move callback. + final OnCameraMove? onCameraMove; + + /// On camera idle callback. + final OnCameraIdle? onCameraIdle; + + /// On camera started following location callback (Android-only). + final OnCameraStartedFollowingLocation? onCameraStartedFollowingLocation; + + /// On camera stopped following location callback (Android-only). + final OnCameraStoppedFollowingLocation? onCameraStoppedFollowingLocation; + + /// Creates a [State] for this [GoogleMapsNavigationView]. + @override + State createState() => GoogleMapsNavigationViewState(); +} + +/// Google Maps Navigation. +/// {@category Navigation View} +class GoogleMapsNavigationViewState extends State { + @override + Widget build(BuildContext context) { + return GoogleMapsNavigationPlatform.instance.buildNavigationView( + initializationOptions: MapViewInitializationOptions( + layoutDirection: widget.layoutDirection ?? + Directionality.maybeOf(context) ?? + TextDirection.ltr, + gestureRecognizers: widget.gestureRecognizers, + mapOptions: MapOptions( + cameraPosition: widget.initialCameraPosition, + mapType: widget.initialMapType, + compassEnabled: widget.initialCompassEnabled, + rotateGesturesEnabled: widget.initialRotateGesturesEnabled, + scrollGesturesEnabled: widget.initialScrollGesturesEnabled, + tiltGesturesEnabled: widget.initialTiltGesturesEnabled, + zoomGesturesEnabled: widget.initialZoomGesturesEnabled, + scrollGesturesEnabledDuringRotateOrZoom: + widget.initialScrollGesturesEnabledDuringRotateOrZoom, + mapToolbarEnabled: widget.initialMapToolbarEnabled, + minZoomPreference: widget.initialMinZoomPreference, + maxZoomPreference: widget.initialMaxZoomPreference, + zoomControlsEnabled: widget.initialZoomControlsEnabled, + cameraTargetBounds: widget.initialCameraTargetBounds, + ), + navigationViewOptions: NavigationViewOptions( + navigationUIEnabledPreference: + widget.initialNavigationUIEnabledPreference)), + onMapReady: _onPlatformViewCreated); + } + + /// Callback method when platform view is created. + void _onPlatformViewCreated(int viewId) { + final GoogleNavigationViewController viewController = + GoogleNavigationViewController(viewId, this); + widget.onViewCreated(viewController); + } +} diff --git a/lib/src/google_maps_navigation_view_controller.dart b/lib/src/google_maps_navigation_view_controller.dart new file mode 100644 index 0000000..bcc2115 --- /dev/null +++ b/lib/src/google_maps_navigation_view_controller.dart @@ -0,0 +1,681 @@ +import '../google_navigation_flutter.dart'; +import 'google_navigation_flutter_platform_interface.dart'; + +/// Navigation View Controller class to handle navigation view events. +/// {@category Navigation View} +class GoogleNavigationViewController { + /// Basic constructor. + /// + /// Don't create this directly, but access through + /// [GoogleMapsNavigationView.onViewCreated] callback. + GoogleNavigationViewController(this._viewId, [this._viewState]) + : settings = NavigationViewUISettings(_viewId) { + _initListeners(); + } + + final int _viewId; + + final GoogleMapsNavigationViewState? _viewState; + + /// Settings for the user interface of the map. + final NavigationViewUISettings settings; + + /// Getter for view ID. + int getViewId() { + return _viewId; + } + + /// Initializes the event channel listeners for the navigation view instance. + void _initListeners() { + _setOnMapClickedListeners(); + _setOnRecenterButtonClickedListener(); + _setOnMarkerClickedListeners(); + _setOnMarkerDragListeners(); + _setOnPolygonClickedListener(); + _setOnPolylineClickedListener(); + _setOnCircleClickedListener(); + _setOnNavigationUIEnabledChangedListener(); + _setOnMyLocationClickedListener(); + _setOnMyLocationButtonClickedListener(); + _setOnCameraChangedListener(); + } + + /// Sets the event channel listener for the map click event listeners. + void _setOnMapClickedListeners() { + if (_viewState != null) { + if (_viewState.widget.onMapClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMapClickEventStream(viewId: _viewId) + .listen((MapClickEvent event) { + _viewState.widget.onMapClicked!(event.target); + }); + } + if (_viewState.widget.onMapLongClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMapLongClickEventStream(viewId: _viewId) + .listen((MapLongClickEvent event) { + _viewState.widget.onMapLongClicked!(event.target); + }); + } + } + } + + /// Sets the event channel listener for the on recenter button clicked event. + void _setOnRecenterButtonClickedListener() { + if (_viewState != null && + _viewState.widget.onRecenterButtonClicked != null) { + GoogleMapsNavigationPlatform.instance + .getNavigationRecenterButtonClickedEventStream(viewId: _viewId) + .listen(_viewState.widget.onRecenterButtonClicked); + } + } + + /// Sets the event channel listener for the marker clicked events. + void _setOnMarkerClickedListeners() { + GoogleMapsNavigationPlatform.instance + .getMarkerEventStream(viewId: _viewId) + .listen((MarkerEvent event) { + switch (event.eventType) { + case MarkerEventType.clicked: + _viewState?.widget.onMarkerClicked?.call(event.markerId); + case MarkerEventType.infoWindowClicked: + _viewState?.widget.onMarkerInfoWindowClicked?.call(event.markerId); + case MarkerEventType.infoWindowClosed: + _viewState?.widget.onMarkerInfoWindowClosed?.call(event.markerId); + case MarkerEventType.infoWindowLongClicked: + _viewState?.widget.onMarkerInfoWindowLongClicked + ?.call(event.markerId); + } + }); + } + + /// Sets the event channel listener for the on my location clicked event. + void _setOnMyLocationClickedListener() { + if (_viewState != null && _viewState.widget.onMyLocationClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMyLocationClickedEventStream(viewId: _viewId) + .listen(_viewState.widget.onMyLocationClicked); + } + } + + /// Sets the event channel listener for the on my location button clicked event. + void _setOnMyLocationButtonClickedListener() { + if (_viewState != null && + _viewState.widget.onMyLocationButtonClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMyLocationButtonClickedEventStream(viewId: _viewId) + .listen(_viewState.widget.onMyLocationButtonClicked); + } + } + + /// Sets the event channel listener for camera changed events. + void _setOnCameraChangedListener() { + // Register listeners if any of the callbacks are not null. + if (_viewState?.widget.onCameraMoveStarted != null || + _viewState?.widget.onCameraMove != null || + _viewState?.widget.onCameraIdle != null) { + GoogleMapsNavigationPlatform.instance + .registerOnCameraChangedListener(viewId: _viewId); + } + GoogleMapsNavigationPlatform.instance + .getCameraChangedEventStream(viewId: _viewId) + .listen((CameraChangedEvent event) { + switch (event.eventType) { + case CameraEventType.moveStartedByApi: + _viewState?.widget.onCameraMoveStarted?.call(event.position, false); + case CameraEventType.moveStartedByGesture: + _viewState?.widget.onCameraMoveStarted?.call(event.position, true); + case CameraEventType.onCameraMove: + _viewState?.widget.onCameraMove?.call(event.position); + case CameraEventType.onCameraIdle: + _viewState?.widget.onCameraIdle?.call(event.position); + case CameraEventType.onCameraStartedFollowingLocation: + _viewState?.widget.onCameraStartedFollowingLocation + ?.call(event.position); + case CameraEventType.onCameraStoppedFollowingLocation: + _viewState?.widget.onCameraStoppedFollowingLocation + ?.call(event.position); + } + }); + } + + /// Sets the event channel listener for the marker drag event. + void _setOnMarkerDragListeners() { + GoogleMapsNavigationPlatform.instance + .getMarkerDragEventStream(viewId: _viewId) + .listen((MarkerDragEvent event) { + switch (event.eventType) { + case MarkerDragEventType.drag: + _viewState?.widget.onMarkerDrag?.call(event.markerId, event.position); + case MarkerDragEventType.dragEnd: + _viewState?.widget.onMarkerDragEnd + ?.call(event.markerId, event.position); + case MarkerDragEventType.dragStart: + _viewState?.widget.onMarkerDragStart + ?.call(event.markerId, event.position); + } + }); + } + + /// Sets the event channel listener for the polygon clicked event. + void _setOnPolygonClickedListener() { + GoogleMapsNavigationPlatform.instance + .getPolygonClickedEventStream(viewId: _viewId) + .listen((PolygonClickedEvent event) { + _viewState?.widget.onPolygonClicked?.call(event.polygonId); + }); + } + + /// Sets the event channel listener for the polyline clicked event. + void _setOnPolylineClickedListener() { + GoogleMapsNavigationPlatform.instance + .getPolylineClickedEventStream(viewId: _viewId) + .listen((PolylineClickedEvent event) { + _viewState?.widget.onPolylineClicked?.call(event.polylineId); + }); + } + + /// Sets the event channel listener for the circle clicked event. + void _setOnCircleClickedListener() { + GoogleMapsNavigationPlatform.instance + .getCircleClickedEventStream(viewId: _viewId) + .listen((CircleClickedEvent event) { + _viewState?.widget.onCircleClicked?.call(event.circleId); + }); + } + + /// Sets the event channel listener for the navigation UI enabled changed event. + void _setOnNavigationUIEnabledChangedListener() { + GoogleMapsNavigationPlatform.instance + .getNavigationUIEnabledChangedEventStream(viewId: _viewId) + .listen((NavigationUIEnabledChangedEvent event) { + _viewState?.widget.onNavigationUIEnabledChanged + ?.call(event.navigationUIEnabled); + }); + } + + /// Change status of my location enabled. + /// + /// By default, the my location layer is disabled, but gets + /// automatically enabled on Android when the navigation starts. + /// + /// On iOS this property doesn't control the my location indication during + /// the navigation. + Future setMyLocationEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance + .setMyLocationEnabled(viewId: _viewId, enabled: enabled); + } + + /// This method returns the current map type of the Google Maps view instance. + Future getMapType() { + return GoogleMapsNavigationPlatform.instance.getMapType(viewId: _viewId); + } + + /// Changes the type of the map being displayed on the Google Maps view. + /// + /// The [mapType] parameter specifies the new map type to be set. + /// It should be one of the values defined in the [MapType] enum, + /// such as [MapType.normal], [MapType.satellite], [MapType.terrain], + /// or [MapType.hybrid]. + /// + /// Example usage: + /// ```dart + /// _navigationViewController.changeMapType(MapType.satellite); + /// ``` + Future setMapType({required MapType mapType}) async { + return GoogleMapsNavigationPlatform.instance + .setMapType(viewId: _viewId, mapType: mapType); + } + + /// Sets the styling of the base map using a string containing JSON. + /// Null value will reset the base map to default style. + /// If [styleJson] is invalid throws [MapStyleException]. + /// + /// For more details see the official documentation: + /// https://developers.google.com/maps/documentation/ios-sdk/styling + /// https://developers.google.com/maps/documentation/android-sdk/styling + Future setMapStyle(String? styleJson) async { + return GoogleMapsNavigationPlatform.instance + .setMapStyle(_viewId, styleJson); + } + + /// Gets whether the my location is enabled or disabled. + /// + /// By default, the my location layer is disabled, but gets + /// automatically enabled on Android when the navigation starts. + /// + /// On iOS this property doesn't control the my location indication during + /// the navigation. + Future isMyLocationEnabled() async { + return GoogleMapsNavigationPlatform.instance + .isMyLocationEnabled(viewId: _viewId); + } + + /// Ask the camera to follow the user's location. + /// + /// Use [perspective] to specify the orientation of the camera + /// and optional [zoomLevel] to control the map zoom. + /// + /// Automatically started in the perspective [CameraPerspective.tilted] when + /// the navigation is initialized with [GoogleMapsNavigator.initializeNavigationSession] + /// or when navigation UI gets re-enabled with [setNavigationUIEnabled]. + /// + /// In Android, you can use [GoogleMapsNavigationView.onCameraStartedFollowingLocation] + /// and [GoogleMapsNavigationView.onCameraStoppedFollowingLocation] callbacks + /// to detect when the follow location mode is enabled or disabled. + /// + /// Note there are small differences on how Android and iOS handle the camera + /// during the follow my location mode (tilt, zoom, transitions, etc.). + /// + /// See also [GoogleMapsNavigator.startGuidance], [showRouteOverview] and [animateCamera]. + Future followMyLocation(CameraPerspective perspective, + {double? zoomLevel}) async { + return GoogleMapsNavigationPlatform.instance.followMyLocation( + viewId: _viewId, perspective: perspective, zoomLevel: zoomLevel); + } + + /// Gets user's current location. + Future getMyLocation() async { + return GoogleMapsNavigationPlatform.instance.getMyLocation(viewId: _viewId); + } + + /// Gets the current visible map region or camera bounds. + Future getVisibleRegion() async { + return GoogleMapsNavigationPlatform.instance + .getVisibleRegion(viewId: _viewId); + } + + /// Gets the current position of the camera. + Future getCameraPosition() async { + return GoogleMapsNavigationPlatform.instance + .getCameraPosition(viewId: _viewId); + } + + /// Animates the movement of the camera from the current position + /// to the position defined in the [cameraUpdate]. + /// + /// See [CameraUpdate] for more information on how to create different camera + /// animations. + /// + /// On Android you can override the default animation [duration] and + /// set [onFinished] callback that is called when the animation completes + /// (passes true) or is cancelled (passes false). + /// + /// Example usage: + /// ```dart + /// controller.animateCamera(CameraUpdate.zoomIn(), + /// duration: Duration(milliseconds: 600), + /// onFinished: (bool success) => {}); + /// ``` + /// On iOS [duration] and [onFinished] are not supported and defining them + /// does nothing. + /// + /// See also [moveCamera], [followMyLocation], [showRouteOverview]. + Future animateCamera(CameraUpdate cameraUpdate, + {Duration? duration, AnimationFinishedCallback? onFinished}) { + return GoogleMapsNavigationPlatform.instance.animateCamera( + viewId: _viewId, + cameraUpdate: cameraUpdate, + duration: duration?.inMilliseconds, + onFinished: onFinished); + } + + /// Moves the camera from the current position to the position + /// defined in the [cameraUpdate]. + /// + /// See [CameraUpdate] for more information + /// on how to create different camera movements. + Future moveCamera(CameraUpdate cameraUpdate) { + return GoogleMapsNavigationPlatform.instance + .moveCamera(viewId: _viewId, cameraUpdate: cameraUpdate); + } + + /// Is the navigation trip progress bar enabled. + Future isNavigationTripProgressBarEnabled() { + return GoogleMapsNavigationPlatform.instance + .isNavigationTripProgressBarEnabled(viewId: _viewId); + } + + /// Enable or disable the navigation trip progress bar. + /// + /// By default, the navigation trip progress bar is disabled. + Future setNavigationTripProgressBarEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance + .setNavigationTripProgressBarEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Is the navigation header enabled. + Future isNavigationHeaderEnabled() { + return GoogleMapsNavigationPlatform.instance + .isNavigationHeaderEnabled(viewId: _viewId); + } + + /// Enable or disable the navigation header. + /// + /// By default, the navigation header is enabled. + Future setNavigationHeaderEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setNavigationHeaderEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Is the navigation footer enabled. + Future isNavigationFooterEnabled() { + return GoogleMapsNavigationPlatform.instance + .isNavigationFooterEnabled(viewId: _viewId); + } + + /// Enable or disable the navigation footer. + /// + /// By default, the navigation footer is enabled. + /// + /// Also known as ETA card, for example in Android + /// calls [setEtaCardEnabled().](https://developers.google.com/maps/documentation/navigation/android-sdk/v1/reference/com/google/android/libraries/navigation/NavigationView#setEtaCardEnabled(boolean)) + Future setNavigationFooterEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setNavigationFooterEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Is the recenter button enabled. + Future isRecenterButtonEnabled() { + return GoogleMapsNavigationPlatform.instance + .isRecenterButtonEnabled(viewId: _viewId); + } + + /// Enable or disable the recenter button. + /// + /// By default, the recenter button is enabled. + Future setRecenterButtonEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setRecenterButtonEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Can the speed limit indication be displayed. + Future isSpeedLimitIconEnabled() { + return GoogleMapsNavigationPlatform.instance + .isSpeedLimitIconEnabled(viewId: _viewId); + } + + /// Allow showing the speed limit indicator. + /// + /// By default, the speed limit is not displayed. + Future setSpeedLimitIconEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setSpeedLimitIconEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Can the speedometer be displayed. + Future isSpeedometerEnabled() { + return GoogleMapsNavigationPlatform.instance + .isSpeedometerEnabled(viewId: _viewId); + } + + /// Allow showing the speedometer. + /// + /// By default, the speedometer is not displayed. + Future setSpeedometerEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setSpeedometerEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Are the incident cards displayed. + Future isTrafficIncidentCardsEnabled() { + return GoogleMapsNavigationPlatform.instance + .isTrafficIncidentCardsEnabled(viewId: _viewId); + } + + /// Enable or disable showing of the incident cards. + /// + /// By default, the incident cards are shown. + Future setTrafficIncidentCardsEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setTrafficIncidentCardsEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Check if the navigation user interface is shown. + Future isNavigationUIEnabled() { + return GoogleMapsNavigationPlatform.instance + .isNavigationUIEnabled(viewId: _viewId); + } + + /// Show or hide the navigation user interface shown on top of the map. + /// + /// When enabled also actives [followMyLocation] camera mode. + /// + /// Disabling hides routes on iOS, but on Android the routes stay visible. + /// + /// By default, the navigation UI is enabled when the session has been + /// initialized with [GoogleMapsNavigator.initializeNavigationSession]. + /// + /// Fails on Android if the navigation session has not been initialized, + /// and on iOS if the terms and conditions have not been accepted. + Future setNavigationUIEnabled(bool enabled) { + return GoogleMapsNavigationPlatform.instance.setNavigationUIEnabled( + viewId: _viewId, + enabled: enabled, + ); + } + + /// Move the map camera to show the route overview. + /// + /// See also [followMyLocation] and [animateCamera]. + Future showRouteOverview() { + return GoogleMapsNavigationPlatform.instance.showRouteOverview( + viewId: _viewId, + ); + } + + /// Returns the minimum zoom level preference from the map view. + /// If minimum zoom preference is not set previously, returns minimum possible + /// zoom level for the current map type. + Future getMinZoomPreference() { + return GoogleMapsNavigationPlatform.instance + .getMinZoomPreference(viewId: _viewId); + } + + /// Returns the maximum zoom level preference from the map view. + /// If maximum zoom preference is not set previously, returns maximum possible + /// zoom level for the current map type. + Future getMaxZoomPreference() { + return GoogleMapsNavigationPlatform.instance + .getMaxZoomPreference(viewId: _viewId); + } + + /// Removes any previously specified upper and lower zoom bounds. + Future resetMinMaxZoomPreference() { + return GoogleMapsNavigationPlatform.instance + .resetMinMaxZoomPreference(viewId: _viewId); + } + + /// Sets a preferred lower bound for the camera zoom. + /// + /// When the minimum zoom changes, the SDK adjusts all later camera updates + /// to respect that minimum if possible. Note that there are technical + /// considerations that may prevent the SDK from allowing users to zoom too low. + /// + /// Throws [MinZoomRangeException] if [minZoomPreference] is + /// greater than maximum zoom lavel. + Future setMinZoomPreference(double minZoomPreference) { + return GoogleMapsNavigationPlatform.instance.setMinZoomPreference( + viewId: _viewId, minZoomPreference: minZoomPreference); + } + + /// Sets a preferred upper bound for the camera zoom. + /// + /// When the maximum zoom changes, the SDK adjusts all later camera updates + /// to respect that maximum if possible. Note that there are technical + /// considerations that may prevent the SDK from allowing users to zoom too + /// deep into the map. For example, satellite or terrain may have a lower + /// maximum zoom than the base map tiles. + /// + /// Throws [MaxZoomRangeException] if [maxZoomPreference] is + /// less than minimum zoom lavel. + Future setMaxZoomPreference(double maxZoomPreference) { + return GoogleMapsNavigationPlatform.instance.setMaxZoomPreference( + viewId: _viewId, maxZoomPreference: maxZoomPreference); + } + + /// Retrieves all markers that have been added to the map view. + Future> getMarkers() { + return GoogleMapsNavigationPlatform.instance.getMarkers(viewId: _viewId); + } + + /// Add markers to the map view. + Future> addMarkers(List markerOptions) { + return GoogleMapsNavigationPlatform.instance + .addMarkers(viewId: _viewId, markerOptions: markerOptions); + } + + /// Update markers to the map view. + /// + /// Throws [MarkerNotFoundException] if the [markers] list contains one or + /// more markers that have not been added to the map view via [addMarkers] or + /// contains markers that have already been removed from the map view. + Future> updateMarkers(List markers) async { + return GoogleMapsNavigationPlatform.instance + .updateMarkers(viewId: _viewId, markers: markers); + } + + /// Remove markers from the map view. + /// + /// Throws [MarkerNotFoundException] if the [markers] list contains one or + /// more markers that have not been added to the map view via [addMarkers] or + /// contains markers that have already been removed from the map view. + Future removeMarkers(List markers) async { + return GoogleMapsNavigationPlatform.instance + .removeMarkers(viewId: _viewId, markers: markers); + } + + /// Remove all markers from the map view. + Future clearMarkers() { + return GoogleMapsNavigationPlatform.instance.clearMarkers(viewId: _viewId); + } + + /// Retrieves all polygons that have been added to the map view. + Future> getPolygons() { + return GoogleMapsNavigationPlatform.instance.getPolygons(viewId: _viewId); + } + + /// Add polygons to the map view. + Future> addPolygons(List polygonOptions) { + return GoogleMapsNavigationPlatform.instance + .addPolygons(viewId: _viewId, polygonOptions: polygonOptions); + } + + /// Update polygons to the map view. + /// + /// Throws [PolygonNotFoundException] if the [polygons] list contains + /// polygon that has not beed added to the map view via [addPolygons] or + /// contains polygon that has already been removed from the map view. + Future> updatePolygons(List polygons) async { + return GoogleMapsNavigationPlatform.instance + .updatePolygons(viewId: _viewId, polygons: polygons); + } + + /// Remove polygons from the map view. + /// + /// Throws [PolygonNotFoundException] if the [polygons] list contains + /// polygon that has not beed added to the map view via [addPolygons] or + /// contains polygon that has already been removed from the map view. + Future removePolygons(List polygons) async { + return GoogleMapsNavigationPlatform.instance + .removePolygons(viewId: _viewId, polygons: polygons); + } + + /// Remove all polygons from the map view. + Future clearPolygons() { + return GoogleMapsNavigationPlatform.instance.clearPolygons(viewId: _viewId); + } + + /// Retrieves all polylines that have been added to the map view. + Future> getPolylines() { + return GoogleMapsNavigationPlatform.instance.getPolylines(viewId: _viewId); + } + + /// Add polylines to the map view. + Future> addPolylines(List polylineOptions) { + return GoogleMapsNavigationPlatform.instance + .addPolylines(viewId: _viewId, polylineOptions: polylineOptions); + } + + /// Update polylines to the map view. + /// + /// Throws [PolylineNotFoundException] if the [polylines] list contains + /// polyline that has not beed added to the map view via [addPolylines] or + /// contains polyline that has already been removed from the map view. + Future> updatePolylines(List polylines) async { + return GoogleMapsNavigationPlatform.instance + .updatePolylines(viewId: _viewId, polylines: polylines); + } + + /// Remove polylines from the map view. + /// + /// Throws [PolylineNotFoundException] if the [polylines] list contains + /// polyline that has not beed added to the map view via [addPolylines] or + /// contains polyline that has already been removed from the map view. + Future removePolylines(List polylines) async { + return GoogleMapsNavigationPlatform.instance + .removePolylines(viewId: _viewId, polylines: polylines); + } + + /// Remove all polylines from the map view. + Future clearPolylines() { + return GoogleMapsNavigationPlatform.instance + .clearPolylines(viewId: _viewId); + } + + /// Gets all circles from the map view. + Future> getCircles() { + return GoogleMapsNavigationPlatform.instance.getCircles(viewId: _viewId); + } + + /// Add circles to the map view. + Future> addCircles(List options) { + return GoogleMapsNavigationPlatform.instance + .addCircles(viewId: _viewId, options: options); + } + + /// Update circles to the map view. + /// + /// Throws [CircleNotFoundException] if the [circles] list contains one or + /// more circles that have not been added to the map view via [addCircles] or + /// contains circles that have already been removed from the map view. + Future> updateCircles(List circles) async { + return GoogleMapsNavigationPlatform.instance + .updateCircles(viewId: _viewId, circles: circles); + } + + /// Remove circles from the map view. + /// + /// Throws [CircleNotFoundException] if the [circles] list contains one or + /// more circles that have not been added to the map view via [addCircles] or + /// contains circles that have already been removed from the map view. + Future removeCircles(List circles) async { + return GoogleMapsNavigationPlatform.instance + .removeCircles(viewId: _viewId, circles: circles); + } + + /// Remove all circles from the map view. + Future clearCircles() { + return GoogleMapsNavigationPlatform.instance.clearCircles(viewId: _viewId); + } + + /// Remove all markers, polylines, polygons, overlays, etc from the map view. + Future clear() { + return GoogleMapsNavigationPlatform.instance.clear(viewId: _viewId); + } +} diff --git a/lib/src/google_navigation_flutter.dart b/lib/src/google_navigation_flutter.dart index 029d0bb..ebd0243 100644 --- a/lib/src/google_navigation_flutter.dart +++ b/lib/src/google_navigation_flutter.dart @@ -14,10 +14,6 @@ import 'dart:async'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/gestures.dart'; -import 'package:flutter/material.dart'; - import '../google_navigation_flutter.dart'; import 'google_navigation_flutter_platform_interface.dart'; @@ -163,283 +159,6 @@ typedef OnCameraStartedFollowingLocation = void Function( typedef OnCameraStoppedFollowingLocation = void Function( CameraPosition position); -/// The main map view widget for Google Maps Navigation. -/// {@category Navigation View} -class GoogleMapsNavigationView extends StatefulWidget { - /// The main widget for embedding Google Maps Navigation into a Flutter application. - /// - /// After creating the map view, the [onViewCreated] callback is triggered, providing a - /// [GoogleNavigationViewController] that you can use to interact with the map programmatically. - /// - /// Example usage: - /// ```dart - /// GoogleMapsNavigationView( - /// onViewCreated: (controller) { - /// // Use the controller to interact with the map. - /// }, - /// initialCameraPosition: CameraPosition( - /// // Initial camera position parameters - /// ), - /// // Other initial map settings... - /// ) - /// ``` - const GoogleMapsNavigationView( - {super.key, - required this.onViewCreated, - this.initialCameraPosition = const CameraPosition(), - this.initialMapType = MapType.normal, - this.initialCompassEnabled = true, - this.initialRotateGesturesEnabled = true, - this.initialScrollGesturesEnabled = true, - this.initialTiltGesturesEnabled = true, - this.initialZoomGesturesEnabled = true, - this.initialScrollGesturesEnabledDuringRotateOrZoom = true, - this.initialMapToolbarEnabled = true, - this.initialMinZoomPreference, - this.initialMaxZoomPreference, - this.initialZoomControlsEnabled = true, - this.initialCameraTargetBounds, - this.initialNavigationUIEnabledPreference = - NavigationUIEnabledPreference.automatic, - this.layoutDirection, - this.gestureRecognizers = const >{}, - this.onRecenterButtonClicked, - this.onMarkerClicked, - this.onMarkerDrag, - this.onMarkerDragStart, - this.onMarkerDragEnd, - this.onMarkerInfoWindowClicked, - this.onMarkerInfoWindowClosed, - this.onMarkerInfoWindowLongClicked, - this.onMapClicked, - this.onMapLongClicked, - this.onPolygonClicked, - this.onPolylineClicked, - this.onCircleClicked, - this.onNavigationUIEnabledChanged, - this.onMyLocationClicked, - this.onMyLocationButtonClicked, - this.onCameraMoveStarted, - this.onCameraMove, - this.onCameraIdle, - this.onCameraStartedFollowingLocation, - this.onCameraStoppedFollowingLocation}); - - /// On view created callback. - final OnCreatedCallback onViewCreated; - - /// The initial positioning of the camera in the map view. - final CameraPosition initialCameraPosition; - - /// The directionality to be used for text layout within the embedded view. - final TextDirection? layoutDirection; - - /// The type of map to display, specified using [MapType] enum values. - final MapType initialMapType; - - /// Specifies whether the compass should be enabled. - /// - /// The compass is an icon on the map that indicates the direction of north on the map. - /// If enabled, it is only shown when the camera is tilted or rotated away from - /// its default orientation (tilt of 0 and a bearing of 0). - /// - /// By default, the compass is enabled. - final bool initialCompassEnabled; - - /// Specifies whether rotate gestures should be enabled. - /// - /// If enabled, users can use a two-finger rotate gesture to rotate the camera. - /// If disabled, users cannot rotate the camera via gestures. - /// This setting doesn't restrict the user from tapping the compass icon to reset the camera orientation, - /// nor does it restrict programmatic movements and animation of the camera. - /// - /// By default, the rotation gestures are enabled. - final bool initialRotateGesturesEnabled; - - /// Specifies whether scroll gestures should be enabled. - /// - /// By default, the scroll gestures are enabled. - final bool initialScrollGesturesEnabled; - - /// Specifies whether tilt gestures should be enabled. - /// - /// By default, the tilt gestures are enabled. - final bool initialTiltGesturesEnabled; - - /// Specifies whether zoom gestures should be enabled. - /// - /// By default, the zoom gestures enabled. - final bool initialZoomGesturesEnabled; - - /// Specifies whether scroll gestures during rotate or zoom should be enabled. - /// - /// If enabled, users can swipe to pan the camera. If disabled, swiping has no effect. - /// This setting doesn't restrict programmatic movement and animation of the camera. - /// - /// By default, the zoom gestures enabled. - final bool initialScrollGesturesEnabledDuringRotateOrZoom; - - /// Specifies whether the map toolbar should be enabled. Only applicable on Android. - /// - /// If enabled, and the map toolbar can be shown in the current context, - /// users will see a bar with various context-dependent actions. - /// - /// By default, the map toolbar is enabled. - final bool initialMapToolbarEnabled; - - /// Specifies a preferred lower bound for camera zoom. - /// - /// Null by default (not limited). - final double? initialMinZoomPreference; - - /// Specifies a preferred upper bound for camera zoom. - /// - /// Null by default (not limited). - final double? initialMaxZoomPreference; - - /// Specifies whether the zoom controls should be enabled. Only applicable on Android. - /// - /// By default, the zoom controls are enabled. - final bool initialZoomControlsEnabled; - - /// Specifies a bounds to constrain the camera target, so that when users scroll and pan the map, - /// the camera target does not move outside these bounds. - /// - /// Null by default (unbounded). - final LatLngBounds? initialCameraTargetBounds; - - /// Determines the initial visibility of the navigation UI on map initialization. - /// - /// By default set to [NavigationUIEnabledPreference.automatic], - /// meaning the navigation UI gets enabled if the navigation - /// session has already been successfully started. - /// - /// If set to [NavigationUIEnabledPreference.disabled] the navigation view - /// initially displays a classic map view. - /// - /// Note on Android enabling the navigation UI for the view requires that the - /// navigation session has already been successfully started with - /// [GoogleMapsNavigator.initializeNavigationSession]. On iOS accepting - /// the terms and conditions is enough. - final NavigationUIEnabledPreference initialNavigationUIEnabledPreference; - - /// Which gestures should be forwarded to the PlatformView. - /// - /// When this set is empty, the map will only handle pointer events for gestures that - /// were not claimed by any other gesture recognizer. - /// - /// See [PlatformViewSurface.gestureRecognizers] for details. - final Set> gestureRecognizers; - - /// On recenter button clicked event callback. - final OnRecenterButtonClicked? onRecenterButtonClicked; - - /// On marker clicked callback. - final OnMarkerClicked? onMarkerClicked; - - /// On marker drag callback. - final OnMarkerDrag? onMarkerDrag; - - /// On marker drag start callback. - final OnMarkerDragStart? onMarkerDragStart; - - /// On marker drag end callback. - final OnMarkerDragEnd? onMarkerDragEnd; - - /// On marker info window clicked callback. - final OnMarkerInfoWindowClicked? onMarkerInfoWindowClicked; - - /// On marker info window closed callback. - final OnMarkerInfoWindowClosed? onMarkerInfoWindowClosed; - - /// On marker info window long clicked callback. - final OnMarkerInfoWindowLongClicked? onMarkerInfoWindowLongClicked; - - /// On map clicked callback. - final OnMapClicked? onMapClicked; - - /// On map long clicked callback. - final OnMapLongClicked? onMapLongClicked; - - /// On polygon clicked callback. - final OnPolygonClicked? onPolygonClicked; - - /// On polyline clicked callback. - final OnPolylineClicked? onPolylineClicked; - - /// On circle clicked callback. - final OnCircleClicked? onCircleClicked; - - /// On navigation UI enabled changed callback. - final OnNavigationUIEnabledChanged? onNavigationUIEnabledChanged; - - /// On my location clicked callback. - final OnMyLocationClicked? onMyLocationClicked; - - /// On my location button clicked callback. - final OnMyLocationButtonClicked? onMyLocationButtonClicked; - - /// On camera move started callback. - final OnCameraMoveStarted? onCameraMoveStarted; - - /// On camera move callback. - final OnCameraMove? onCameraMove; - - /// On camera idle callback. - final OnCameraIdle? onCameraIdle; - - /// On camera started following location callback (Android-only). - final OnCameraStartedFollowingLocation? onCameraStartedFollowingLocation; - - /// On camera stopped following location callback (Android-only). - final OnCameraStoppedFollowingLocation? onCameraStoppedFollowingLocation; - - /// Creates a [State] for this [GoogleMapsNavigationView]. - @override - State createState() => GoogleMapsNavigationViewState(); -} - -/// Google Maps Navigation. -/// {@category Navigation View} -class GoogleMapsNavigationViewState extends State { - @override - Widget build(BuildContext context) { - return GoogleMapsNavigationPlatform.instance.buildView( - initializationOptions: NavigationViewInitializationOptions( - layoutDirection: widget.layoutDirection ?? - Directionality.maybeOf(context) ?? - TextDirection.ltr, - gestureRecognizers: widget.gestureRecognizers, - mapOptions: MapOptions( - cameraPosition: widget.initialCameraPosition, - mapType: widget.initialMapType, - compassEnabled: widget.initialCompassEnabled, - rotateGesturesEnabled: widget.initialRotateGesturesEnabled, - scrollGesturesEnabled: widget.initialScrollGesturesEnabled, - tiltGesturesEnabled: widget.initialTiltGesturesEnabled, - zoomGesturesEnabled: widget.initialZoomGesturesEnabled, - scrollGesturesEnabledDuringRotateOrZoom: - widget.initialScrollGesturesEnabledDuringRotateOrZoom, - mapToolbarEnabled: widget.initialMapToolbarEnabled, - minZoomPreference: widget.initialMinZoomPreference, - maxZoomPreference: widget.initialMaxZoomPreference, - zoomControlsEnabled: widget.initialZoomControlsEnabled, - cameraTargetBounds: widget.initialCameraTargetBounds, - ), - navigationViewOptions: NavigationViewOptions( - navigationUIEnabledPreference: - widget.initialNavigationUIEnabledPreference)), - onMapReady: _onPlatformViewCreated); - } - - /// Callback method when platform view is created. - void _onPlatformViewCreated(int viewId) { - final GoogleNavigationViewController viewController = - GoogleNavigationViewController(viewId, this); - widget.onViewCreated(viewController); - } -} - /// Settings for the user interface of the map. /// {@category Navigation View} class NavigationViewUISettings { @@ -624,687 +343,6 @@ class NavigationViewUISettings { } } -/// Navigation View Controller class to handle navigation view events. -/// {@category Navigation View} -class GoogleNavigationViewController { - /// Basic constructor. - /// - /// Don't create this directly, but access through - /// [GoogleMapsNavigationView.onViewCreated] callback. - GoogleNavigationViewController(this._viewId, [this._viewState]) - : settings = NavigationViewUISettings(_viewId) { - _initListeners(); - } - - final int _viewId; - - final GoogleMapsNavigationViewState? _viewState; - - /// Settings for the user interface of the map. - final NavigationViewUISettings settings; - - /// Getter for view ID. - int getViewId() { - return _viewId; - } - - /// Initializes the event channel listeners for the navigation view instance. - void _initListeners() { - _setOnMapClickedListeners(); - _setOnRecenterButtonClickedListener(); - _setOnMarkerClickedListeners(); - _setOnMarkerDragListeners(); - _setOnPolygonClickedListener(); - _setOnPolylineClickedListener(); - _setOnCircleClickedListener(); - _setOnNavigationUIEnabledChangedListener(); - _setOnMyLocationClickedListener(); - _setOnMyLocationButtonClickedListener(); - _setOnCameraChangedListener(); - } - - /// Sets the event channel listener for the map click event listeners. - void _setOnMapClickedListeners() { - if (_viewState != null) { - if (_viewState.widget.onMapClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMapClickEventStream(viewId: _viewId) - .listen((MapClickEvent event) { - _viewState.widget.onMapClicked!(event.target); - }); - } - if (_viewState.widget.onMapLongClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMapLongClickEventStream(viewId: _viewId) - .listen((MapLongClickEvent event) { - _viewState.widget.onMapLongClicked!(event.target); - }); - } - } - } - - /// Sets the event channel listener for the on recenter button clicked event. - void _setOnRecenterButtonClickedListener() { - if (_viewState != null && - _viewState.widget.onRecenterButtonClicked != null) { - GoogleMapsNavigationPlatform.instance - .getNavigationRecenterButtonClickedEventStream(viewId: _viewId) - .listen(_viewState.widget.onRecenterButtonClicked); - } - } - - /// Sets the event channel listener for the marker clicked events. - void _setOnMarkerClickedListeners() { - GoogleMapsNavigationPlatform.instance - .getMarkerEventStream(viewId: _viewId) - .listen((MarkerEvent event) { - switch (event.eventType) { - case MarkerEventType.clicked: - _viewState?.widget.onMarkerClicked?.call(event.markerId); - case MarkerEventType.infoWindowClicked: - _viewState?.widget.onMarkerInfoWindowClicked?.call(event.markerId); - case MarkerEventType.infoWindowClosed: - _viewState?.widget.onMarkerInfoWindowClosed?.call(event.markerId); - case MarkerEventType.infoWindowLongClicked: - _viewState?.widget.onMarkerInfoWindowLongClicked - ?.call(event.markerId); - } - }); - } - - /// Sets the event channel listener for the on my location clicked event. - void _setOnMyLocationClickedListener() { - if (_viewState != null && _viewState.widget.onMyLocationClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMyLocationClickedEventStream(viewId: _viewId) - .listen(_viewState.widget.onMyLocationClicked); - } - } - - /// Sets the event channel listener for the on my location button clicked event. - void _setOnMyLocationButtonClickedListener() { - if (_viewState != null && - _viewState.widget.onMyLocationButtonClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMyLocationButtonClickedEventStream(viewId: _viewId) - .listen(_viewState.widget.onMyLocationButtonClicked); - } - } - - /// Sets the event channel listener for camera changed events. - void _setOnCameraChangedListener() { - // Register listeners if any of the callbacks are not null. - if (_viewState?.widget.onCameraMoveStarted != null || - _viewState?.widget.onCameraMove != null || - _viewState?.widget.onCameraIdle != null) { - GoogleMapsNavigationPlatform.instance - .registerOnCameraChangedListener(viewId: _viewId); - } - GoogleMapsNavigationPlatform.instance - .getCameraChangedEventStream(viewId: _viewId) - .listen((CameraChangedEvent event) { - switch (event.eventType) { - case CameraEventType.moveStartedByApi: - _viewState?.widget.onCameraMoveStarted?.call(event.position, false); - case CameraEventType.moveStartedByGesture: - _viewState?.widget.onCameraMoveStarted?.call(event.position, true); - case CameraEventType.onCameraMove: - _viewState?.widget.onCameraMove?.call(event.position); - case CameraEventType.onCameraIdle: - _viewState?.widget.onCameraIdle?.call(event.position); - case CameraEventType.onCameraStartedFollowingLocation: - _viewState?.widget.onCameraStartedFollowingLocation - ?.call(event.position); - case CameraEventType.onCameraStoppedFollowingLocation: - _viewState?.widget.onCameraStoppedFollowingLocation - ?.call(event.position); - } - }); - } - - /// Sets the event channel listener for the marker drag event. - void _setOnMarkerDragListeners() { - GoogleMapsNavigationPlatform.instance - .getMarkerDragEventStream(viewId: _viewId) - .listen((MarkerDragEvent event) { - switch (event.eventType) { - case MarkerDragEventType.drag: - _viewState?.widget.onMarkerDrag?.call(event.markerId, event.position); - case MarkerDragEventType.dragEnd: - _viewState?.widget.onMarkerDragEnd - ?.call(event.markerId, event.position); - case MarkerDragEventType.dragStart: - _viewState?.widget.onMarkerDragStart - ?.call(event.markerId, event.position); - } - }); - } - - /// Sets the event channel listener for the polygon clicked event. - void _setOnPolygonClickedListener() { - GoogleMapsNavigationPlatform.instance - .getPolygonClickedEventStream(viewId: _viewId) - .listen((PolygonClickedEvent event) { - _viewState?.widget.onPolygonClicked?.call(event.polygonId); - }); - } - - /// Sets the event channel listener for the polyline clicked event. - void _setOnPolylineClickedListener() { - GoogleMapsNavigationPlatform.instance - .getPolylineClickedEventStream(viewId: _viewId) - .listen((PolylineClickedEvent event) { - _viewState?.widget.onPolylineClicked?.call(event.polylineId); - }); - } - - /// Sets the event channel listener for the circle clicked event. - void _setOnCircleClickedListener() { - GoogleMapsNavigationPlatform.instance - .getCircleClickedEventStream(viewId: _viewId) - .listen((CircleClickedEvent event) { - _viewState?.widget.onCircleClicked?.call(event.circleId); - }); - } - - /// Sets the event channel listener for the navigation UI enabled changed event. - void _setOnNavigationUIEnabledChangedListener() { - GoogleMapsNavigationPlatform.instance - .getNavigationUIEnabledChangedEventStream(viewId: _viewId) - .listen((NavigationUIEnabledChangedEvent event) { - _viewState?.widget.onNavigationUIEnabledChanged - ?.call(event.navigationUIEnabled); - }); - } - - /// Change status of my location enabled. - /// - /// By default, the my location layer is disabled, but gets - /// automatically enabled on Android when the navigation starts. - /// - /// On iOS this property doesn't control the my location indication during - /// the navigation. - Future setMyLocationEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance - .setMyLocationEnabled(viewId: _viewId, enabled: enabled); - } - - /// This method returns the current map type of the Google Maps view instance. - Future getMapType() { - return GoogleMapsNavigationPlatform.instance.getMapType(viewId: _viewId); - } - - /// Changes the type of the map being displayed on the Google Maps view. - /// - /// The [mapType] parameter specifies the new map type to be set. - /// It should be one of the values defined in the [MapType] enum, - /// such as [MapType.normal], [MapType.satellite], [MapType.terrain], - /// or [MapType.hybrid]. - /// - /// MapType.terrain does not work during navigation. - /// - /// Example usage: - /// ```dart - /// _navigationViewController.changeMapType(MapType.satellite); - /// ``` - Future setMapType({required MapType mapType}) async { - return GoogleMapsNavigationPlatform.instance - .setMapType(viewId: _viewId, mapType: mapType); - } - - /// Sets the styling of the base map using a string containing JSON. - /// Null value will reset the base map to default style. - /// If [styleJson] is invalid throws [MapStyleException]. - /// - /// For more details see the official documentation: - /// https://developers.google.com/maps/documentation/ios-sdk/styling - /// https://developers.google.com/maps/documentation/android-sdk/styling - Future setMapStyle(String? styleJson) async { - return GoogleMapsNavigationPlatform.instance - .setMapStyle(_viewId, styleJson); - } - - /// Gets whether the my location is enabled or disabled. - /// - /// By default, the my location layer is disabled, but gets - /// automatically enabled on Android when the navigation starts. - /// - /// On iOS this property doesn't control the my location indication during - /// the navigation. - Future isMyLocationEnabled() async { - return GoogleMapsNavigationPlatform.instance - .isMyLocationEnabled(viewId: _viewId); - } - - /// Ask the camera to follow the user's location. - /// - /// Use [perspective] to specify the orientation of the camera - /// and optional [zoomLevel] to control the map zoom. - /// - /// Automatically started in the perspective [CameraPerspective.tilted] when - /// the navigation is initialized with [GoogleMapsNavigator.initializeNavigationSession] - /// or when navigation UI gets re-enabled with [setNavigationUIEnabled]. - /// - /// In Android, you can use [GoogleMapsNavigationView.onCameraStartedFollowingLocation] - /// and [GoogleMapsNavigationView.onCameraStoppedFollowingLocation] callbacks - /// to detect when the follow location mode is enabled or disabled. - /// - /// Note there are small differences on how Android and iOS handle the camera - /// during the follow my location mode (tilt, zoom, transitions, etc.). - /// - /// See also [GoogleMapsNavigator.startGuidance], [showRouteOverview] and [animateCamera]. - Future followMyLocation(CameraPerspective perspective, - {double? zoomLevel}) async { - return GoogleMapsNavigationPlatform.instance.followMyLocation( - viewId: _viewId, perspective: perspective, zoomLevel: zoomLevel); - } - - /// Gets user's current location. - Future getMyLocation() async { - return GoogleMapsNavigationPlatform.instance.getMyLocation(viewId: _viewId); - } - - /// Gets the current visible map region or camera bounds. - Future getVisibleRegion() async { - return GoogleMapsNavigationPlatform.instance - .getVisibleRegion(viewId: _viewId); - } - - /// Gets the current position of the camera. - Future getCameraPosition() async { - return GoogleMapsNavigationPlatform.instance - .getCameraPosition(viewId: _viewId); - } - - /// Animates the movement of the camera from the current position - /// to the position defined in the [cameraUpdate]. - /// - /// See [CameraUpdate] for more information on how to create different camera - /// animations. - /// - /// On Android you can override the default animation [duration] and - /// set [onFinished] callback that is called when the animation completes - /// (passes true) or is cancelled (passes false). - /// - /// Example usage: - /// ```dart - /// controller.animateCamera(CameraUpdate.zoomIn(), - /// duration: Duration(milliseconds: 600), - /// onFinished: (bool success) => {}); - /// ``` - /// On iOS [duration] and [onFinished] are not supported and defining them - /// does nothing. - /// - /// See also [moveCamera], [followMyLocation], [showRouteOverview]. - Future animateCamera(CameraUpdate cameraUpdate, - {Duration? duration, AnimationFinishedCallback? onFinished}) { - return GoogleMapsNavigationPlatform.instance.animateCamera( - viewId: _viewId, - cameraUpdate: cameraUpdate, - duration: duration?.inMilliseconds, - onFinished: onFinished); - } - - /// Moves the camera from the current position to the position - /// defined in the [cameraUpdate]. - /// - /// See [CameraUpdate] for more information - /// on how to create different camera movements. - Future moveCamera(CameraUpdate cameraUpdate) { - return GoogleMapsNavigationPlatform.instance - .moveCamera(viewId: _viewId, cameraUpdate: cameraUpdate); - } - - /// Is the navigation trip progress bar enabled. - Future isNavigationTripProgressBarEnabled() { - return GoogleMapsNavigationPlatform.instance - .isNavigationTripProgressBarEnabled(viewId: _viewId); - } - - /// Enable or disable the navigation trip progress bar. - /// - /// By default, the navigation trip progress bar is disabled. - Future setNavigationTripProgressBarEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance - .setNavigationTripProgressBarEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Is the navigation header enabled. - Future isNavigationHeaderEnabled() { - return GoogleMapsNavigationPlatform.instance - .isNavigationHeaderEnabled(viewId: _viewId); - } - - /// Enable or disable the navigation header. - /// - /// By default, the navigation header is enabled. - Future setNavigationHeaderEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setNavigationHeaderEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Is the navigation footer enabled. - Future isNavigationFooterEnabled() { - return GoogleMapsNavigationPlatform.instance - .isNavigationFooterEnabled(viewId: _viewId); - } - - /// Enable or disable the navigation footer. - /// - /// By default, the navigation footer is enabled. - /// - /// Also known as ETA card, for example in Android - /// calls [setEtaCardEnabled().](https://developers.google.com/maps/documentation/navigation/android-sdk/v1/reference/com/google/android/libraries/navigation/NavigationView#setEtaCardEnabled(boolean)) - Future setNavigationFooterEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setNavigationFooterEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Is the recenter button enabled. - Future isRecenterButtonEnabled() { - return GoogleMapsNavigationPlatform.instance - .isRecenterButtonEnabled(viewId: _viewId); - } - - /// Enable or disable the recenter button. - /// - /// By default, the recenter button is enabled. - Future setRecenterButtonEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setRecenterButtonEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Can the speed limit indication be displayed. - Future isSpeedLimitIconEnabled() { - return GoogleMapsNavigationPlatform.instance - .isSpeedLimitIconEnabled(viewId: _viewId); - } - - /// Allow showing the speed limit indicator. - /// - /// By default, the speed limit is not displayed. - Future setSpeedLimitIconEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setSpeedLimitIconEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Can the speedometer be displayed. - Future isSpeedometerEnabled() { - return GoogleMapsNavigationPlatform.instance - .isSpeedometerEnabled(viewId: _viewId); - } - - /// Allow showing the speedometer. - /// - /// By default, the speedometer is not displayed. - Future setSpeedometerEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setSpeedometerEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Are the incident cards displayed. - Future isTrafficIncidentCardsEnabled() { - return GoogleMapsNavigationPlatform.instance - .isTrafficIncidentCardsEnabled(viewId: _viewId); - } - - /// Enable or disable showing of the incident cards. - /// - /// By default, the incident cards are shown. - Future setTrafficIncidentCardsEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setTrafficIncidentCardsEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Check if the navigation user interface is shown. - Future isNavigationUIEnabled() { - return GoogleMapsNavigationPlatform.instance - .isNavigationUIEnabled(viewId: _viewId); - } - - /// Show or hide the navigation user interface shown on top of the map. - /// - /// When enabled also actives [followMyLocation] camera mode. - /// - /// Disabling hides routes on iOS, but on Android the routes stay visible. - /// - /// By default, the navigation UI is enabled when the session has been - /// initialized with [GoogleMapsNavigator.initializeNavigationSession]. - /// - /// Fails on Android if the navigation session has not been initialized, - /// and on iOS if the terms and conditions have not been accepted. - Future setNavigationUIEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setNavigationUIEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Move the map camera to show the route overview. - /// - /// See also [followMyLocation] and [animateCamera]. - Future showRouteOverview() { - return GoogleMapsNavigationPlatform.instance.showRouteOverview( - viewId: _viewId, - ); - } - - /// Returns the minimum zoom level preference from the map view. - /// If minimum zoom preference is not set previously, returns minimum possible - /// zoom level for the current map type. - Future getMinZoomPreference() { - return GoogleMapsNavigationPlatform.instance - .getMinZoomPreference(viewId: _viewId); - } - - /// Returns the maximum zoom level preference from the map view. - /// If maximum zoom preference is not set previously, returns maximum possible - /// zoom level for the current map type. - Future getMaxZoomPreference() { - return GoogleMapsNavigationPlatform.instance - .getMaxZoomPreference(viewId: _viewId); - } - - /// Removes any previously specified upper and lower zoom bounds. - Future resetMinMaxZoomPreference() { - return GoogleMapsNavigationPlatform.instance - .resetMinMaxZoomPreference(viewId: _viewId); - } - - /// Sets a preferred lower bound for the camera zoom. - /// - /// When the minimum zoom changes, the SDK adjusts all later camera updates - /// to respect that minimum if possible. Note that there are technical - /// considerations that may prevent the SDK from allowing users to zoom too low. - /// - /// Throws [MinZoomRangeException] if [minZoomPreference] is - /// greater than maximum zoom lavel. - Future setMinZoomPreference(double minZoomPreference) { - return GoogleMapsNavigationPlatform.instance.setMinZoomPreference( - viewId: _viewId, minZoomPreference: minZoomPreference); - } - - /// Sets a preferred upper bound for the camera zoom. - /// - /// When the maximum zoom changes, the SDK adjusts all later camera updates - /// to respect that maximum if possible. Note that there are technical - /// considerations that may prevent the SDK from allowing users to zoom too - /// deep into the map. For example, satellite or terrain may have a lower - /// maximum zoom than the base map tiles. - /// - /// Throws [MaxZoomRangeException] if [maxZoomPreference] is - /// less than minimum zoom lavel. - Future setMaxZoomPreference(double maxZoomPreference) { - return GoogleMapsNavigationPlatform.instance.setMaxZoomPreference( - viewId: _viewId, maxZoomPreference: maxZoomPreference); - } - - /// Retrieves all markers that have been added to the map view. - Future> getMarkers() { - return GoogleMapsNavigationPlatform.instance.getMarkers(viewId: _viewId); - } - - /// Add markers to the map view. - Future> addMarkers(List markerOptions) { - return GoogleMapsNavigationPlatform.instance - .addMarkers(viewId: _viewId, markerOptions: markerOptions); - } - - /// Update markers to the map view. - /// - /// Throws [MarkerNotFoundException] if the [markers] list contains one or - /// more markers that have not been added to the map view via [addMarkers] or - /// contains markers that have already been removed from the map view. - Future> updateMarkers(List markers) async { - return GoogleMapsNavigationPlatform.instance - .updateMarkers(viewId: _viewId, markers: markers); - } - - /// Remove markers from the map view. - /// - /// Throws [MarkerNotFoundException] if the [markers] list contains one or - /// more markers that have not been added to the map view via [addMarkers] or - /// contains markers that have already been removed from the map view. - Future removeMarkers(List markers) async { - return GoogleMapsNavigationPlatform.instance - .removeMarkers(viewId: _viewId, markers: markers); - } - - /// Remove all markers from the map view. - Future clearMarkers() { - return GoogleMapsNavigationPlatform.instance.clearMarkers(viewId: _viewId); - } - - /// Retrieves all polygons that have been added to the map view. - Future> getPolygons() { - return GoogleMapsNavigationPlatform.instance.getPolygons(viewId: _viewId); - } - - /// Add polygons to the map view. - Future> addPolygons(List polygonOptions) { - return GoogleMapsNavigationPlatform.instance - .addPolygons(viewId: _viewId, polygonOptions: polygonOptions); - } - - /// Update polygons to the map view. - /// - /// Throws [PolygonNotFoundException] if the [polygons] list contains - /// polygon that has not beed added to the map view via [addPolygons] or - /// contains polygon that has already been removed from the map view. - Future> updatePolygons(List polygons) async { - return GoogleMapsNavigationPlatform.instance - .updatePolygons(viewId: _viewId, polygons: polygons); - } - - /// Remove polygons from the map view. - /// - /// Throws [PolygonNotFoundException] if the [polygons] list contains - /// polygon that has not beed added to the map view via [addPolygons] or - /// contains polygon that has already been removed from the map view. - Future removePolygons(List polygons) async { - return GoogleMapsNavigationPlatform.instance - .removePolygons(viewId: _viewId, polygons: polygons); - } - - /// Remove all polygons from the map view. - Future clearPolygons() { - return GoogleMapsNavigationPlatform.instance.clearPolygons(viewId: _viewId); - } - - /// Retrieves all polylines that have been added to the map view. - Future> getPolylines() { - return GoogleMapsNavigationPlatform.instance.getPolylines(viewId: _viewId); - } - - /// Add polylines to the map view. - Future> addPolylines(List polylineOptions) { - return GoogleMapsNavigationPlatform.instance - .addPolylines(viewId: _viewId, polylineOptions: polylineOptions); - } - - /// Update polylines to the map view. - /// - /// Throws [PolylineNotFoundException] if the [polylines] list contains - /// polyline that has not beed added to the map view via [addPolylines] or - /// contains polyline that has already been removed from the map view. - Future> updatePolylines(List polylines) async { - return GoogleMapsNavigationPlatform.instance - .updatePolylines(viewId: _viewId, polylines: polylines); - } - - /// Remove polylines from the map view. - /// - /// Throws [PolylineNotFoundException] if the [polylines] list contains - /// polyline that has not beed added to the map view via [addPolylines] or - /// contains polyline that has already been removed from the map view. - Future removePolylines(List polylines) async { - return GoogleMapsNavigationPlatform.instance - .removePolylines(viewId: _viewId, polylines: polylines); - } - - /// Remove all polylines from the map view. - Future clearPolylines() { - return GoogleMapsNavigationPlatform.instance - .clearPolylines(viewId: _viewId); - } - - /// Gets all circles from the map view. - Future> getCircles() { - return GoogleMapsNavigationPlatform.instance.getCircles(viewId: _viewId); - } - - /// Add circles to the map view. - Future> addCircles(List options) { - return GoogleMapsNavigationPlatform.instance - .addCircles(viewId: _viewId, options: options); - } - - /// Update circles to the map view. - /// - /// Throws [CircleNotFoundException] if the [circles] list contains one or - /// more circles that have not been added to the map view via [addCircles] or - /// contains circles that have already been removed from the map view. - Future> updateCircles(List circles) async { - return GoogleMapsNavigationPlatform.instance - .updateCircles(viewId: _viewId, circles: circles); - } - - /// Remove circles from the map view. - /// - /// Throws [CircleNotFoundException] if the [circles] list contains one or - /// more circles that have not been added to the map view via [addCircles] or - /// contains circles that have already been removed from the map view. - Future removeCircles(List circles) async { - return GoogleMapsNavigationPlatform.instance - .removeCircles(viewId: _viewId, circles: circles); - } - - /// Remove all circles from the map view. - Future clearCircles() { - return GoogleMapsNavigationPlatform.instance.clearCircles(viewId: _viewId); - } - - /// Remove all markers, polylines, polygons, overlays, etc from the map view. - Future clear() { - return GoogleMapsNavigationPlatform.instance.clear(viewId: _viewId); - } -} - /// [GoogleNavigationViewController.updateMarkers] or /// [GoogleNavigationViewController.removeMarkers] failed /// to find the marker given to the method. diff --git a/lib/src/google_navigation_flutter_android.dart b/lib/src/google_navigation_flutter_android.dart index 3530809..2608a55 100644 --- a/lib/src/google_navigation_flutter_android.dart +++ b/lib/src/google_navigation_flutter_android.dart @@ -35,8 +35,28 @@ class GoogleMapsNavigationAndroid extends GoogleMapsNavigationPlatform } @override - Widget buildView( - {required NavigationViewInitializationOptions initializationOptions, + Widget buildMapView( + {required MapViewInitializationOptions initializationOptions, + required MapReadyCallback onMapReady}) { + return _buildView( + mapViewType: MapViewType.map, + initializationOptions: initializationOptions, + onMapReady: onMapReady); + } + + @override + Widget buildNavigationView( + {required MapViewInitializationOptions initializationOptions, + required MapReadyCallback onMapReady}) { + return _buildView( + mapViewType: MapViewType.navigation, + initializationOptions: initializationOptions, + onMapReady: onMapReady); + } + + Widget _buildView( + {required MapViewType mapViewType, + required MapViewInitializationOptions initializationOptions, required MapReadyCallback onMapReady}) { // Initialize method channel for view communication if needed. ensureViewAPISetUp(); @@ -45,8 +65,8 @@ class GoogleMapsNavigationAndroid extends GoogleMapsNavigationPlatform const String viewType = 'google_navigation_flutter'; // Build creation params used to initialize navigation view with initial parameters - final NavigationViewCreationOptionsDto creationParams = - buildNavigationViewCreationOptions(initializationOptions); + final ViewCreationOptionsDto creationParams = + buildNavigationViewCreationOptions(mapViewType, initializationOptions); return PlatformViewLink( viewType: viewType, diff --git a/lib/src/google_navigation_flutter_ios.dart b/lib/src/google_navigation_flutter_ios.dart index e8875c4..fe4740b 100644 --- a/lib/src/google_navigation_flutter_ios.dart +++ b/lib/src/google_navigation_flutter_ios.dart @@ -34,8 +34,28 @@ class GoogleMapsNavigationIOS extends GoogleMapsNavigationPlatform } @override - Widget buildView( - {required NavigationViewInitializationOptions initializationOptions, + Widget buildMapView( + {required MapViewInitializationOptions initializationOptions, + required MapReadyCallback onMapReady}) { + return _buildView( + mapViewType: MapViewType.map, + initializationOptions: initializationOptions, + onMapReady: onMapReady); + } + + @override + Widget buildNavigationView( + {required MapViewInitializationOptions initializationOptions, + required MapReadyCallback onMapReady}) { + return _buildView( + mapViewType: MapViewType.navigation, + initializationOptions: initializationOptions, + onMapReady: onMapReady); + } + + Widget _buildView( + {required MapViewType mapViewType, + required MapViewInitializationOptions initializationOptions, required MapReadyCallback onMapReady}) { // Initialize method channel for view communication if needed. ensureViewAPISetUp(); @@ -44,8 +64,8 @@ class GoogleMapsNavigationIOS extends GoogleMapsNavigationPlatform const String viewType = 'google_navigation_flutter'; // Build creation params used to initialize navigation view with initial parameters - final NavigationViewCreationOptionsDto creationParams = - buildNavigationViewCreationOptions(initializationOptions); + final ViewCreationOptionsDto creationParams = + buildNavigationViewCreationOptions(mapViewType, initializationOptions); return UiKitView( viewType: viewType, diff --git a/lib/src/google_navigation_flutter_platform_interface.dart b/lib/src/google_navigation_flutter_platform_interface.dart index fc909cd..92f8726 100644 --- a/lib/src/google_navigation_flutter_platform_interface.dart +++ b/lib/src/google_navigation_flutter_platform_interface.dart @@ -26,6 +26,15 @@ import '../google_navigation_flutter.dart'; /// @nodoc typedef MapReadyCallback = void Function(int viewId); +/// Describes the type of Google map view to construct. +enum MapViewType { + /// Navigation view supports navigation overlay, and current navigation session is displayed on the map. + navigation, + + /// Classic map view, without navigation overlay. + map, +} + /// Google Maps Navigation Platform Interface for iOS and Android implementations. /// @nodoc abstract class GoogleMapsNavigationPlatform extends PlatformInterface @@ -58,6 +67,17 @@ abstract class GoogleMapsNavigationPlatform extends PlatformInterface PlatformInterface.verifyToken(instance, _token); } + /// Builds and returns a classic GoogleMaps map view. + /// + /// This method is responsible for creating a navigation view with the + /// provided [initializationOptions]. + /// + /// The [onMapReady] callback is invoked once the platform view has been created + /// and is ready for interaction. + Widget buildMapView( + {required MapViewInitializationOptions initializationOptions, + required MapReadyCallback onMapReady}); + /// Builds and returns a navigation view. /// /// This method is responsible for creating a navigation view with the @@ -65,8 +85,8 @@ abstract class GoogleMapsNavigationPlatform extends PlatformInterface /// /// The [onMapReady] callback is invoked once the platform view has been created /// and is ready for interaction. - Widget buildView( - {required NavigationViewInitializationOptions initializationOptions, + Widget buildNavigationView( + {required MapViewInitializationOptions initializationOptions, required MapReadyCallback onMapReady}); } diff --git a/lib/src/method_channel/common_view_api.dart b/lib/src/method_channel/common_view_api.dart index c4e0ce5..d9347df 100644 --- a/lib/src/method_channel/common_view_api.dart +++ b/lib/src/method_channel/common_view_api.dart @@ -24,7 +24,7 @@ import 'method_channel.dart'; /// @nodoc /// Class that handles navigation view communications. mixin CommonNavigationViewAPI on NavigationViewAPIInterface { - final NavigationViewApi _viewApi = NavigationViewApi(); + final MapViewApi _viewApi = MapViewApi(); bool _viewApiHasBeenSetUp = false; final StreamController<_ViewIdEventWrapper> _viewEventStreamController = StreamController<_ViewIdEventWrapper>.broadcast(); @@ -65,8 +65,8 @@ mixin CommonNavigationViewAPI on NavigationViewAPIInterface { /// called when initializing navigation view. void ensureViewAPISetUp() { if (!_viewApiHasBeenSetUp) { - NavigationViewEventApi.setup( - NavigationViewEventApiImpl( + ViewEventApi.setup( + ViewEventApiImpl( viewEventStreamController: _viewEventStreamController), ); _viewApiHasBeenSetUp = true; @@ -74,8 +74,14 @@ mixin CommonNavigationViewAPI on NavigationViewAPIInterface { } /// Builds creation params used to initialize navigation view with initial parameters. - NavigationViewCreationOptionsDto buildNavigationViewCreationOptions( - NavigationViewInitializationOptions initializationSettings) { + ViewCreationOptionsDto buildNavigationViewCreationOptions( + MapViewType mapViewType, + MapViewInitializationOptions initializationSettings) { + assert( + mapViewType == MapViewType.navigation || + initializationSettings.navigationViewOptions == null, + 'Navigation view options can only be set when using navigation view type'); + /// Map options final MapOptions mapOptions = initializationSettings.mapOptions; final CameraPosition cameraPosition = mapOptions.cameraPosition; @@ -103,12 +109,28 @@ mixin CommonNavigationViewAPI on NavigationViewAPIInterface { zoomControlsEnabled: mapOptions.zoomControlsEnabled, cameraTargetBounds: mapOptions.cameraTargetBounds?.toDto()); - // Navigation options - final NavigationViewOptionsDto navigationOptionsMessage = - initializationSettings.navigationViewOptions.toDto(); + // Initialize navigation view options if given + NavigationViewOptionsDto? navigationOptionsMessage; + final NavigationViewOptions? navigationViewOptions = + initializationSettings.navigationViewOptions; + if (navigationViewOptions != null) { + switch (navigationViewOptions.navigationUIEnabledPreference) { + case NavigationUIEnabledPreference.automatic: + navigationOptionsMessage = NavigationViewOptionsDto( + navigationUIEnabledPreference: + NavigationUIEnabledPreferenceDto.automatic); + case NavigationUIEnabledPreference.disabled: + navigationOptionsMessage = NavigationViewOptionsDto( + navigationUIEnabledPreference: + NavigationUIEnabledPreferenceDto.disabled); + } + } - // Build NavigationViewCreationMessage - return NavigationViewCreationOptionsDto( + // Build ViewCreationMessage + return ViewCreationOptionsDto( + mapViewType: mapViewType == MapViewType.navigation + ? MapViewTypeDto.navigation + : MapViewTypeDto.map, mapOptions: mapOptionsMessage, navigationViewOptions: navigationOptionsMessage); } @@ -978,9 +1000,9 @@ mixin CommonNavigationViewAPI on NavigationViewAPIInterface { } /// Implementation for navigation view event API event handling. -class NavigationViewEventApiImpl implements NavigationViewEventApi { +class ViewEventApiImpl implements ViewEventApi { /// Initialize implementation for NavigationViewEventApi. - const NavigationViewEventApiImpl({ + const ViewEventApiImpl({ required StreamController viewEventStreamController, }) : _viewEventStreamController = viewEventStreamController; diff --git a/lib/src/method_channel/messages.g.dart b/lib/src/method_channel/messages.g.dart index 18eb36e..8e068fd 100644 --- a/lib/src/method_channel/messages.g.dart +++ b/lib/src/method_channel/messages.g.dart @@ -1,17 +1,17 @@ // Copyright 2023 Google LLC -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // https://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Autogenerated from Pigeon (v15.0.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 @@ -29,8 +29,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 []; } @@ -40,12 +39,19 @@ List wrapResponse( return [error.code, error.message, error.details]; } +/// Describes the type of map to construct. +enum MapViewTypeDto { + /// Navigation view supports navigation overlay, and current navigation session is displayed on the map. + navigation, + /// Classic map view, without navigation overlay. + map, +} + /// Determines the initial visibility of the navigation UI on map initialization. enum NavigationUIEnabledPreferenceDto { /// Navigation UI gets enabled if the navigation /// session has already been successfully started. automatic, - /// Navigation UI is disabled. disabled, } @@ -164,199 +170,134 @@ enum RouteSegmentTrafficDataRoadStretchRenderingDataStyleDto { enum ManeuverDto { /// Arrival at a destination. destination, - /// Starting point of the maneuver. depart, - /// Arrival at a destination located on the left side of the road. destinationLeft, - /// Arrival at a destination located on the right side of the road. destinationRight, - /// Take the boat ferry. ferryBoat, - /// Take the train ferry. ferryTrain, - /// Current road joins another road slightly on the left. forkLeft, - /// Current road joins another road slightly on the right. forkRight, - /// Current road joins another on the left. mergeLeft, - /// Current road joins another on the right. mergeRight, - /// Current road joins another. mergeUnspecified, - /// The street name changes. nameChange, - /// Keep to the left side of the road when exiting a turnpike or freeway as the road diverges. offRampKeepLeft, - /// Keep to the right side of the road when exiting a turnpike or freeway as the road diverges. offRampKeepRight, - /// Regular left turn to exit a turnpike or freeway. offRampLeft, - /// Regular right turn to exit a turnpike or freeway. offRampRight, - /// Sharp left turn to exit a turnpike or freeway. offRampSharpLeft, - /// Sharp right turn to exit a turnpike or freeway. offRampSharpRight, - /// Slight left turn to exit a turnpike or freeway. offRampSlightLeft, - /// Slight right turn to exit a turnpike or freeway. offRampSlightRight, - /// Exit a turnpike or freeway. offRampUnspecified, - /// Clockwise turn onto the opposite side of the street to exit a turnpike or freeway. offRampUTurnClockwise, - /// Counterclockwise turn onto the opposite side of the street to exit a turnpike or freeway. offRampUTurnCounterclockwise, - /// Keep to the left side of the road when entering a turnpike or freeway as the road diverges. onRampKeepLeft, - /// Keep to the right side of the road when entering a turnpike or freeway as the road diverges. onRampKeepRight, - /// Regular left turn to enter a turnpike or freeway. onRampLeft, - /// Regular right turn to enter a turnpike or freeway. onRampRight, - /// Sharp left turn to enter a turnpike or freeway. onRampSharpLeft, - /// Sharp right turn to enter a turnpike or freeway. onRampSharpRight, - /// Slight left turn to enter a turnpike or freeway. onRampSlightLeft, - /// Slight right turn to enter a turnpike or freeway. onRampSlightRight, - /// Enter a turnpike or freeway. onRampUnspecified, - /// Clockwise turn onto the opposite side of the street to enter a turnpike or freeway. onRampUTurnClockwise, - /// Counterclockwise turn onto the opposite side of the street to enter a turnpike or freeway. onRampUTurnCounterclockwise, - /// Enter a roundabout in the clockwise direction. roundaboutClockwise, - /// Enter a roundabout in the counterclockwise direction. roundaboutCounterclockwise, - /// Exit a roundabout in the clockwise direction. roundaboutExitClockwise, - /// Exit a roundabout in the counterclockwise direction. roundaboutExitCounterclockwise, - /// Enter a roundabout in the clockwise direction and turn left. roundaboutLeftClockwise, - /// Enter a roundabout in the counterclockwise direction and turn left. roundaboutLeftCounterclockwise, - /// Enter a roundabout in the clockwise direction and turn right. roundaboutRightClockwise, - /// Enter a roundabout in the counterclockwise direction and turn right. roundaboutRightCounterclockwise, - /// Enter a roundabout in the clockwise direction and turn sharply to the left. roundaboutSharpLeftClockwise, - /// Enter a roundabout in the counterclockwise direction and turn sharply to the left. roundaboutSharpLeftCounterclockwise, - /// Enter a roundabout in the clockwise direction and turn sharply to the right. roundaboutSharpRightClockwise, - /// Enter a roundabout in the counterclockwise direction and turn sharply to the right. roundaboutSharpRightCounterclockwise, - /// Enter a roundabout in the clockwise direction and turn slightly left. roundaboutSlightLeftClockwise, - /// Enter a roundabout in the counterclockwise direction and turn slightly to the left. roundaboutSlightLeftCounterclockwise, - /// Enter a roundabout in the clockwise direction and turn slightly to the right. roundaboutSlightRightClockwise, - /// Enter a roundabout in the counterclockwise direction and turn slightly to the right. roundaboutSlightRightCounterclockwise, - /// Enter a roundabout in the clockwise direction and continue straight. roundaboutStraightClockwise, - /// Enter a roundabout in the counterclockwise direction and continue straight. roundaboutStraightCounterclockwise, - /// Enter a roundabout in the clockwise direction and turn clockwise onto the opposite side of the street. roundaboutUTurnClockwise, - /// Enter a roundabout in the counterclockwise direction and turn counterclockwise onto the opposite side of the street. roundaboutUTurnCounterclockwise, - /// Continue straight. straight, - /// Keep left as the road diverges. turnKeepLeft, - /// Keep right as the road diverges. turnKeepRight, - /// Regular left turn at an intersection. turnLeft, - /// Regular right turn at an intersection. turnRight, - /// Sharp left turn at an intersection. turnSharpLeft, - /// Sharp right turn at an intersection. turnSharpRight, - /// Slight left turn at an intersection. turnSlightLeft, - /// Slight right turn at an intersection. turnSlightRight, - /// Clockwise turn onto the opposite side of the street. turnUTurnClockwise, - /// Counterclockwise turn onto the opposite side of the street. turnUTurnCounterclockwise, - /// Unknown maneuver. unknown, } @@ -365,10 +306,8 @@ enum ManeuverDto { enum DrivingSideDto { /// Drive-on-left side. left, - /// Unspecified side. none, - /// Drive-on-right side. right, } @@ -377,13 +316,10 @@ enum DrivingSideDto { enum NavStateDto { /// Actively navigating. enroute, - /// Actively navigating but searching for a new route. rerouting, - /// Navigation has ended. stopped, - /// Error or unspecified state. unknown, } @@ -392,31 +328,22 @@ enum NavStateDto { enum LaneShapeDto { /// Normal left turn (45-135 degrees). normalLeft, - /// Normal right turn (45-135 degrees). normalRight, - /// Sharp left turn (135-175 degrees). sharpLeft, - /// Sharp right turn (135-175 degrees). sharpRight, - /// Slight left turn (10-45 degrees). slightLeft, - /// Slight right turn (10-45 degrees). slightRight, - /// No turn. straight, - /// Shape is unknown. unknown, - /// A left turn onto the opposite side of the same street (175-180 degrees). uTurnLeft, - /// A right turn onto the opposite side of the same street (175-180 degrees). uTurnRight, } @@ -537,8 +464,7 @@ class NavigationViewOptionsDto { static NavigationViewOptionsDto decode(Object result) { result as List; return NavigationViewOptionsDto( - navigationUIEnabledPreference: - NavigationUIEnabledPreferenceDto.values[result[0]! as int], + navigationUIEnabledPreference: NavigationUIEnabledPreferenceDto.values[result[0]! as int], ); } } @@ -547,29 +473,35 @@ class NavigationViewOptionsDto { /// /// This message is used to initialize a new navigation view with a /// specified initial parameters. -class NavigationViewCreationOptionsDto { - NavigationViewCreationOptionsDto({ +class ViewCreationOptionsDto { + ViewCreationOptionsDto({ + required this.mapViewType, required this.mapOptions, - required this.navigationViewOptions, + this.navigationViewOptions, }); + MapViewTypeDto mapViewType; + MapOptionsDto mapOptions; - NavigationViewOptionsDto navigationViewOptions; + NavigationViewOptionsDto? navigationViewOptions; Object encode() { return [ + mapViewType.index, mapOptions.encode(), - navigationViewOptions.encode(), + navigationViewOptions?.encode(), ]; } - static NavigationViewCreationOptionsDto decode(Object result) { + static ViewCreationOptionsDto decode(Object result) { result as List; - return NavigationViewCreationOptionsDto( - mapOptions: MapOptionsDto.decode(result[0]! as List), - navigationViewOptions: - NavigationViewOptionsDto.decode(result[1]! as List), + return ViewCreationOptionsDto( + mapViewType: MapViewTypeDto.values[result[0]! as int], + mapOptions: MapOptionsDto.decode(result[1]! as List), + navigationViewOptions: result[2] != null + ? NavigationViewOptionsDto.decode(result[2]! as List) + : null, ); } } @@ -1197,8 +1129,9 @@ class RouteTokenOptionsDto { result as List; return RouteTokenOptionsDto( routeToken: result[0]! as String, - travelMode: - result[1] != null ? TravelModeDto.values[result[1]! as int] : null, + travelMode: result[1] != null + ? TravelModeDto.values[result[1]! as int] + : null, ); } } @@ -1232,8 +1165,7 @@ class DestinationsDto { result as List; return DestinationsDto( waypoints: (result[0] as List?)!.cast(), - displayOptions: - NavigationDisplayOptionsDto.decode(result[1]! as List), + displayOptions: NavigationDisplayOptionsDto.decode(result[1]! as List), routingOptions: result[2] != null ? RoutingOptionsDto.decode(result[2]! as List) : null, @@ -1295,8 +1227,9 @@ class RoutingOptionsDto { ? RoutingStrategyDto.values[result[1]! as int] : null, targetDistanceMeters: (result[2] as List?)?.cast(), - travelMode: - result[3] != null ? TravelModeDto.values[result[3]! as int] : null, + travelMode: result[3] != null + ? TravelModeDto.values[result[3]! as int] + : null, avoidTolls: result[4] as bool?, avoidFerries: result[5] as bool?, avoidHighways: result[6] as bool?, @@ -1589,12 +1522,10 @@ class RouteSegmentTrafficDataRoadStretchRenderingDataDto { ]; } - static RouteSegmentTrafficDataRoadStretchRenderingDataDto decode( - Object result) { + static RouteSegmentTrafficDataRoadStretchRenderingDataDto decode(Object result) { result as List; return RouteSegmentTrafficDataRoadStretchRenderingDataDto( - style: RouteSegmentTrafficDataRoadStretchRenderingDataStyleDto - .values[result[0]! as int], + style: RouteSegmentTrafficDataRoadStretchRenderingDataStyleDto.values[result[0]! as int], lengthMeters: result[1]! as int, offsetMeters: result[2]! as int, ); @@ -1609,8 +1540,7 @@ class RouteSegmentTrafficDataDto { RouteSegmentTrafficDataStatusDto status; - List - roadStretchRenderingDataList; + List roadStretchRenderingDataList; Object encode() { return [ @@ -1623,8 +1553,7 @@ class RouteSegmentTrafficDataDto { result as List; return RouteSegmentTrafficDataDto( status: RouteSegmentTrafficDataStatusDto.values[result[0]! as int], - roadStretchRenderingDataList: (result[1] as List?)! - .cast(), + roadStretchRenderingDataList: (result[1] as List?)!.cast(), ); } } @@ -1909,10 +1838,10 @@ class __NavigationViewCreationApiCodec extends StandardMessageCodec { } else if (value is MapOptionsDto) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is NavigationViewCreationOptionsDto) { + } else if (value is NavigationViewOptionsDto) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is NavigationViewOptionsDto) { + } else if (value is ViewCreationOptionsDto) { buffer.putUint8(133); writeValue(buffer, value.encode()); } else { @@ -1923,18 +1852,18 @@ class __NavigationViewCreationApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPositionDto.decode(readValue(buffer)!); - case 129: + case 129: return LatLngBoundsDto.decode(readValue(buffer)!); - case 130: + case 130: return LatLngDto.decode(readValue(buffer)!); - case 131: + case 131: return MapOptionsDto.decode(readValue(buffer)!); - case 132: - return NavigationViewCreationOptionsDto.decode(readValue(buffer)!); - case 133: + case 132: return NavigationViewOptionsDto.decode(readValue(buffer)!); + case 133: + return ViewCreationOptionsDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -1952,14 +1881,11 @@ class _NavigationViewCreationApi { : __pigeon_binaryMessenger = binaryMessenger; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - __NavigationViewCreationApiCodec(); + static const MessageCodec pigeonChannelCodec = __NavigationViewCreationApiCodec(); - Future _create(NavigationViewCreationOptionsDto msg) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future _create(ViewCreationOptionsDto msg) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1980,8 +1906,8 @@ class _NavigationViewCreationApi { } } -class _NavigationViewApiCodec extends StandardMessageCodec { - const _NavigationViewApiCodec(); +class _MapViewApiCodec extends StandardMessageCodec { + const _MapViewApiCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { if (value is CameraPositionDto) { @@ -2049,43 +1975,43 @@ class _NavigationViewApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPositionDto.decode(readValue(buffer)!); - case 129: + case 129: return CircleDto.decode(readValue(buffer)!); - case 130: + case 130: return CircleOptionsDto.decode(readValue(buffer)!); - case 131: + case 131: return ImageDescriptorDto.decode(readValue(buffer)!); - case 132: + case 132: return InfoWindowDto.decode(readValue(buffer)!); - case 133: + case 133: return LatLngBoundsDto.decode(readValue(buffer)!); - case 134: + case 134: return LatLngDto.decode(readValue(buffer)!); - case 135: + case 135: return LatLngDto.decode(readValue(buffer)!); - case 136: + case 136: return MarkerAnchorDto.decode(readValue(buffer)!); - case 137: + case 137: return MarkerDto.decode(readValue(buffer)!); - case 138: + case 138: return MarkerOptionsDto.decode(readValue(buffer)!); - case 139: + case 139: return PatternItemDto.decode(readValue(buffer)!); - case 140: + case 140: return PolygonDto.decode(readValue(buffer)!); - case 141: + case 141: return PolygonHoleDto.decode(readValue(buffer)!); - case 142: + case 142: return PolygonOptionsDto.decode(readValue(buffer)!); - case 143: + case 143: return PolylineDto.decode(readValue(buffer)!); - case 144: + case 144: return PolylineOptionsDto.decode(readValue(buffer)!); - case 145: + case 145: return StyleSpanDto.decode(readValue(buffer)!); - case 146: + case 146: return StyleSpanStrokeStyleDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2093,22 +2019,19 @@ class _NavigationViewApiCodec extends StandardMessageCodec { } } -class NavigationViewApi { - /// Constructor for [NavigationViewApi]. The [binaryMessenger] named argument is +class MapViewApi { + /// Constructor for [MapViewApi]. 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. - NavigationViewApi({BinaryMessenger? binaryMessenger}) + MapViewApi({BinaryMessenger? binaryMessenger}) : __pigeon_binaryMessenger = binaryMessenger; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _NavigationViewApiCodec(); + static const MessageCodec pigeonChannelCodec = _MapViewApiCodec(); Future awaitMapReady(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.awaitMapReady'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2129,10 +2052,8 @@ class NavigationViewApi { } Future isMyLocationEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2158,16 +2079,14 @@ class NavigationViewApi { } Future setMyLocationEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2182,10 +2101,8 @@ class NavigationViewApi { } Future getMyLocation(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMyLocation'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2206,10 +2123,8 @@ class NavigationViewApi { } Future getMapType(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMapType'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2235,16 +2150,14 @@ class NavigationViewApi { } Future setMapType(int viewId, MapTypeDto mapType) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapType'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, mapType.index]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, mapType.index]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2259,16 +2172,14 @@ class NavigationViewApi { } Future setMapStyle(int viewId, String styleJson) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapStyle'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, styleJson]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, styleJson]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2283,10 +2194,8 @@ class NavigationViewApi { } Future isNavigationTripProgressBarEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationTripProgressBarEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2311,18 +2220,15 @@ class NavigationViewApi { } } - Future setNavigationTripProgressBarEnabled( - int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationTripProgressBarEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future setNavigationTripProgressBarEnabled(int viewId, bool enabled) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2337,10 +2243,8 @@ class NavigationViewApi { } Future isNavigationHeaderEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationHeaderEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2366,16 +2270,14 @@ class NavigationViewApi { } Future setNavigationHeaderEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationHeaderEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2390,10 +2292,8 @@ class NavigationViewApi { } Future isNavigationFooterEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationFooterEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2419,16 +2319,14 @@ class NavigationViewApi { } Future setNavigationFooterEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationFooterEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2443,10 +2341,8 @@ class NavigationViewApi { } Future isRecenterButtonEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRecenterButtonEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2472,16 +2368,14 @@ class NavigationViewApi { } Future setRecenterButtonEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRecenterButtonEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2496,10 +2390,8 @@ class NavigationViewApi { } Future isSpeedLimitIconEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedLimitIconEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2525,16 +2417,14 @@ class NavigationViewApi { } Future setSpeedLimitIconEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedLimitIconEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2549,10 +2439,8 @@ class NavigationViewApi { } Future isSpeedometerEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedometerEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2578,16 +2466,14 @@ class NavigationViewApi { } Future setSpeedometerEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedometerEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2602,10 +2488,8 @@ class NavigationViewApi { } Future isTrafficIncidentCardsEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficIncidentCardsEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2631,16 +2515,14 @@ class NavigationViewApi { } Future setTrafficIncidentCardsEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficIncidentCardsEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2655,10 +2537,8 @@ class NavigationViewApi { } Future isNavigationUIEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationUIEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2684,16 +2564,14 @@ class NavigationViewApi { } Future setNavigationUIEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationUIEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2708,10 +2586,8 @@ class NavigationViewApi { } Future getCameraPosition(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCameraPosition'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2737,10 +2613,8 @@ class NavigationViewApi { } Future getVisibleRegion(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getVisibleRegion'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2765,19 +2639,15 @@ class NavigationViewApi { } } - Future followMyLocation( - int viewId, CameraPerspectiveDto perspective, double? zoomLevel) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.followMyLocation'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future followMyLocation(int viewId, CameraPerspectiveDto perspective, double? zoomLevel) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, perspective.index, zoomLevel]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, perspective.index, zoomLevel]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2791,18 +2661,15 @@ class NavigationViewApi { } } - Future animateCameraToCameraPosition( - int viewId, CameraPositionDto cameraPosition, int? duration) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToCameraPosition'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future animateCameraToCameraPosition(int viewId, CameraPositionDto cameraPosition, int? duration) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, cameraPosition, duration]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, cameraPosition, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2821,18 +2688,15 @@ class NavigationViewApi { } } - Future animateCameraToLatLng( - int viewId, LatLngDto point, int? duration) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLng'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future animateCameraToLatLng(int viewId, LatLngDto point, int? duration) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, point, duration]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, point, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2851,18 +2715,15 @@ class NavigationViewApi { } } - Future animateCameraToLatLngBounds( - int viewId, LatLngBoundsDto bounds, double padding, int? duration) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngBounds'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future animateCameraToLatLngBounds(int viewId, LatLngBoundsDto bounds, double padding, int? duration) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, bounds, padding, duration]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, bounds, padding, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2881,18 +2742,15 @@ class NavigationViewApi { } } - Future animateCameraToLatLngZoom( - int viewId, LatLngDto point, double zoom, int? duration) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngZoom'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future animateCameraToLatLngZoom(int viewId, LatLngDto point, double zoom, int? duration) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, point, zoom, duration]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, point, zoom, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2911,19 +2769,15 @@ class NavigationViewApi { } } - Future animateCameraByScroll( - int viewId, double scrollByDx, double scrollByDy, int? duration) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByScroll'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future animateCameraByScroll(int viewId, double scrollByDx, double scrollByDy, int? duration) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, scrollByDx, scrollByDy, duration]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, scrollByDx, scrollByDy, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2942,19 +2796,15 @@ class NavigationViewApi { } } - Future animateCameraByZoom(int viewId, double zoomBy, double? focusDx, - double? focusDy, int? duration) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByZoom'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future animateCameraByZoom(int viewId, double zoomBy, double? focusDx, double? focusDy, int? duration) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, zoomBy, focusDx, focusDy, duration]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, zoomBy, focusDx, focusDy, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2973,18 +2823,15 @@ class NavigationViewApi { } } - Future animateCameraToZoom( - int viewId, double zoom, int? duration) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToZoom'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future animateCameraToZoom(int viewId, double zoom, int? duration) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, zoom, duration]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, zoom, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3003,18 +2850,15 @@ class NavigationViewApi { } } - Future moveCameraToCameraPosition( - int viewId, CameraPositionDto cameraPosition) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToCameraPosition'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future moveCameraToCameraPosition(int viewId, CameraPositionDto cameraPosition) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, cameraPosition]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, cameraPosition]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3029,10 +2873,8 @@ class NavigationViewApi { } Future moveCameraToLatLng(int viewId, LatLngDto point) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLng'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3052,18 +2894,15 @@ class NavigationViewApi { } } - Future moveCameraToLatLngBounds( - int viewId, LatLngBoundsDto bounds, double padding) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngBounds'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future moveCameraToLatLngBounds(int viewId, LatLngBoundsDto bounds, double padding) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, bounds, padding]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, bounds, padding]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3077,18 +2916,15 @@ class NavigationViewApi { } } - Future moveCameraToLatLngZoom( - int viewId, LatLngDto point, double zoom) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngZoom'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future moveCameraToLatLngZoom(int viewId, LatLngDto point, double zoom) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, point, zoom]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, point, zoom]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3102,18 +2938,15 @@ class NavigationViewApi { } } - Future moveCameraByScroll( - int viewId, double scrollByDx, double scrollByDy) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByScroll'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future moveCameraByScroll(int viewId, double scrollByDx, double scrollByDy) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, scrollByDx, scrollByDy]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, scrollByDx, scrollByDy]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3127,18 +2960,15 @@ class NavigationViewApi { } } - Future moveCameraByZoom( - int viewId, double zoomBy, double? focusDx, double? focusDy) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByZoom'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future moveCameraByZoom(int viewId, double zoomBy, double? focusDx, double? focusDy) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, zoomBy, focusDx, focusDy]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, zoomBy, focusDx, focusDy]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3153,10 +2983,8 @@ class NavigationViewApi { } Future moveCameraToZoom(int viewId, double zoom) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToZoom'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3177,10 +3005,8 @@ class NavigationViewApi { } Future showRouteOverview(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.showRouteOverview'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3201,10 +3027,8 @@ class NavigationViewApi { } Future getMinZoomPreference(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMinZoomPreference'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3230,10 +3054,8 @@ class NavigationViewApi { } Future getMaxZoomPreference(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMaxZoomPreference'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3259,10 +3081,8 @@ class NavigationViewApi { } Future resetMinMaxZoomPreference(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.resetMinMaxZoomPreference'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3282,18 +3102,15 @@ class NavigationViewApi { } } - Future setMinZoomPreference( - int viewId, double minZoomPreference) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMinZoomPreference'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future setMinZoomPreference(int viewId, double minZoomPreference) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, minZoomPreference]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, minZoomPreference]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3307,18 +3124,15 @@ class NavigationViewApi { } } - Future setMaxZoomPreference( - int viewId, double maxZoomPreference) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMaxZoomPreference'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future setMaxZoomPreference(int viewId, double maxZoomPreference) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, maxZoomPreference]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, maxZoomPreference]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3333,16 +3147,14 @@ class NavigationViewApi { } Future setMyLocationButtonEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationButtonEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3356,18 +3168,15 @@ class NavigationViewApi { } } - Future setConsumeMyLocationButtonClickEventsEnabled( - int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setConsumeMyLocationButtonClickEventsEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future setConsumeMyLocationButtonClickEventsEnabled(int viewId, bool enabled) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3382,16 +3191,14 @@ class NavigationViewApi { } Future setZoomGesturesEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3406,16 +3213,14 @@ class NavigationViewApi { } Future setZoomControlsEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomControlsEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3430,16 +3235,14 @@ class NavigationViewApi { } Future setCompassEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setCompassEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3454,16 +3257,14 @@ class NavigationViewApi { } Future setRotateGesturesEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRotateGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3478,16 +3279,14 @@ class NavigationViewApi { } Future setScrollGesturesEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3501,18 +3300,15 @@ class NavigationViewApi { } } - Future setScrollGesturesDuringRotateOrZoomEnabled( - int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesDuringRotateOrZoomEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future setScrollGesturesDuringRotateOrZoomEnabled(int viewId, bool enabled) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3527,16 +3323,14 @@ class NavigationViewApi { } Future setTiltGesturesEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTiltGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3551,16 +3345,14 @@ class NavigationViewApi { } Future setMapToolbarEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapToolbarEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3575,16 +3367,14 @@ class NavigationViewApi { } Future setTrafficEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, enabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3599,10 +3389,8 @@ class NavigationViewApi { } Future isMyLocationButtonEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationButtonEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3628,10 +3416,8 @@ class NavigationViewApi { } Future isConsumeMyLocationButtonClickEventsEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isConsumeMyLocationButtonClickEventsEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3657,10 +3443,8 @@ class NavigationViewApi { } Future isZoomGesturesEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3686,10 +3470,8 @@ class NavigationViewApi { } Future isZoomControlsEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomControlsEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3715,10 +3497,8 @@ class NavigationViewApi { } Future isCompassEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isCompassEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3744,10 +3524,8 @@ class NavigationViewApi { } Future isRotateGesturesEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRotateGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3773,10 +3551,8 @@ class NavigationViewApi { } Future isScrollGesturesEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3802,10 +3578,8 @@ class NavigationViewApi { } Future isScrollGesturesEnabledDuringRotateOrZoom(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabledDuringRotateOrZoom'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3831,10 +3605,8 @@ class NavigationViewApi { } Future isTiltGesturesEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTiltGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3860,10 +3632,8 @@ class NavigationViewApi { } Future isMapToolbarEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMapToolbarEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3889,10 +3659,8 @@ class NavigationViewApi { } Future isTrafficEnabled(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficEnabled'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3918,10 +3686,8 @@ class NavigationViewApi { } Future> getMarkers(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMarkers'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3946,18 +3712,15 @@ class NavigationViewApi { } } - Future> addMarkers( - int viewId, List markers) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addMarkers'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future> addMarkers(int viewId, List markers) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, markers]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, markers]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3976,18 +3739,15 @@ class NavigationViewApi { } } - Future> updateMarkers( - int viewId, List markers) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateMarkers'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future> updateMarkers(int viewId, List markers) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, markers]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, markers]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4007,16 +3767,14 @@ class NavigationViewApi { } Future removeMarkers(int viewId, List markers) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeMarkers'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, markers]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, markers]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4031,10 +3789,8 @@ class NavigationViewApi { } Future clearMarkers(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearMarkers'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4055,10 +3811,8 @@ class NavigationViewApi { } Future clear(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clear'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4079,10 +3833,8 @@ class NavigationViewApi { } Future> getPolygons(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolygons'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4107,18 +3859,15 @@ class NavigationViewApi { } } - Future> addPolygons( - int viewId, List polygons) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolygons'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future> addPolygons(int viewId, List polygons) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, polygons]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, polygons]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4137,18 +3886,15 @@ class NavigationViewApi { } } - Future> updatePolygons( - int viewId, List polygons) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolygons'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future> updatePolygons(int viewId, List polygons) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, polygons]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, polygons]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4168,16 +3914,14 @@ class NavigationViewApi { } Future removePolygons(int viewId, List polygons) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolygons'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, polygons]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, polygons]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4192,10 +3936,8 @@ class NavigationViewApi { } Future clearPolygons(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolygons'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4216,10 +3958,8 @@ class NavigationViewApi { } Future> getPolylines(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolylines'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4244,18 +3984,15 @@ class NavigationViewApi { } } - Future> addPolylines( - int viewId, List polylines) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolylines'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future> addPolylines(int viewId, List polylines) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, polylines]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, polylines]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4274,18 +4011,15 @@ class NavigationViewApi { } } - Future> updatePolylines( - int viewId, List polylines) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolylines'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future> updatePolylines(int viewId, List polylines) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, polylines]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, polylines]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4305,16 +4039,14 @@ class NavigationViewApi { } Future removePolylines(int viewId, List polylines) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolylines'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, polylines]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, polylines]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4329,10 +4061,8 @@ class NavigationViewApi { } Future clearPolylines(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolylines'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4353,10 +4083,8 @@ class NavigationViewApi { } Future> getCircles(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCircles'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4381,18 +4109,15 @@ class NavigationViewApi { } } - Future> addCircles( - int viewId, List circles) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addCircles'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future> addCircles(int viewId, List circles) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, circles]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, circles]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4411,18 +4136,15 @@ class NavigationViewApi { } } - Future> updateCircles( - int viewId, List circles) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateCircles'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future> updateCircles(int viewId, List circles) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, circles]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, circles]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4442,16 +4164,14 @@ class NavigationViewApi { } Future removeCircles(int viewId, List circles) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeCircles'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([viewId, circles]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([viewId, circles]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4466,10 +4186,8 @@ class NavigationViewApi { } Future clearCircles(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearCircles'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4490,10 +4208,8 @@ class NavigationViewApi { } Future registerOnCameraChangedListener(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.registerOnCameraChangedListener'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4532,9 +4248,9 @@ class _ImageRegistryApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ImageDescriptorDto.decode(readValue(buffer)!); - case 129: + case 129: return ImageDescriptorDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -4550,26 +4266,17 @@ class ImageRegistryApi { : __pigeon_binaryMessenger = binaryMessenger; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _ImageRegistryApiCodec(); + static const MessageCodec pigeonChannelCodec = _ImageRegistryApiCodec(); - Future registerBitmapImage( - String imageId, - Uint8List bytes, - double imagePixelRatio, - double? width, - double? height) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future registerBitmapImage(String imageId, Uint8List bytes, double imagePixelRatio, double? width, double? height) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([imageId, bytes, imagePixelRatio, width, height]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([imageId, bytes, imagePixelRatio, width, height]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4589,16 +4296,14 @@ class ImageRegistryApi { } Future unregisterImage(ImageDescriptorDto imageDescriptor) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([imageDescriptor]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([imageDescriptor]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4613,10 +4318,8 @@ class ImageRegistryApi { } Future> getRegisteredImages() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4637,16 +4340,13 @@ class ImageRegistryApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)! - .cast(); + return (__pigeon_replyList[0] as List?)!.cast(); } } Future clearRegisteredImages() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4667,8 +4367,8 @@ class ImageRegistryApi { } } -class _NavigationViewEventApiCodec extends StandardMessageCodec { - const _NavigationViewEventApiCodec(); +class _ViewEventApiCodec extends StandardMessageCodec { + const _ViewEventApiCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { if (value is CameraPositionDto) { @@ -4685,9 +4385,9 @@ class _NavigationViewEventApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPositionDto.decode(readValue(buffer)!); - case 129: + case 129: return LatLngDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -4695,9 +4395,8 @@ class _NavigationViewEventApiCodec extends StandardMessageCodec { } } -abstract class NavigationViewEventApi { - static const MessageCodec pigeonChannelCodec = - _NavigationViewEventApiCodec(); +abstract class ViewEventApi { + static const MessageCodec pigeonChannelCodec = _ViewEventApiCodec(); void onMapClickEvent(int viewId, LatLngDto latLng); @@ -4707,8 +4406,7 @@ abstract class NavigationViewEventApi { void onMarkerEvent(int viewId, String markerId, MarkerEventTypeDto eventType); - void onMarkerDragEvent(int viewId, String markerId, - MarkerDragEventTypeDto eventType, LatLngDto position); + void onMarkerDragEvent(int viewId, String markerId, MarkerDragEventTypeDto eventType, LatLngDto position); void onPolygonClicked(int viewId, String polygonId); @@ -4722,391 +4420,344 @@ abstract class NavigationViewEventApi { void onMyLocationButtonClicked(int viewId); - void onCameraChanged( - int viewId, CameraEventTypeDto eventType, CameraPositionDto position); + void onCameraChanged(int viewId, CameraEventTypeDto eventType, CameraPositionDto position); - static void setup(NavigationViewEventApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ViewEventApi? api, {BinaryMessenger? binaryMessenger}) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapClickEvent', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapClickEvent was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapClickEvent was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent was null, expected non-null int.'); final LatLngDto? arg_latLng = (args[1] as LatLngDto?); assert(arg_latLng != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapClickEvent was null, expected non-null LatLngDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent was null, expected non-null LatLngDto.'); try { api.onMapClickEvent(arg_viewId!, arg_latLng!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapLongClickEvent', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapLongClickEvent was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapLongClickEvent was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent was null, expected non-null int.'); final LatLngDto? arg_latLng = (args[1] as LatLngDto?); assert(arg_latLng != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMapLongClickEvent was null, expected non-null LatLngDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent was null, expected non-null LatLngDto.'); try { api.onMapLongClickEvent(arg_viewId!, arg_latLng!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onRecenterButtonClicked', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onRecenterButtonClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onRecenterButtonClicked was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked was null, expected non-null int.'); try { api.onRecenterButtonClicked(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerEvent', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerEvent was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerEvent was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent was null, expected non-null int.'); final String? arg_markerId = (args[1] as String?); assert(arg_markerId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerEvent was null, expected non-null String.'); - final MarkerEventTypeDto? arg_eventType = args[2] == null - ? null - : MarkerEventTypeDto.values[args[2]! as int]; + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent was null, expected non-null String.'); + final MarkerEventTypeDto? arg_eventType = args[2] == null ? null : MarkerEventTypeDto.values[args[2]! as int]; assert(arg_eventType != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerEvent was null, expected non-null MarkerEventTypeDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent was null, expected non-null MarkerEventTypeDto.'); try { api.onMarkerEvent(arg_viewId!, arg_markerId!, arg_eventType!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerDragEvent', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerDragEvent was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerDragEvent was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent was null, expected non-null int.'); final String? arg_markerId = (args[1] as String?); assert(arg_markerId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerDragEvent was null, expected non-null String.'); - final MarkerDragEventTypeDto? arg_eventType = args[2] == null - ? null - : MarkerDragEventTypeDto.values[args[2]! as int]; + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent was null, expected non-null String.'); + final MarkerDragEventTypeDto? arg_eventType = args[2] == null ? null : MarkerDragEventTypeDto.values[args[2]! as int]; assert(arg_eventType != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerDragEvent was null, expected non-null MarkerDragEventTypeDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent was null, expected non-null MarkerDragEventTypeDto.'); final LatLngDto? arg_position = (args[3] as LatLngDto?); assert(arg_position != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMarkerDragEvent was null, expected non-null LatLngDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent was null, expected non-null LatLngDto.'); try { - api.onMarkerDragEvent( - arg_viewId!, arg_markerId!, arg_eventType!, arg_position!); + api.onMarkerDragEvent(arg_viewId!, arg_markerId!, arg_eventType!, arg_position!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolygonClicked', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolygonClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolygonClicked was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked was null, expected non-null int.'); final String? arg_polygonId = (args[1] as String?); assert(arg_polygonId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolygonClicked was null, expected non-null String.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked was null, expected non-null String.'); try { api.onPolygonClicked(arg_viewId!, arg_polygonId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolylineClicked', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolylineClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolylineClicked was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked was null, expected non-null int.'); final String? arg_polylineId = (args[1] as String?); assert(arg_polylineId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onPolylineClicked was null, expected non-null String.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked was null, expected non-null String.'); try { api.onPolylineClicked(arg_viewId!, arg_polylineId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCircleClicked', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCircleClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCircleClicked was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked was null, expected non-null int.'); final String? arg_circleId = (args[1] as String?); assert(arg_circleId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCircleClicked was null, expected non-null String.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked was null, expected non-null String.'); try { api.onCircleClicked(arg_viewId!, arg_circleId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onNavigationUIEnabledChanged', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onNavigationUIEnabledChanged was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onNavigationUIEnabledChanged was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged was null, expected non-null int.'); final bool? arg_navigationUIEnabled = (args[1] as bool?); assert(arg_navigationUIEnabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onNavigationUIEnabledChanged was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged was null, expected non-null bool.'); try { - api.onNavigationUIEnabledChanged( - arg_viewId!, arg_navigationUIEnabled!); + api.onNavigationUIEnabledChanged(arg_viewId!, arg_navigationUIEnabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMyLocationClicked', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMyLocationClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMyLocationClicked was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked was null, expected non-null int.'); try { api.onMyLocationClicked(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMyLocationButtonClicked', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMyLocationButtonClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onMyLocationButtonClicked was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked was null, expected non-null int.'); try { api.onMyLocationButtonClicked(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCameraChanged', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCameraChanged was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCameraChanged was null, expected non-null int.'); - final CameraEventTypeDto? arg_eventType = args[1] == null - ? null - : CameraEventTypeDto.values[args[1]! as int]; + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged was null, expected non-null int.'); + final CameraEventTypeDto? arg_eventType = args[1] == null ? null : CameraEventTypeDto.values[args[1]! as int]; assert(arg_eventType != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCameraChanged was null, expected non-null CameraEventTypeDto.'); - final CameraPositionDto? arg_position = - (args[2] as CameraPositionDto?); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged was null, expected non-null CameraEventTypeDto.'); + final CameraPositionDto? arg_position = (args[2] as CameraPositionDto?); assert(arg_position != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewEventApi.onCameraChanged was null, expected non-null CameraPositionDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged was null, expected non-null CameraPositionDto.'); try { api.onCameraChanged(arg_viewId!, arg_eventType!, arg_position!); 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())); } }); } @@ -5174,38 +4825,37 @@ class _NavigationSessionApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return DestinationsDto.decode(readValue(buffer)!); - case 129: + case 129: return LatLngDto.decode(readValue(buffer)!); - case 130: + case 130: return LatLngDto.decode(readValue(buffer)!); - case 131: + case 131: return NavigationAudioGuidanceSettingsDto.decode(readValue(buffer)!); - case 132: + case 132: return NavigationDisplayOptionsDto.decode(readValue(buffer)!); - case 133: + case 133: return NavigationTimeAndDistanceDto.decode(readValue(buffer)!); - case 134: + case 134: return NavigationWaypointDto.decode(readValue(buffer)!); - case 135: + case 135: return NavigationWaypointDto.decode(readValue(buffer)!); - case 136: + case 136: return RouteSegmentDto.decode(readValue(buffer)!); - case 137: + case 137: return RouteSegmentDto.decode(readValue(buffer)!); - case 138: + case 138: return RouteSegmentTrafficDataDto.decode(readValue(buffer)!); - case 139: - return RouteSegmentTrafficDataRoadStretchRenderingDataDto.decode( - readValue(buffer)!); - case 140: + case 139: + return RouteSegmentTrafficDataRoadStretchRenderingDataDto.decode(readValue(buffer)!); + case 140: return RouteTokenOptionsDto.decode(readValue(buffer)!); - case 141: + case 141: return RoutingOptionsDto.decode(readValue(buffer)!); - case 142: + case 142: return SimulationOptionsDto.decode(readValue(buffer)!); - case 143: + case 143: return SpeedAlertOptionsDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -5221,22 +4871,18 @@ class NavigationSessionApi { : __pigeon_binaryMessenger = binaryMessenger; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _NavigationSessionApiCodec(); + static const MessageCodec pigeonChannelCodec = _NavigationSessionApiCodec(); /// General. - Future createNavigationSession( - bool abnormalTerminationReportingEnabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future createNavigationSession(bool abnormalTerminationReportingEnabled) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([abnormalTerminationReportingEnabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([abnormalTerminationReportingEnabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -5251,10 +4897,8 @@ class NavigationSessionApi { } Future isInitialized() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5280,10 +4924,8 @@ class NavigationSessionApi { } Future cleanup() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5303,22 +4945,15 @@ class NavigationSessionApi { } } - Future showTermsAndConditionsDialog(String title, String companyName, - bool shouldOnlyShowDriverAwarenessDisclaimer) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future showTermsAndConditionsDialog(String title, String companyName, bool shouldOnlyShowDriverAwarenessDisclaimer) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([ - title, - companyName, - shouldOnlyShowDriverAwarenessDisclaimer - ]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([title, companyName, shouldOnlyShowDriverAwarenessDisclaimer]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -5338,10 +4973,8 @@ class NavigationSessionApi { } Future areTermsAccepted() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5367,10 +5000,8 @@ class NavigationSessionApi { } Future resetTermsAccepted() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5391,10 +5022,8 @@ class NavigationSessionApi { } Future getNavSDKVersion() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5421,10 +5050,8 @@ class NavigationSessionApi { /// Navigation. Future isGuidanceRunning() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5450,10 +5077,8 @@ class NavigationSessionApi { } Future startGuidance() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5474,10 +5099,8 @@ class NavigationSessionApi { } Future stopGuidance() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5498,10 +5121,8 @@ class NavigationSessionApi { } Future setDestinations(DestinationsDto destinations) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5527,10 +5148,8 @@ class NavigationSessionApi { } Future clearDestinations() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5551,10 +5170,8 @@ class NavigationSessionApi { } Future continueToNextDestination() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5575,10 +5192,8 @@ class NavigationSessionApi { } Future getCurrentTimeAndDistance() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5603,12 +5218,9 @@ class NavigationSessionApi { } } - Future setAudioGuidance( - NavigationAudioGuidanceSettingsDto settings) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future setAudioGuidance(NavigationAudioGuidanceSettingsDto settings) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5629,10 +5241,8 @@ class NavigationSessionApi { } Future setSpeedAlertOptions(SpeedAlertOptionsDto options) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5653,10 +5263,8 @@ class NavigationSessionApi { } Future> getRouteSegments() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5677,16 +5285,13 @@ class NavigationSessionApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)! - .cast(); + return (__pigeon_replyList[0] as List?)!.cast(); } } Future> getTraveledRoute() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5712,10 +5317,8 @@ class NavigationSessionApi { } Future getCurrentRouteSegment() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5737,10 +5340,8 @@ class NavigationSessionApi { /// Simulation Future setUserLocation(LatLngDto location) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5761,10 +5362,8 @@ class NavigationSessionApi { } Future removeUserLocation() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5785,10 +5384,8 @@ class NavigationSessionApi { } Future simulateLocationsAlongExistingRoute() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5808,12 +5405,9 @@ class NavigationSessionApi { } } - Future simulateLocationsAlongExistingRouteWithOptions( - SimulationOptionsDto options) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future simulateLocationsAlongExistingRouteWithOptions(SimulationOptionsDto options) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5833,12 +5427,9 @@ class NavigationSessionApi { } } - Future simulateLocationsAlongNewRoute( - List waypoints) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future simulateLocationsAlongNewRoute(List waypoints) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5863,19 +5454,15 @@ class NavigationSessionApi { } } - Future simulateLocationsAlongNewRouteWithRoutingOptions( - List waypoints, - RoutingOptionsDto routingOptions) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future simulateLocationsAlongNewRouteWithRoutingOptions(List waypoints, RoutingOptionsDto routingOptions) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([waypoints, routingOptions]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([waypoints, routingOptions]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -5894,22 +5481,15 @@ class NavigationSessionApi { } } - Future - simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( - List waypoints, - RoutingOptionsDto routingOptions, - SimulationOptionsDto simulationOptions) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(List waypoints, RoutingOptionsDto routingOptions, SimulationOptionsDto simulationOptions) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([waypoints, routingOptions, simulationOptions]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([waypoints, routingOptions, simulationOptions]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -5929,10 +5509,8 @@ class NavigationSessionApi { } Future pauseSimulation() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5953,10 +5531,8 @@ class NavigationSessionApi { } Future resumeSimulation() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5978,10 +5554,8 @@ class NavigationSessionApi { /// Simulation (iOS only) Future allowBackgroundLocationUpdates(bool allow) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -6003,10 +5577,8 @@ class NavigationSessionApi { /// Road snapped location updates. Future enableRoadSnappedLocationUpdates() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -6027,10 +5599,8 @@ class NavigationSessionApi { } Future disableRoadSnappedLocationUpdates() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -6051,18 +5621,15 @@ class NavigationSessionApi { } /// Enable Turn-by-Turn navigation events. - Future enableTurnByTurnNavigationEvents( - int? numNextStepsToPreview) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future enableTurnByTurnNavigationEvents(int? numNextStepsToPreview) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([numNextStepsToPreview]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([numNextStepsToPreview]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -6077,10 +5644,8 @@ class NavigationSessionApi { } Future disableTurnByTurnNavigationEvents() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -6100,22 +5665,15 @@ class NavigationSessionApi { } } - Future registerRemainingTimeOrDistanceChangedListener( - int remainingTimeThresholdSeconds, - int remainingDistanceThresholdMeters) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future registerRemainingTimeOrDistanceChangedListener(int remainingTimeThresholdSeconds, int remainingDistanceThresholdMeters) async { + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([ - remainingTimeThresholdSeconds, - remainingDistanceThresholdMeters - ]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([remainingTimeThresholdSeconds, remainingDistanceThresholdMeters]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -6166,21 +5724,21 @@ class _NavigationSessionEventApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LaneDirectionDto.decode(readValue(buffer)!); - case 129: + case 129: return LaneDto.decode(readValue(buffer)!); - case 130: + case 130: return LatLngDto.decode(readValue(buffer)!); - case 131: + case 131: return NavInfoDto.decode(readValue(buffer)!); - case 132: + case 132: return NavigationWaypointDto.decode(readValue(buffer)!); - case 133: + case 133: return SpeedingUpdatedEventDto.decode(readValue(buffer)!); - case 134: + case 134: return StepInfoDto.decode(readValue(buffer)!); - case 135: + case 135: return StepInfoDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -6189,8 +5747,7 @@ class _NavigationSessionEventApiCodec extends StandardMessageCodec { } abstract class NavigationSessionEventApi { - static const MessageCodec pigeonChannelCodec = - _NavigationSessionEventApiCodec(); + static const MessageCodec pigeonChannelCodec = _NavigationSessionEventApiCodec(); void onSpeedingUpdated(SpeedingUpdatedEventDto msg); @@ -6202,8 +5759,7 @@ abstract class NavigationSessionEventApi { void onRouteChanged(); - void onRemainingTimeOrDistanceChanged( - double remainingTime, double remainingDistance); + void onRemainingTimeOrDistanceChanged(double remainingTime, double remainingDistance); /// Android-only event. void onTrafficUpdated(); @@ -6217,23 +5773,19 @@ abstract class NavigationSessionEventApi { /// Turn-by-Turn navigation events. void onNavInfo(NavInfoDto navInfo); - static void setup(NavigationSessionEventApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(NavigationSessionEventApi? api, {BinaryMessenger? binaryMessenger}) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated was null.'); final List args = (message as List?)!; - final SpeedingUpdatedEventDto? arg_msg = - (args[0] as SpeedingUpdatedEventDto?); + final SpeedingUpdatedEventDto? arg_msg = (args[0] as SpeedingUpdatedEventDto?); assert(arg_msg != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated was null, expected non-null SpeedingUpdatedEventDto.'); try { @@ -6241,25 +5793,22 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated was null.'); final List args = (message as List?)!; final LatLngDto? arg_location = (args[0] as LatLngDto?); assert(arg_location != null, @@ -6269,25 +5818,22 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated was null.'); final List args = (message as List?)!; final LatLngDto? arg_location = (args[0] as LatLngDto?); assert(arg_location != null, @@ -6297,28 +5843,24 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival was null.'); final List args = (message as List?)!; - final NavigationWaypointDto? arg_waypoint = - (args[0] as NavigationWaypointDto?); + final NavigationWaypointDto? arg_waypoint = (args[0] as NavigationWaypointDto?); assert(arg_waypoint != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival was null, expected non-null NavigationWaypointDto.'); try { @@ -6326,18 +5868,15 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -6348,25 +5887,22 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged was null.'); final List args = (message as List?)!; final double? arg_remainingTime = (args[0] as double?); assert(arg_remainingTime != null, @@ -6375,23 +5911,19 @@ abstract class NavigationSessionEventApi { assert(arg_remainingDistance != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged was null, expected non-null double.'); try { - api.onRemainingTimeOrDistanceChanged( - arg_remainingTime!, arg_remainingDistance!); + api.onRemainingTimeOrDistanceChanged(arg_remainingTime!, arg_remainingDistance!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -6402,18 +5934,15 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -6424,25 +5953,22 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate was null.'); final List args = (message as List?)!; final bool? arg_available = (args[0] as bool?); assert(arg_available != null, @@ -6452,25 +5978,22 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo was null.'); final List args = (message as List?)!; final NavInfoDto? arg_navInfo = (args[0] as NavInfoDto?); assert(arg_navInfo != null, @@ -6480,9 +6003,8 @@ abstract class NavigationSessionEventApi { 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())); } }); } @@ -6498,14 +6020,11 @@ class NavigationInspector { : __pigeon_binaryMessenger = binaryMessenger; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = StandardMessageCodec(); Future isViewAttachedToSession(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, diff --git a/lib/src/types/view_initialization_options.dart b/lib/src/types/view_initialization_options.dart index 7a1228f..8dcc361 100644 --- a/lib/src/types/view_initialization_options.dart +++ b/lib/src/types/view_initialization_options.dart @@ -37,13 +37,13 @@ import '../../google_navigation_flutter.dart'; /// ``` /// {@category Navigation View} @immutable -class NavigationViewInitializationOptions { - /// Creates a new instance of [NavigationViewInitializationOptions] with the given initial +class MapViewInitializationOptions { + /// Creates a new instance of [MapViewInitializationOptions ] with the given initial /// parameters to configure the navigation view. - const NavigationViewInitializationOptions({ + const MapViewInitializationOptions({ required this.layoutDirection, required this.mapOptions, - required this.navigationViewOptions, + this.navigationViewOptions, this.gestureRecognizers = const >{}, }); @@ -51,7 +51,7 @@ class NavigationViewInitializationOptions { final MapOptions mapOptions; /// The initial navigation options for the navigation view. - final NavigationViewOptions navigationViewOptions; + final NavigationViewOptions? navigationViewOptions; /// A direction in which text flows on the widget. final TextDirection layoutDirection; @@ -85,19 +85,19 @@ class MapOptions { /// Creates a new instance of [MapOptions] with the given initial /// parameters to configure the map view. const MapOptions({ - required this.cameraPosition, - required this.mapType, - required this.compassEnabled, - required this.rotateGesturesEnabled, - required this.scrollGesturesEnabled, - required this.tiltGesturesEnabled, - required this.zoomGesturesEnabled, - required this.scrollGesturesEnabledDuringRotateOrZoom, - required this.mapToolbarEnabled, - required this.minZoomPreference, - required this.maxZoomPreference, - required this.zoomControlsEnabled, - required this.cameraTargetBounds, + this.cameraPosition = const CameraPosition(), + this.mapType = MapType.normal, + this.compassEnabled = true, + this.rotateGesturesEnabled = true, + this.scrollGesturesEnabled = true, + this.tiltGesturesEnabled = true, + this.zoomGesturesEnabled = true, + this.scrollGesturesEnabledDuringRotateOrZoom = true, + this.mapToolbarEnabled = true, + this.minZoomPreference, + this.maxZoomPreference, + this.zoomControlsEnabled = true, + this.cameraTargetBounds, }) : assert( minZoomPreference == null || maxZoomPreference == null || @@ -111,24 +111,53 @@ class MapOptions { final MapType mapType; /// Specifies whether the compass should be enabled. + /// + /// The compass is an icon on the map that indicates the direction of north on the map. + /// If enabled, it is only shown when the camera is tilted or rotated away from + /// its default orientation (tilt of 0 and a bearing of 0). + /// + /// By default, the compass is enabled. final bool compassEnabled; /// Specifies whether rotate gestures should be enabled. + /// + /// If enabled, users can use a two-finger rotate gesture to rotate the camera. + /// If disabled, users cannot rotate the camera via gestures. + /// This setting doesn't restrict the user from tapping the compass icon to reset the camera orientation, + /// nor does it restrict programmatic movements and animation of the camera. + /// + /// By default, the rotation gestures are enabled. final bool rotateGesturesEnabled; /// Specifies whether scroll gestures should be enabled. + /// + /// By default, the scroll gestures are enabled. final bool scrollGesturesEnabled; /// Specifies whether tilt gestures should be enabled. + /// + /// By default, the tilt gestures are enabled. final bool tiltGesturesEnabled; /// Specifies whether zoom gestures should be enabled. + /// + /// By default, the zoom gestures enabled. final bool zoomGesturesEnabled; /// Specifies whether scroll gestures during rotate or zoom should be enabled. + /// + /// If enabled, users can swipe to pan the camera. If disabled, swiping has no effect. + /// This setting doesn't restrict programmatic movement and animation of the camera. + /// + /// By default, the zoom gestures enabled. final bool scrollGesturesEnabledDuringRotateOrZoom; /// Specifies whether the mapToolbar should be enabled. Only applicable on Android. + /// + /// If enabled, and the Map Toolbar can be shown in the current context, + /// users will see a bar with various context-dependent actions. + /// + /// By default, the Map Toolbar is enabled. final bool mapToolbarEnabled; /// Specifies a preferred lower bound for camera zoom. @@ -136,16 +165,21 @@ class MapOptions { /// Null value means unbounded. final double? minZoomPreference; - /// Specifies a preferred upper bound for camera zoom. + /// Specifies a preferred lower bound for camera zoom. /// /// Null value means unbounded. + /// Null by default (not limited). final double? maxZoomPreference; /// Specifies whether the zoom controls should be enabled. Only applicable on Android. + /// + /// By default, the zoom controls are enabled. final bool zoomControlsEnabled; /// Specifies a bounds to constrain the camera target, so that when users scroll and pan the map, /// the camera target does not move outside these bounds. + /// + /// Null by default (unbounded). final LatLngBounds? cameraTargetBounds; } diff --git a/pigeons/messages.dart b/pigeons/messages.dart index 21880b3..6675add 100644 --- a/pigeons/messages.dart +++ b/pigeons/messages.dart @@ -27,6 +27,15 @@ import 'package:pigeon/pigeon.dart'; ), ) +/// Describes the type of map to construct. +enum MapViewTypeDto { + /// Navigation view supports navigation overlay, and current navigation session is displayed on the map. + navigation, + + /// Classic map view, without navigation overlay. + map, +} + /// Object containing map options used to initialize Google Map view. class MapOptionsDto { MapOptionsDto({ @@ -110,13 +119,15 @@ class NavigationViewOptionsDto { /// /// This message is used to initialize a new navigation view with a /// specified initial parameters. -class NavigationViewCreationOptionsDto { - NavigationViewCreationOptionsDto({ +class ViewCreationOptionsDto { + ViewCreationOptionsDto({ + required this.mapViewType, required this.mapOptions, required this.navigationViewOptions, }); + final MapViewTypeDto mapViewType; final MapOptionsDto mapOptions; - final NavigationViewOptionsDto navigationViewOptions; + final NavigationViewOptionsDto? navigationViewOptions; } /// Pigeon only generates messages if the messages are used in API. @@ -126,7 +137,7 @@ class NavigationViewCreationOptionsDto { // ignore: unused_element abstract class _NavigationViewCreationApi { // ignore: unused_element - void _create(NavigationViewCreationOptionsDto msg); + void _create(ViewCreationOptionsDto msg); } enum MapTypeDto { none, normal, satellite, terrain, hybrid } @@ -366,8 +377,8 @@ enum CameraEventTypeDto { onCameraStoppedFollowingLocation } -@HostApi(dartHostTestHandler: 'TestNavigationViewApi') -abstract class NavigationViewApi { +@HostApi(dartHostTestHandler: 'TestMapViewApi') +abstract class MapViewApi { @async void awaitMapReady(int viewId); @@ -498,7 +509,7 @@ abstract class ImageRegistryApi { } @FlutterApi() -abstract class NavigationViewEventApi { +abstract class ViewEventApi { void onMapClickEvent(int viewId, LatLngDto latLng); void onMapLongClickEvent(int viewId, LatLngDto latLng); void onRecenterButtonClicked(int viewId); diff --git a/test/messages_test.g.dart b/test/messages_test.g.dart index b01ac6d..bb0e139 100644 --- a/test/messages_test.g.dart +++ b/test/messages_test.g.dart @@ -1,17 +1,17 @@ // Copyright 2023 Google LLC -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // https://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Autogenerated from Pigeon (v15.0.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, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -24,8 +24,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:google_navigation_flutter/src/method_channel/messages.g.dart'; -class _TestNavigationViewApiCodec extends StandardMessageCodec { - const _TestNavigationViewApiCodec(); +class _TestMapViewApiCodec extends StandardMessageCodec { + const _TestMapViewApiCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { if (value is CameraPositionDto) { @@ -93,43 +93,43 @@ class _TestNavigationViewApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPositionDto.decode(readValue(buffer)!); - case 129: + case 129: return CircleDto.decode(readValue(buffer)!); - case 130: + case 130: return CircleOptionsDto.decode(readValue(buffer)!); - case 131: + case 131: return ImageDescriptorDto.decode(readValue(buffer)!); - case 132: + case 132: return InfoWindowDto.decode(readValue(buffer)!); - case 133: + case 133: return LatLngBoundsDto.decode(readValue(buffer)!); - case 134: + case 134: return LatLngDto.decode(readValue(buffer)!); - case 135: + case 135: return LatLngDto.decode(readValue(buffer)!); - case 136: + case 136: return MarkerAnchorDto.decode(readValue(buffer)!); - case 137: + case 137: return MarkerDto.decode(readValue(buffer)!); - case 138: + case 138: return MarkerOptionsDto.decode(readValue(buffer)!); - case 139: + case 139: return PatternItemDto.decode(readValue(buffer)!); - case 140: + case 140: return PolygonDto.decode(readValue(buffer)!); - case 141: + case 141: return PolygonHoleDto.decode(readValue(buffer)!); - case 142: + case 142: return PolygonOptionsDto.decode(readValue(buffer)!); - case 143: + case 143: return PolylineDto.decode(readValue(buffer)!); - case 144: + case 144: return PolylineOptionsDto.decode(readValue(buffer)!); - case 145: + case 145: return StyleSpanDto.decode(readValue(buffer)!); - case 146: + case 146: return StyleSpanStrokeStyleDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -137,11 +137,9 @@ class _TestNavigationViewApiCodec extends StandardMessageCodec { } } -abstract class TestNavigationViewApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestNavigationViewApiCodec(); +abstract class TestMapViewApi { + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec pigeonChannelCodec = _TestMapViewApiCodec(); Future awaitMapReady(int viewId); @@ -193,26 +191,19 @@ abstract class TestNavigationViewApi { LatLngBoundsDto getVisibleRegion(int viewId); - void followMyLocation( - int viewId, CameraPerspectiveDto perspective, double? zoomLevel); + void followMyLocation(int viewId, CameraPerspectiveDto perspective, double? zoomLevel); - Future animateCameraToCameraPosition( - int viewId, CameraPositionDto cameraPosition, int? duration); + Future animateCameraToCameraPosition(int viewId, CameraPositionDto cameraPosition, int? duration); - Future animateCameraToLatLng( - int viewId, LatLngDto point, int? duration); + Future animateCameraToLatLng(int viewId, LatLngDto point, int? duration); - Future animateCameraToLatLngBounds( - int viewId, LatLngBoundsDto bounds, double padding, int? duration); + Future animateCameraToLatLngBounds(int viewId, LatLngBoundsDto bounds, double padding, int? duration); - Future animateCameraToLatLngZoom( - int viewId, LatLngDto point, double zoom, int? duration); + Future animateCameraToLatLngZoom(int viewId, LatLngDto point, double zoom, int? duration); - Future animateCameraByScroll( - int viewId, double scrollByDx, double scrollByDy, int? duration); + Future animateCameraByScroll(int viewId, double scrollByDx, double scrollByDy, int? duration); - Future animateCameraByZoom(int viewId, double zoomBy, double? focusDx, - double? focusDy, int? duration); + Future animateCameraByZoom(int viewId, double zoomBy, double? focusDx, double? focusDy, int? duration); Future animateCameraToZoom(int viewId, double zoom, int? duration); @@ -220,15 +211,13 @@ abstract class TestNavigationViewApi { void moveCameraToLatLng(int viewId, LatLngDto point); - void moveCameraToLatLngBounds( - int viewId, LatLngBoundsDto bounds, double padding); + void moveCameraToLatLngBounds(int viewId, LatLngBoundsDto bounds, double padding); void moveCameraToLatLngZoom(int viewId, LatLngDto point, double zoom); void moveCameraByScroll(int viewId, double scrollByDx, double scrollByDy); - void moveCameraByZoom( - int viewId, double zoomBy, double? focusDx, double? focusDy); + void moveCameraByZoom(int viewId, double zoomBy, double? focusDx, double? focusDy); void moveCameraToZoom(int viewId, double zoom); @@ -332,3017 +321,2436 @@ abstract class TestNavigationViewApi { void registerOnCameraChangedListener(int viewId); - static void setup(TestNavigationViewApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestMapViewApi? api, {BinaryMessenger? binaryMessenger}) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.awaitMapReady', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.awaitMapReady was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.awaitMapReady was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady was null, expected non-null int.'); try { await api.awaitMapReady(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled was null, expected non-null int.'); try { final bool output = api.isMyLocationEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled was null, expected non-null bool.'); try { api.setMyLocationEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMyLocation', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMyLocation was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMyLocation was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation was null, expected non-null int.'); try { final LatLngDto? output = api.getMyLocation(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMapType', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMapType was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMapType was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType was null, expected non-null int.'); try { final MapTypeDto output = api.getMapType(arg_viewId!); return [output.index]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapType', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapType was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapType was null, expected non-null int.'); - final MapTypeDto? arg_mapType = - args[1] == null ? null : MapTypeDto.values[args[1]! as int]; + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType was null, expected non-null int.'); + final MapTypeDto? arg_mapType = args[1] == null ? null : MapTypeDto.values[args[1]! as int]; assert(arg_mapType != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapType was null, expected non-null MapTypeDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType was null, expected non-null MapTypeDto.'); try { api.setMapType(arg_viewId!, arg_mapType!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapStyle', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapStyle was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapStyle was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle was null, expected non-null int.'); final String? arg_styleJson = (args[1] as String?); assert(arg_styleJson != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapStyle was null, expected non-null String.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle was null, expected non-null String.'); try { api.setMapStyle(arg_viewId!, arg_styleJson!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationTripProgressBarEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationTripProgressBarEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationTripProgressBarEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled was null, expected non-null int.'); try { - final bool output = - api.isNavigationTripProgressBarEnabled(arg_viewId!); + final bool output = api.isNavigationTripProgressBarEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationTripProgressBarEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationTripProgressBarEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationTripProgressBarEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationTripProgressBarEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled was null, expected non-null bool.'); try { api.setNavigationTripProgressBarEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationHeaderEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationHeaderEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationHeaderEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled was null, expected non-null int.'); try { final bool output = api.isNavigationHeaderEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationHeaderEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationHeaderEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationHeaderEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationHeaderEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled was null, expected non-null bool.'); try { api.setNavigationHeaderEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationFooterEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationFooterEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationFooterEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled was null, expected non-null int.'); try { final bool output = api.isNavigationFooterEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationFooterEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationFooterEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationFooterEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationFooterEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled was null, expected non-null bool.'); try { api.setNavigationFooterEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRecenterButtonEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRecenterButtonEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRecenterButtonEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled was null, expected non-null int.'); try { final bool output = api.isRecenterButtonEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRecenterButtonEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRecenterButtonEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRecenterButtonEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRecenterButtonEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled was null, expected non-null bool.'); try { api.setRecenterButtonEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedLimitIconEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedLimitIconEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedLimitIconEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled was null, expected non-null int.'); try { final bool output = api.isSpeedLimitIconEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedLimitIconEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedLimitIconEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedLimitIconEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedLimitIconEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled was null, expected non-null bool.'); try { api.setSpeedLimitIconEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedometerEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedometerEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isSpeedometerEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled was null, expected non-null int.'); try { final bool output = api.isSpeedometerEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedometerEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedometerEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedometerEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setSpeedometerEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled was null, expected non-null bool.'); try { api.setSpeedometerEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficIncidentCardsEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficIncidentCardsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficIncidentCardsEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled was null, expected non-null int.'); try { final bool output = api.isTrafficIncidentCardsEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficIncidentCardsEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficIncidentCardsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficIncidentCardsEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficIncidentCardsEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled was null, expected non-null bool.'); try { api.setTrafficIncidentCardsEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationUIEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationUIEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isNavigationUIEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled was null, expected non-null int.'); try { final bool output = api.isNavigationUIEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationUIEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationUIEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationUIEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setNavigationUIEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled was null, expected non-null bool.'); try { api.setNavigationUIEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCameraPosition', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCameraPosition was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCameraPosition was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition was null, expected non-null int.'); try { final CameraPositionDto output = api.getCameraPosition(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getVisibleRegion', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getVisibleRegion was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getVisibleRegion was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion was null, expected non-null int.'); try { final LatLngBoundsDto output = api.getVisibleRegion(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.followMyLocation', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.followMyLocation was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.followMyLocation was null, expected non-null int.'); - final CameraPerspectiveDto? arg_perspective = args[1] == null - ? null - : CameraPerspectiveDto.values[args[1]! as int]; + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation was null, expected non-null int.'); + final CameraPerspectiveDto? arg_perspective = args[1] == null ? null : CameraPerspectiveDto.values[args[1]! as int]; assert(arg_perspective != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.followMyLocation was null, expected non-null CameraPerspectiveDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation was null, expected non-null CameraPerspectiveDto.'); final double? arg_zoomLevel = (args[2] as double?); try { api.followMyLocation(arg_viewId!, arg_perspective!, arg_zoomLevel); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToCameraPosition', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToCameraPosition was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToCameraPosition was null, expected non-null int.'); - final CameraPositionDto? arg_cameraPosition = - (args[1] as CameraPositionDto?); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition was null, expected non-null int.'); + final CameraPositionDto? arg_cameraPosition = (args[1] as CameraPositionDto?); assert(arg_cameraPosition != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToCameraPosition was null, expected non-null CameraPositionDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition was null, expected non-null CameraPositionDto.'); final int? arg_duration = (args[2] as int?); try { - final bool output = await api.animateCameraToCameraPosition( - arg_viewId!, arg_cameraPosition!, arg_duration); + final bool output = await api.animateCameraToCameraPosition(arg_viewId!, arg_cameraPosition!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLng', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLng was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLng was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng was null, expected non-null int.'); final LatLngDto? arg_point = (args[1] as LatLngDto?); assert(arg_point != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLng was null, expected non-null LatLngDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng was null, expected non-null LatLngDto.'); final int? arg_duration = (args[2] as int?); try { - final bool output = await api.animateCameraToLatLng( - arg_viewId!, arg_point!, arg_duration); + final bool output = await api.animateCameraToLatLng(arg_viewId!, arg_point!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngBounds', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngBounds was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngBounds was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds was null, expected non-null int.'); final LatLngBoundsDto? arg_bounds = (args[1] as LatLngBoundsDto?); assert(arg_bounds != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngBounds was null, expected non-null LatLngBoundsDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds was null, expected non-null LatLngBoundsDto.'); final double? arg_padding = (args[2] as double?); assert(arg_padding != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngBounds was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds was null, expected non-null double.'); final int? arg_duration = (args[3] as int?); try { - final bool output = await api.animateCameraToLatLngBounds( - arg_viewId!, arg_bounds!, arg_padding!, arg_duration); + final bool output = await api.animateCameraToLatLngBounds(arg_viewId!, arg_bounds!, arg_padding!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngZoom', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngZoom was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom was null, expected non-null int.'); final LatLngDto? arg_point = (args[1] as LatLngDto?); assert(arg_point != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngZoom was null, expected non-null LatLngDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom was null, expected non-null LatLngDto.'); final double? arg_zoom = (args[2] as double?); assert(arg_zoom != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToLatLngZoom was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom was null, expected non-null double.'); final int? arg_duration = (args[3] as int?); try { - final bool output = await api.animateCameraToLatLngZoom( - arg_viewId!, arg_point!, arg_zoom!, arg_duration); + final bool output = await api.animateCameraToLatLngZoom(arg_viewId!, arg_point!, arg_zoom!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByScroll', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByScroll was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByScroll was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll was null, expected non-null int.'); final double? arg_scrollByDx = (args[1] as double?); assert(arg_scrollByDx != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByScroll was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll was null, expected non-null double.'); final double? arg_scrollByDy = (args[2] as double?); assert(arg_scrollByDy != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByScroll was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll was null, expected non-null double.'); final int? arg_duration = (args[3] as int?); try { - final bool output = await api.animateCameraByScroll( - arg_viewId!, arg_scrollByDx!, arg_scrollByDy!, arg_duration); + final bool output = await api.animateCameraByScroll(arg_viewId!, arg_scrollByDx!, arg_scrollByDy!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByZoom', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByZoom was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom was null, expected non-null int.'); final double? arg_zoomBy = (args[1] as double?); assert(arg_zoomBy != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraByZoom was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom was null, expected non-null double.'); final double? arg_focusDx = (args[2] as double?); final double? arg_focusDy = (args[3] as double?); final int? arg_duration = (args[4] as int?); try { - final bool output = await api.animateCameraByZoom(arg_viewId!, - arg_zoomBy!, arg_focusDx, arg_focusDy, arg_duration); + final bool output = await api.animateCameraByZoom(arg_viewId!, arg_zoomBy!, arg_focusDx, arg_focusDy, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToZoom', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToZoom was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom was null, expected non-null int.'); final double? arg_zoom = (args[1] as double?); assert(arg_zoom != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.animateCameraToZoom was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom was null, expected non-null double.'); final int? arg_duration = (args[2] as int?); try { - final bool output = await api.animateCameraToZoom( - arg_viewId!, arg_zoom!, arg_duration); + final bool output = await api.animateCameraToZoom(arg_viewId!, arg_zoom!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToCameraPosition', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToCameraPosition was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToCameraPosition was null, expected non-null int.'); - final CameraPositionDto? arg_cameraPosition = - (args[1] as CameraPositionDto?); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition was null, expected non-null int.'); + final CameraPositionDto? arg_cameraPosition = (args[1] as CameraPositionDto?); assert(arg_cameraPosition != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToCameraPosition was null, expected non-null CameraPositionDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition was null, expected non-null CameraPositionDto.'); try { api.moveCameraToCameraPosition(arg_viewId!, arg_cameraPosition!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLng', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLng was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLng was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng was null, expected non-null int.'); final LatLngDto? arg_point = (args[1] as LatLngDto?); assert(arg_point != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLng was null, expected non-null LatLngDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng was null, expected non-null LatLngDto.'); try { api.moveCameraToLatLng(arg_viewId!, arg_point!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngBounds', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngBounds was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngBounds was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds was null, expected non-null int.'); final LatLngBoundsDto? arg_bounds = (args[1] as LatLngBoundsDto?); assert(arg_bounds != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngBounds was null, expected non-null LatLngBoundsDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds was null, expected non-null LatLngBoundsDto.'); final double? arg_padding = (args[2] as double?); assert(arg_padding != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngBounds was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds was null, expected non-null double.'); try { - api.moveCameraToLatLngBounds( - arg_viewId!, arg_bounds!, arg_padding!); + api.moveCameraToLatLngBounds(arg_viewId!, arg_bounds!, arg_padding!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngZoom', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngZoom was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom was null, expected non-null int.'); final LatLngDto? arg_point = (args[1] as LatLngDto?); assert(arg_point != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngZoom was null, expected non-null LatLngDto.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom was null, expected non-null LatLngDto.'); final double? arg_zoom = (args[2] as double?); assert(arg_zoom != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToLatLngZoom was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom was null, expected non-null double.'); try { api.moveCameraToLatLngZoom(arg_viewId!, arg_point!, arg_zoom!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByScroll', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByScroll was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByScroll was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll was null, expected non-null int.'); final double? arg_scrollByDx = (args[1] as double?); assert(arg_scrollByDx != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByScroll was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll was null, expected non-null double.'); final double? arg_scrollByDy = (args[2] as double?); assert(arg_scrollByDy != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByScroll was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll was null, expected non-null double.'); try { - api.moveCameraByScroll( - arg_viewId!, arg_scrollByDx!, arg_scrollByDy!); + api.moveCameraByScroll(arg_viewId!, arg_scrollByDx!, arg_scrollByDy!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByZoom', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByZoom was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom was null, expected non-null int.'); final double? arg_zoomBy = (args[1] as double?); assert(arg_zoomBy != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraByZoom was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom was null, expected non-null double.'); final double? arg_focusDx = (args[2] as double?); final double? arg_focusDy = (args[3] as double?); try { - api.moveCameraByZoom( - arg_viewId!, arg_zoomBy!, arg_focusDx, arg_focusDy); + api.moveCameraByZoom(arg_viewId!, arg_zoomBy!, arg_focusDx, arg_focusDy); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToZoom', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToZoom was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom was null, expected non-null int.'); final double? arg_zoom = (args[1] as double?); assert(arg_zoom != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.moveCameraToZoom was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom was null, expected non-null double.'); try { api.moveCameraToZoom(arg_viewId!, arg_zoom!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.showRouteOverview', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.showRouteOverview was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.showRouteOverview was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview was null, expected non-null int.'); try { api.showRouteOverview(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMinZoomPreference', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMinZoomPreference was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMinZoomPreference was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference was null, expected non-null int.'); try { final double output = api.getMinZoomPreference(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMaxZoomPreference', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMaxZoomPreference was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMaxZoomPreference was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference was null, expected non-null int.'); try { final double output = api.getMaxZoomPreference(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.resetMinMaxZoomPreference', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.resetMinMaxZoomPreference was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.resetMinMaxZoomPreference was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference was null, expected non-null int.'); try { api.resetMinMaxZoomPreference(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMinZoomPreference', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMinZoomPreference was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMinZoomPreference was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference was null, expected non-null int.'); final double? arg_minZoomPreference = (args[1] as double?); assert(arg_minZoomPreference != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMinZoomPreference was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference was null, expected non-null double.'); try { api.setMinZoomPreference(arg_viewId!, arg_minZoomPreference!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMaxZoomPreference', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMaxZoomPreference was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMaxZoomPreference was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference was null, expected non-null int.'); final double? arg_maxZoomPreference = (args[1] as double?); assert(arg_maxZoomPreference != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMaxZoomPreference was null, expected non-null double.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference was null, expected non-null double.'); try { api.setMaxZoomPreference(arg_viewId!, arg_maxZoomPreference!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationButtonEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationButtonEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationButtonEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMyLocationButtonEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled was null, expected non-null bool.'); try { api.setMyLocationButtonEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setConsumeMyLocationButtonClickEventsEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setConsumeMyLocationButtonClickEventsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setConsumeMyLocationButtonClickEventsEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setConsumeMyLocationButtonClickEventsEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled was null, expected non-null bool.'); try { - api.setConsumeMyLocationButtonClickEventsEnabled( - arg_viewId!, arg_enabled!); + api.setConsumeMyLocationButtonClickEventsEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomGesturesEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomGesturesEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomGesturesEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled was null, expected non-null bool.'); try { api.setZoomGesturesEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomControlsEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomControlsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomControlsEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setZoomControlsEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled was null, expected non-null bool.'); try { api.setZoomControlsEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setCompassEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setCompassEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setCompassEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setCompassEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled was null, expected non-null bool.'); try { api.setCompassEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRotateGesturesEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRotateGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRotateGesturesEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setRotateGesturesEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled was null, expected non-null bool.'); try { api.setRotateGesturesEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled was null, expected non-null bool.'); try { api.setScrollGesturesEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesDuringRotateOrZoomEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesDuringRotateOrZoomEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesDuringRotateOrZoomEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setScrollGesturesDuringRotateOrZoomEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled was null, expected non-null bool.'); try { - api.setScrollGesturesDuringRotateOrZoomEnabled( - arg_viewId!, arg_enabled!); + api.setScrollGesturesDuringRotateOrZoomEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTiltGesturesEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTiltGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTiltGesturesEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTiltGesturesEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled was null, expected non-null bool.'); try { api.setTiltGesturesEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapToolbarEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapToolbarEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapToolbarEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setMapToolbarEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled was null, expected non-null bool.'); try { api.setMapToolbarEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled was null, expected non-null int.'); final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.setTrafficEnabled was null, expected non-null bool.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled was null, expected non-null bool.'); try { api.setTrafficEnabled(arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationButtonEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationButtonEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMyLocationButtonEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled was null, expected non-null int.'); try { final bool output = api.isMyLocationButtonEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isConsumeMyLocationButtonClickEventsEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isConsumeMyLocationButtonClickEventsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isConsumeMyLocationButtonClickEventsEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled was null, expected non-null int.'); try { - final bool output = - api.isConsumeMyLocationButtonClickEventsEnabled(arg_viewId!); + final bool output = api.isConsumeMyLocationButtonClickEventsEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomGesturesEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomGesturesEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled was null, expected non-null int.'); try { final bool output = api.isZoomGesturesEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomControlsEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomControlsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isZoomControlsEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled was null, expected non-null int.'); try { final bool output = api.isZoomControlsEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isCompassEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isCompassEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isCompassEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled was null, expected non-null int.'); try { final bool output = api.isCompassEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRotateGesturesEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRotateGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isRotateGesturesEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled was null, expected non-null int.'); try { final bool output = api.isRotateGesturesEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled was null, expected non-null int.'); try { final bool output = api.isScrollGesturesEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabledDuringRotateOrZoom', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabledDuringRotateOrZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isScrollGesturesEnabledDuringRotateOrZoom was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom was null, expected non-null int.'); try { - final bool output = - api.isScrollGesturesEnabledDuringRotateOrZoom(arg_viewId!); + final bool output = api.isScrollGesturesEnabledDuringRotateOrZoom(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTiltGesturesEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTiltGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTiltGesturesEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled was null, expected non-null int.'); try { final bool output = api.isTiltGesturesEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMapToolbarEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMapToolbarEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isMapToolbarEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled was null, expected non-null int.'); try { final bool output = api.isMapToolbarEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficEnabled', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.isTrafficEnabled was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled was null, expected non-null int.'); try { final bool output = api.isTrafficEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMarkers', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMarkers was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getMarkers was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers was null, expected non-null int.'); try { final List output = api.getMarkers(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addMarkers', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addMarkers was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addMarkers was null, expected non-null int.'); - final List? arg_markers = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers was null, expected non-null int.'); + final List? arg_markers = (args[1] as List?)?.cast(); assert(arg_markers != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addMarkers was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers was null, expected non-null List.'); try { - final List output = - api.addMarkers(arg_viewId!, arg_markers!); + final List output = api.addMarkers(arg_viewId!, arg_markers!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateMarkers', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateMarkers was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateMarkers was null, expected non-null int.'); - final List? arg_markers = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers was null, expected non-null int.'); + final List? arg_markers = (args[1] as List?)?.cast(); assert(arg_markers != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateMarkers was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers was null, expected non-null List.'); try { - final List output = - api.updateMarkers(arg_viewId!, arg_markers!); + final List output = api.updateMarkers(arg_viewId!, arg_markers!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeMarkers', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeMarkers was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeMarkers was null, expected non-null int.'); - final List? arg_markers = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers was null, expected non-null int.'); + final List? arg_markers = (args[1] as List?)?.cast(); assert(arg_markers != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeMarkers was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers was null, expected non-null List.'); try { api.removeMarkers(arg_viewId!, arg_markers!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearMarkers', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearMarkers was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearMarkers was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers was null, expected non-null int.'); try { api.clearMarkers(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clear', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clear was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clear was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear was null, expected non-null int.'); try { api.clear(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolygons', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolygons was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolygons was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons was null, expected non-null int.'); try { final List output = api.getPolygons(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolygons', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolygons was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolygons was null, expected non-null int.'); - final List? arg_polygons = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons was null, expected non-null int.'); + final List? arg_polygons = (args[1] as List?)?.cast(); assert(arg_polygons != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolygons was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons was null, expected non-null List.'); try { - final List output = - api.addPolygons(arg_viewId!, arg_polygons!); + final List output = api.addPolygons(arg_viewId!, arg_polygons!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolygons', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolygons was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolygons was null, expected non-null int.'); - final List? arg_polygons = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons was null, expected non-null int.'); + final List? arg_polygons = (args[1] as List?)?.cast(); assert(arg_polygons != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolygons was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons was null, expected non-null List.'); try { - final List output = - api.updatePolygons(arg_viewId!, arg_polygons!); + final List output = api.updatePolygons(arg_viewId!, arg_polygons!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolygons', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolygons was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolygons was null, expected non-null int.'); - final List? arg_polygons = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons was null, expected non-null int.'); + final List? arg_polygons = (args[1] as List?)?.cast(); assert(arg_polygons != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolygons was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons was null, expected non-null List.'); try { api.removePolygons(arg_viewId!, arg_polygons!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolygons', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolygons was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolygons was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons was null, expected non-null int.'); try { api.clearPolygons(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolylines', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolylines was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getPolylines was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines was null, expected non-null int.'); try { final List output = api.getPolylines(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolylines', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolylines was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolylines was null, expected non-null int.'); - final List? arg_polylines = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines was null, expected non-null int.'); + final List? arg_polylines = (args[1] as List?)?.cast(); assert(arg_polylines != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addPolylines was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines was null, expected non-null List.'); try { - final List output = - api.addPolylines(arg_viewId!, arg_polylines!); + final List output = api.addPolylines(arg_viewId!, arg_polylines!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolylines', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolylines was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolylines was null, expected non-null int.'); - final List? arg_polylines = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines was null, expected non-null int.'); + final List? arg_polylines = (args[1] as List?)?.cast(); assert(arg_polylines != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updatePolylines was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines was null, expected non-null List.'); try { - final List output = - api.updatePolylines(arg_viewId!, arg_polylines!); + final List output = api.updatePolylines(arg_viewId!, arg_polylines!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolylines', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolylines was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolylines was null, expected non-null int.'); - final List? arg_polylines = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines was null, expected non-null int.'); + final List? arg_polylines = (args[1] as List?)?.cast(); assert(arg_polylines != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removePolylines was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines was null, expected non-null List.'); try { api.removePolylines(arg_viewId!, arg_polylines!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolylines', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolylines was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearPolylines was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines was null, expected non-null int.'); try { api.clearPolylines(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCircles', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCircles was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.getCircles was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles was null, expected non-null int.'); try { final List output = api.getCircles(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addCircles', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addCircles was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addCircles was null, expected non-null int.'); - final List? arg_circles = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles was null, expected non-null int.'); + final List? arg_circles = (args[1] as List?)?.cast(); assert(arg_circles != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.addCircles was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles was null, expected non-null List.'); try { - final List output = - api.addCircles(arg_viewId!, arg_circles!); + final List output = api.addCircles(arg_viewId!, arg_circles!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateCircles', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateCircles was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateCircles was null, expected non-null int.'); - final List? arg_circles = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles was null, expected non-null int.'); + final List? arg_circles = (args[1] as List?)?.cast(); assert(arg_circles != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.updateCircles was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles was null, expected non-null List.'); try { - final List output = - api.updateCircles(arg_viewId!, arg_circles!); + final List output = api.updateCircles(arg_viewId!, arg_circles!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeCircles', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeCircles was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeCircles was null, expected non-null int.'); - final List? arg_circles = - (args[1] as List?)?.cast(); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles was null, expected non-null int.'); + final List? arg_circles = (args[1] as List?)?.cast(); assert(arg_circles != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.removeCircles was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles was null, expected non-null List.'); try { api.removeCircles(arg_viewId!, arg_circles!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearCircles', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearCircles was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.clearCircles was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles was null, expected non-null int.'); try { api.clearCircles(arg_viewId!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.registerOnCameraChangedListener', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.registerOnCameraChangedListener was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationViewApi.registerOnCameraChangedListener was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener was null, expected non-null int.'); try { api.registerOnCameraChangedListener(arg_viewId!); 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())); } }); } @@ -3368,9 +2776,9 @@ class _TestImageRegistryApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ImageDescriptorDto.decode(readValue(buffer)!); - case 129: + case 129: return ImageDescriptorDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -3379,13 +2787,10 @@ class _TestImageRegistryApiCodec extends StandardMessageCodec { } abstract class TestImageRegistryApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestImageRegistryApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec pigeonChannelCodec = _TestImageRegistryApiCodec(); - ImageDescriptorDto registerBitmapImage(String imageId, Uint8List bytes, - double imagePixelRatio, double? width, double? height); + ImageDescriptorDto registerBitmapImage(String imageId, Uint8List bytes, double imagePixelRatio, double? width, double? height); void unregisterImage(ImageDescriptorDto imageDescriptor); @@ -3393,23 +2798,17 @@ abstract class TestImageRegistryApi { void clearRegisteredImages(); - static void setup(TestImageRegistryApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageRegistryApi? api, {BinaryMessenger? binaryMessenger}) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage was null.'); final List args = (message as List?)!; final String? arg_imageId = (args[0] as String?); assert(arg_imageId != null, @@ -3423,40 +2822,28 @@ abstract class TestImageRegistryApi { final double? arg_width = (args[3] as double?); final double? arg_height = (args[4] as double?); try { - final ImageDescriptorDto output = api.registerBitmapImage( - arg_imageId!, - arg_bytes!, - arg_imagePixelRatio!, - arg_width, - arg_height); + final ImageDescriptorDto output = api.registerBitmapImage(arg_imageId!, arg_bytes!, arg_imagePixelRatio!, arg_width, arg_height); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage was null.'); final List args = (message as List?)!; - final ImageDescriptorDto? arg_imageDescriptor = - (args[0] as ImageDescriptorDto?); + final ImageDescriptorDto? arg_imageDescriptor = (args[0] as ImageDescriptorDto?); assert(arg_imageDescriptor != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage was null, expected non-null ImageDescriptorDto.'); try { @@ -3464,59 +2851,46 @@ abstract class TestImageRegistryApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { final List output = api.getRegisteredImages(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.clearRegisteredImages(); 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())); } }); } @@ -3584,38 +2958,37 @@ class _TestNavigationSessionApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return DestinationsDto.decode(readValue(buffer)!); - case 129: + case 129: return LatLngDto.decode(readValue(buffer)!); - case 130: + case 130: return LatLngDto.decode(readValue(buffer)!); - case 131: + case 131: return NavigationAudioGuidanceSettingsDto.decode(readValue(buffer)!); - case 132: + case 132: return NavigationDisplayOptionsDto.decode(readValue(buffer)!); - case 133: + case 133: return NavigationTimeAndDistanceDto.decode(readValue(buffer)!); - case 134: + case 134: return NavigationWaypointDto.decode(readValue(buffer)!); - case 135: + case 135: return NavigationWaypointDto.decode(readValue(buffer)!); - case 136: + case 136: return RouteSegmentDto.decode(readValue(buffer)!); - case 137: + case 137: return RouteSegmentDto.decode(readValue(buffer)!); - case 138: + case 138: return RouteSegmentTrafficDataDto.decode(readValue(buffer)!); - case 139: - return RouteSegmentTrafficDataRoadStretchRenderingDataDto.decode( - readValue(buffer)!); - case 140: + case 139: + return RouteSegmentTrafficDataRoadStretchRenderingDataDto.decode(readValue(buffer)!); + case 140: return RouteTokenOptionsDto.decode(readValue(buffer)!); - case 141: + case 141: return RoutingOptionsDto.decode(readValue(buffer)!); - case 142: + case 142: return SimulationOptionsDto.decode(readValue(buffer)!); - case 143: + case 143: return SpeedAlertOptionsDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -3624,21 +2997,17 @@ class _TestNavigationSessionApiCodec extends StandardMessageCodec { } abstract class TestNavigationSessionApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestNavigationSessionApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec pigeonChannelCodec = _TestNavigationSessionApiCodec(); /// General. - Future createNavigationSession( - bool abnormalTerminationReportingEnabled); + Future createNavigationSession(bool abnormalTerminationReportingEnabled); bool isInitialized(); void cleanup(); - Future showTermsAndConditionsDialog(String title, String companyName, - bool shouldOnlyShowDriverAwarenessDisclaimer); + Future showTermsAndConditionsDialog(String title, String companyName, bool shouldOnlyShowDriverAwarenessDisclaimer); bool areTermsAccepted(); @@ -3678,20 +3047,13 @@ abstract class TestNavigationSessionApi { void simulateLocationsAlongExistingRoute(); - void simulateLocationsAlongExistingRouteWithOptions( - SimulationOptionsDto options); + void simulateLocationsAlongExistingRouteWithOptions(SimulationOptionsDto options); - Future simulateLocationsAlongNewRoute( - List waypoints); + Future simulateLocationsAlongNewRoute(List waypoints); - Future simulateLocationsAlongNewRouteWithRoutingOptions( - List waypoints, RoutingOptionsDto routingOptions); + Future simulateLocationsAlongNewRouteWithRoutingOptions(List waypoints, RoutingOptionsDto routingOptions); - Future - simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( - List waypoints, - RoutingOptionsDto routingOptions, - SimulationOptionsDto simulationOptions); + Future simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(List waypoints, RoutingOptionsDto routingOptions, SimulationOptionsDto simulationOptions); void pauseSimulation(); @@ -3710,109 +3072,82 @@ abstract class TestNavigationSessionApi { void disableTurnByTurnNavigationEvents(); - void registerRemainingTimeOrDistanceChangedListener( - int remainingTimeThresholdSeconds, int remainingDistanceThresholdMeters); + void registerRemainingTimeOrDistanceChangedListener(int remainingTimeThresholdSeconds, int remainingDistanceThresholdMeters); - static void setup(TestNavigationSessionApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestNavigationSessionApi? api, {BinaryMessenger? binaryMessenger}) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession was null.'); final List args = (message as List?)!; - final bool? arg_abnormalTerminationReportingEnabled = - (args[0] as bool?); + final bool? arg_abnormalTerminationReportingEnabled = (args[0] as bool?); assert(arg_abnormalTerminationReportingEnabled != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession was null, expected non-null bool.'); try { - await api.createNavigationSession( - arg_abnormalTerminationReportingEnabled!); + await api.createNavigationSession(arg_abnormalTerminationReportingEnabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { final bool output = api.isInitialized(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.cleanup(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog was null.'); final List args = (message as List?)!; final String? arg_title = (args[0] as String?); assert(arg_title != null, @@ -3820,303 +3155,228 @@ abstract class TestNavigationSessionApi { final String? arg_companyName = (args[1] as String?); assert(arg_companyName != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog was null, expected non-null String.'); - final bool? arg_shouldOnlyShowDriverAwarenessDisclaimer = - (args[2] as bool?); + final bool? arg_shouldOnlyShowDriverAwarenessDisclaimer = (args[2] as bool?); assert(arg_shouldOnlyShowDriverAwarenessDisclaimer != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog was null, expected non-null bool.'); try { - final bool output = await api.showTermsAndConditionsDialog( - arg_title!, - arg_companyName!, - arg_shouldOnlyShowDriverAwarenessDisclaimer!); + final bool output = await api.showTermsAndConditionsDialog(arg_title!, arg_companyName!, arg_shouldOnlyShowDriverAwarenessDisclaimer!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { final bool output = api.areTermsAccepted(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.resetTermsAccepted(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { final String output = api.getNavSDKVersion(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { final bool output = api.isGuidanceRunning(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.startGuidance(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.stopGuidance(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations was null.'); final List args = (message as List?)!; - final DestinationsDto? arg_destinations = - (args[0] as DestinationsDto?); + final DestinationsDto? arg_destinations = (args[0] as DestinationsDto?); assert(arg_destinations != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations was null, expected non-null DestinationsDto.'); try { - final RouteStatusDto output = - await api.setDestinations(arg_destinations!); + final RouteStatusDto output = await api.setDestinations(arg_destinations!); return [output.index]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.clearDestinations(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { - final NavigationWaypointDto? output = - api.continueToNextDestination(); + final NavigationWaypointDto? output = api.continueToNextDestination(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { - final NavigationTimeAndDistanceDto output = - api.getCurrentTimeAndDistance(); + final NavigationTimeAndDistanceDto output = api.getCurrentTimeAndDistance(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance was null.'); final List args = (message as List?)!; - final NavigationAudioGuidanceSettingsDto? arg_settings = - (args[0] as NavigationAudioGuidanceSettingsDto?); + final NavigationAudioGuidanceSettingsDto? arg_settings = (args[0] as NavigationAudioGuidanceSettingsDto?); assert(arg_settings != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance was null, expected non-null NavigationAudioGuidanceSettingsDto.'); try { @@ -4124,31 +3384,24 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions was null.'); final List args = (message as List?)!; - final SpeedAlertOptionsDto? arg_options = - (args[0] as SpeedAlertOptionsDto?); + final SpeedAlertOptionsDto? arg_options = (args[0] as SpeedAlertOptionsDto?); assert(arg_options != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions was null, expected non-null SpeedAlertOptionsDto.'); try { @@ -4156,103 +3409,79 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { final List output = api.getRouteSegments(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { final List output = api.getTraveledRoute(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { final RouteSegmentDto? output = api.getCurrentRouteSegment(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation was null.'); final List args = (message as List?)!; final LatLngDto? arg_location = (args[0] as LatLngDto?); assert(arg_location != null, @@ -4262,81 +3491,62 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.removeUserLocation(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.simulateLocationsAlongExistingRoute(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions was null.'); final List args = (message as List?)!; - final SimulationOptionsDto? arg_options = - (args[0] as SimulationOptionsDto?); + final SimulationOptionsDto? arg_options = (args[0] as SimulationOptionsDto?); assert(arg_options != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions was null, expected non-null SimulationOptionsDto.'); try { @@ -4344,193 +3554,144 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute was null.'); final List args = (message as List?)!; - final List? arg_waypoints = - (args[0] as List?)?.cast(); + final List? arg_waypoints = (args[0] as List?)?.cast(); assert(arg_waypoints != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute was null, expected non-null List.'); try { - final RouteStatusDto output = - await api.simulateLocationsAlongNewRoute(arg_waypoints!); + final RouteStatusDto output = await api.simulateLocationsAlongNewRoute(arg_waypoints!); return [output.index]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions was null.'); final List args = (message as List?)!; - final List? arg_waypoints = - (args[0] as List?)?.cast(); + final List? arg_waypoints = (args[0] as List?)?.cast(); assert(arg_waypoints != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions was null, expected non-null List.'); - final RoutingOptionsDto? arg_routingOptions = - (args[1] as RoutingOptionsDto?); + final RoutingOptionsDto? arg_routingOptions = (args[1] as RoutingOptionsDto?); assert(arg_routingOptions != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions was null, expected non-null RoutingOptionsDto.'); try { - final RouteStatusDto output = - await api.simulateLocationsAlongNewRouteWithRoutingOptions( - arg_waypoints!, arg_routingOptions!); + final RouteStatusDto output = await api.simulateLocationsAlongNewRouteWithRoutingOptions(arg_waypoints!, arg_routingOptions!); return [output.index]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions was null.'); final List args = (message as List?)!; - final List? arg_waypoints = - (args[0] as List?)?.cast(); + final List? arg_waypoints = (args[0] as List?)?.cast(); assert(arg_waypoints != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions was null, expected non-null List.'); - final RoutingOptionsDto? arg_routingOptions = - (args[1] as RoutingOptionsDto?); + final RoutingOptionsDto? arg_routingOptions = (args[1] as RoutingOptionsDto?); assert(arg_routingOptions != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions was null, expected non-null RoutingOptionsDto.'); - final SimulationOptionsDto? arg_simulationOptions = - (args[2] as SimulationOptionsDto?); + final SimulationOptionsDto? arg_simulationOptions = (args[2] as SimulationOptionsDto?); assert(arg_simulationOptions != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions was null, expected non-null SimulationOptionsDto.'); try { - final RouteStatusDto output = await api - .simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( - arg_waypoints!, - arg_routingOptions!, - arg_simulationOptions!); + final RouteStatusDto output = await api.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(arg_waypoints!, arg_routingOptions!, arg_simulationOptions!); return [output.index]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.pauseSimulation(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.resumeSimulation(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates was null.'); final List args = (message as List?)!; final bool? arg_allow = (args[0] as bool?); assert(arg_allow != null, @@ -4540,78 +3701,60 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.enableRoadSnappedLocationUpdates(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.disableRoadSnappedLocationUpdates(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents was null.'); final List args = (message as List?)!; final int? arg_numNextStepsToPreview = (args[0] as int?); try { @@ -4619,53 +3762,41 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.disableTurnByTurnNavigationEvents(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener was null.'); final List args = (message as List?)!; final int? arg_remainingTimeThresholdSeconds = (args[0] as int?); assert(arg_remainingTimeThresholdSeconds != null, @@ -4674,15 +3805,12 @@ abstract class TestNavigationSessionApi { assert(arg_remainingDistanceThresholdMeters != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener was null, expected non-null int.'); try { - api.registerRemainingTimeOrDistanceChangedListener( - arg_remainingTimeThresholdSeconds!, - arg_remainingDistanceThresholdMeters!); + api.registerRemainingTimeOrDistanceChangedListener(arg_remainingTimeThresholdSeconds!, arg_remainingDistanceThresholdMeters!); 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())); } }); } From 221ab25296162162350ec3265f0d70d1cbe95691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Thu, 26 Sep 2024 16:26:03 +0800 Subject: [PATCH 02/18] feat: map view ios separation and example app page wip --- example/lib/main.dart | 2 +- example/lib/pages/map.dart | 93 ++++--- ios/Classes/Convert+MapConfiguration.swift | 4 +- ios/Classes/GoogleMapsNavigationPlugin.swift | 10 +- ios/Classes/GoogleMapsNavigationView.swift | 251 +++++++++--------- .../GoogleMapsNavigationViewFactory.swift | 16 +- ...ogleMapsNavigationViewMessageHandler.swift | 2 +- .../GoogleMapsNavigationViewRegistry.swift | 5 + lib/src/google_maps_map_view.dart | 61 ++--- lib/src/google_maps_map_view_controller.dart | 75 ------ 10 files changed, 223 insertions(+), 296 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 9c9a249..2d16c99 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -27,7 +27,7 @@ import 'widgets/widgets.dart'; /// The list of pages to show in the Google Maps Navigation demo. final List _allPages = [ const NavigationPage(), - const MapPage(), + const BasicMapPage(), const CameraPage(), const MarkersPage(), const PolygonsPage(), diff --git a/example/lib/pages/map.dart b/example/lib/pages/map.dart index 19b06de..327d9ea 100644 --- a/example/lib/pages/map.dart +++ b/example/lib/pages/map.dart @@ -23,16 +23,22 @@ import 'package:google_navigation_flutter/google_navigation_flutter.dart'; import '../utils/utils.dart'; import '../widgets/widgets.dart'; -class MapPage extends ExamplePage { - const MapPage({super.key}) - : super(leading: const Icon(Icons.map), title: 'Map'); +/// A page to demonstrate the basic classic Google Map without navigation features. +/// +/// All features used in this example are available as well with [GoogleMapsNavigationView]. +/// Uses [GoogleMapView] to display a standard map view. +class BasicMapPage extends ExamplePage { + /// Constructs a [BasicMapPage]. + const BasicMapPage({super.key}) + : super( + leading: const Icon(Icons.map), title: 'Basic Google Map Controls'); @override - ExamplePageState createState() => _MapPageState(); + ExamplePageState createState() => _MapPageState(); } -class _MapPageState extends ExamplePageState { - late final GoogleNavigationViewController _navigationViewController; +class _MapPageState extends ExamplePageState { + late final GoogleMapViewController _mapViewController; late bool isMyLocationEnabled = false; late bool isMyLocationButtonEnabled = true; late bool consumeMyLocationButtonClickEvent = false; @@ -48,29 +54,29 @@ class _MapPageState extends ExamplePageState { Future setMapType(MapType type) async { mapType = type; - await _navigationViewController.setMapType(mapType: type); + await _mapViewController.setMapType(mapType: type); setState(() {}); } Future setMapStyleDefault() async { - await _navigationViewController.setMapStyle(null); + await _mapViewController.setMapStyle(null); } Future setMapStyleNight() async { final String jsonString = await rootBundle.loadString('assets/night_style.json'); - await _navigationViewController.setMapStyle(jsonString); + await _mapViewController.setMapStyle(jsonString); } Future setMapStyleSepia() async { final String jsonString = await rootBundle.loadString('assets/sepia_style.json'); - await _navigationViewController.setMapStyle(jsonString); + await _mapViewController.setMapStyle(jsonString); } // ignore: use_setters_to_change_properties - Future _onViewCreated(GoogleNavigationViewController controller) async { - _navigationViewController = controller; + Future _onViewCreated(GoogleMapViewController controller) async { + _mapViewController = controller; setState(() {}); } @@ -100,12 +106,10 @@ class _MapPageState extends ExamplePageState { context, (BuildContext context) => Stack( children: [ - GoogleMapsNavigationView( + GoogleMapsMapView( onViewCreated: _onViewCreated, onMyLocationClicked: _onMyLocationClicked, onMyLocationButtonClicked: _onMyLocationButtonClicked, - initialNavigationUIEnabledPreference: - NavigationUIEnabledPreference.disabled, ), Padding( padding: @@ -178,10 +182,9 @@ class _MapPageState extends ExamplePageState { return Column(children: [ SwitchListTile( onChanged: (bool newValue) async { - await _navigationViewController.settings - .setCompassEnabled(newValue); + await _mapViewController.settings.setCompassEnabled(newValue); final bool enabled = - await _navigationViewController.settings.isCompassEnabled(); + await _mapViewController.settings.isCompassEnabled(); setState(() { isCompassEnabled = enabled; }); @@ -193,9 +196,8 @@ class _MapPageState extends ExamplePageState { value: isMyLocationEnabled, controlAffinity: ListTileControlAffinity.leading, onChanged: (bool newValue) async { - await _navigationViewController.setMyLocationEnabled(newValue); - final bool enabled = - await _navigationViewController.isMyLocationEnabled(); + await _mapViewController.setMyLocationEnabled(newValue); + final bool enabled = await _mapViewController.isMyLocationEnabled(); setState(() { isMyLocationEnabled = enabled; }); @@ -207,9 +209,9 @@ class _MapPageState extends ExamplePageState { controlAffinity: ListTileControlAffinity.leading, onChanged: isMyLocationEnabled ? (bool newValue) async { - await _navigationViewController.settings + await _mapViewController.settings .setMyLocationButtonEnabled(newValue); - final bool enabled = await _navigationViewController.settings + final bool enabled = await _mapViewController.settings .isMyLocationButtonEnabled(); setState(() { isMyLocationButtonEnabled = enabled; @@ -223,9 +225,9 @@ class _MapPageState extends ExamplePageState { controlAffinity: ListTileControlAffinity.leading, onChanged: isMyLocationEnabled && isMyLocationButtonEnabled ? (bool newValue) async { - await _navigationViewController.settings + await _mapViewController.settings .setConsumeMyLocationButtonClickEventsEnabled(newValue); - final bool enabled = await _navigationViewController.settings + final bool enabled = await _mapViewController.settings .isConsumeMyLocationButtonClickEventsEnabled(); setState(() { consumeMyLocationButtonClickEvent = enabled; @@ -235,10 +237,9 @@ class _MapPageState extends ExamplePageState { visualDensity: VisualDensity.compact), SwitchListTile( onChanged: (bool newValue) async { - await _navigationViewController.settings - .setZoomGesturesEnabled(newValue); - final bool enabled = await _navigationViewController.settings - .isZoomGesturesEnabled(); + await _mapViewController.settings.setZoomGesturesEnabled(newValue); + final bool enabled = + await _mapViewController.settings.isZoomGesturesEnabled(); setState(() { isZoomGesturesEnabled = enabled; }); @@ -248,10 +249,10 @@ class _MapPageState extends ExamplePageState { if (Platform.isAndroid) SwitchListTile( onChanged: (bool newValue) async { - await _navigationViewController.settings + await _mapViewController.settings .setZoomControlsEnabled(newValue); - final bool enabled = await _navigationViewController.settings - .isZoomControlsEnabled(); + final bool enabled = + await _mapViewController.settings.isZoomControlsEnabled(); setState(() { isZoomControlsEnabled = enabled; }); @@ -260,10 +261,10 @@ class _MapPageState extends ExamplePageState { value: isZoomControlsEnabled), SwitchListTile( onChanged: (bool newValue) async { - await _navigationViewController.settings + await _mapViewController.settings .setRotateGesturesEnabled(newValue); - final bool enabled = await _navigationViewController.settings - .isRotateGesturesEnabled(); + final bool enabled = + await _mapViewController.settings.isRotateGesturesEnabled(); setState(() { isRotateGesturesEnabled = enabled; }); @@ -272,10 +273,10 @@ class _MapPageState extends ExamplePageState { value: isRotateGesturesEnabled), SwitchListTile( onChanged: (bool newValue) async { - await _navigationViewController.settings + await _mapViewController.settings .setScrollGesturesEnabled(newValue); - final bool enabled = await _navigationViewController.settings - .isScrollGesturesEnabled(); + final bool enabled = + await _mapViewController.settings.isScrollGesturesEnabled(); setState(() { isScrollGesturesEnabled = enabled; }); @@ -284,9 +285,9 @@ class _MapPageState extends ExamplePageState { value: isScrollGesturesEnabled), SwitchListTile( onChanged: (bool newValue) async { - await _navigationViewController.settings + await _mapViewController.settings .setScrollGesturesDuringRotateOrZoomEnabled(newValue); - final bool enabled = await _navigationViewController.settings + final bool enabled = await _mapViewController.settings .isScrollGesturesEnabledDuringRotateOrZoom(); setState(() { isScrollGesturesEnabledDuringRotateOrZoom = enabled; @@ -296,10 +297,9 @@ class _MapPageState extends ExamplePageState { value: isScrollGesturesEnabledDuringRotateOrZoom), SwitchListTile( onChanged: (bool newValue) async { - await _navigationViewController.settings - .setTiltGesturesEnabled(newValue); - final bool enabled = await _navigationViewController.settings - .isTiltGesturesEnabled(); + await _mapViewController.settings.setTiltGesturesEnabled(newValue); + final bool enabled = + await _mapViewController.settings.isTiltGesturesEnabled(); setState(() { isTiltGesturesEnabled = enabled; }); @@ -308,10 +308,9 @@ class _MapPageState extends ExamplePageState { value: isTiltGesturesEnabled), SwitchListTile( onChanged: (bool newValue) async { - await _navigationViewController.settings - .setTrafficEnabled(newValue); + await _mapViewController.settings.setTrafficEnabled(newValue); final bool enabled = - await _navigationViewController.settings.isTrafficEnabled(); + await _mapViewController.settings.isTrafficEnabled(); setState(() { isTrafficEnabled = enabled; }); diff --git a/ios/Classes/Convert+MapConfiguration.swift b/ios/Classes/Convert+MapConfiguration.swift index 3c18c6d..c2659b7 100644 --- a/ios/Classes/Convert+MapConfiguration.swift +++ b/ios/Classes/Convert+MapConfiguration.swift @@ -16,13 +16,15 @@ import Foundation import GoogleMaps extension Convert { - static func convertNavigationUIEnabledPreference(preference: NavigationUIEnabledPreferenceDto) + static func convertNavigationUIEnabledPreference(preference: NavigationUIEnabledPreferenceDto?) -> NavigationUIEnabledPreference { switch preference { case .automatic: return .automatic case .disabled: return .disabled + default: + return .disabled } } diff --git a/ios/Classes/GoogleMapsNavigationPlugin.swift b/ios/Classes/GoogleMapsNavigationPlugin.swift index 624cafd..4b05f48 100644 --- a/ios/Classes/GoogleMapsNavigationPlugin.swift +++ b/ios/Classes/GoogleMapsNavigationPlugin.swift @@ -20,7 +20,7 @@ extension FlutterError: Error {} public class GoogleMapsNavigationPlugin: NSObject, FlutterPlugin { private static var viewRegistry: GoogleMapsNavigationViewRegistry? private static var viewMessageHandler: GoogleMapsNavigationViewMessageHandler? - private static var navigationViewEventApi: NavigationViewEventApi? + private static var viewEventApi: ViewEventApi? private static var navigationInspector: NavigationInspector? private static var sessionMessageHandler: GoogleMapsNavigationSessionMessageHandler? @@ -38,18 +38,18 @@ public class GoogleMapsNavigationPlugin: NSObject, FlutterPlugin { return } viewMessageHandler = GoogleMapsNavigationViewMessageHandler(viewRegistry: viewRegistry!) - NavigationViewApiSetup.setUp( + MapViewApiSetup.setUp( binaryMessenger: registrar.messenger(), api: viewMessageHandler ) - navigationViewEventApi = NavigationViewEventApi(binaryMessenger: registrar.messenger()) - guard navigationViewEventApi != nil else { + viewEventApi = ViewEventApi(binaryMessenger: registrar.messenger()) + guard viewEventApi != nil else { return } imageRegistry = ImageRegistry() let factory = GoogleMapsNavigationViewFactory( viewRegistry: viewRegistry!, - navigationViewEventApi: navigationViewEventApi!, + viewEventApi: viewEventApi!, imageRegistry: imageRegistry! ) registrar.register(factory, withId: "google_navigation_flutter") diff --git a/ios/Classes/GoogleMapsNavigationView.swift b/ios/Classes/GoogleMapsNavigationView.swift index 8d00c1b..4762077 100644 --- a/ios/Classes/GoogleMapsNavigationView.swift +++ b/ios/Classes/GoogleMapsNavigationView.swift @@ -29,10 +29,11 @@ enum GoogleMapsNavigationViewError: Error { } class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelegate { - private var _navigationView: ViewStateAwareGMSMapView! + private var _mapView: ViewStateAwareGMSMapView! private var _viewRegistry: GoogleMapsNavigationViewRegistry - private var _navigationViewEventApi: NavigationViewEventApi + private var _viewEventApi: ViewEventApi private var _viewId: Int64 + private var _isNavigationView: Bool private var _myLocationButton: Bool = true private var _markerControllers: [MarkerController] = [] private var _gmsPolygons: [GMSPolygon] = [] @@ -49,25 +50,27 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega var isAttachedToSession: Bool = false func view() -> UIView { - _navigationView + _mapView } init(frame: CGRect, viewIdentifier viewId: Int64, + isNavigationView: Bool, viewRegistry registry: GoogleMapsNavigationViewRegistry, - navigationViewEventApi: NavigationViewEventApi, + viewEventApi: ViewEventApi, navigationUIEnabledPreference: NavigationUIEnabledPreference, mapConfiguration: MapConfiguration, imageRegistry: ImageRegistry) { _viewId = viewId + _isNavigationView = isNavigationView _viewRegistry = registry - _navigationViewEventApi = navigationViewEventApi + _viewEventApi = viewEventApi _mapConfiguration = mapConfiguration _imageRegistry = imageRegistry let mapViewOptions = GMSMapViewOptions() _mapConfiguration.apply(to: mapViewOptions, withFrame: frame) - _navigationView = ViewStateAwareGMSMapView(options: mapViewOptions) - _mapConfiguration.apply(to: _navigationView) + _mapView = ViewStateAwareGMSMapView(options: mapViewOptions) + _mapConfiguration.apply(to: _mapView) super.init() @@ -75,26 +78,31 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega applyNavigationUIEnabledPreference() registry.registerView(viewId: viewId, view: self) - _navigationView.delegate = self - _navigationView.viewSettledDelegate = self + _mapView.delegate = self + _mapView.viewSettledDelegate = self } deinit { _viewRegistry.unregisterView(viewId: _viewId) - _navigationView.delegate = nil + _mapView.delegate = nil } - func onViewSettled(_ view: UIView) { - _mapConfiguration.applyCameraPosition(to: _navigationView) + func isNavigationView() -> Bool { + _isNavigationView + } - // Attach possible navigation session to map. - GoogleMapsNavigationSessionManager.shared.attachNavigationSessionToMapView( - mapView: self - ) + func onViewSettled(_ view: UIView) { + _mapConfiguration.applyCameraPosition(to: _mapView) - applyNavigationUIEnabledPreference() + // Attach possible navigation session to map if map is navigation view. + if _isNavigationView { + GoogleMapsNavigationSessionManager.shared.attachNavigationSessionToMapView( + mapView: self + ) + applyNavigationUIEnabledPreference() + } - _navigationView.needsUpdateConstraints() + _mapView.needsUpdateConstraints() // Inform the flutter implementation that view is ready to be controlled. _mapViewReady = true @@ -128,7 +136,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega } func isMyLocationEnabled() throws -> Bool { - _navigationView.isMyLocationEnabled + _mapView.isMyLocationEnabled } private func findMarkerController(markerId: String) throws -> MarkerController { @@ -174,21 +182,21 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega } func setMyLocationEnabled(_ enabled: Bool) throws { - _navigationView.isMyLocationEnabled = enabled + _mapView.isMyLocationEnabled = enabled try updateMyLocationButton() } func getMapType() -> GMSMapViewType { - _navigationView.mapType + _mapView.mapType } func setMapType(mapType: GMSMapViewType) throws { - _navigationView.mapType = mapType + _mapView.mapType = mapType } func setMapStyle(styleJson: String) throws { do { - _navigationView.mapStyle = try GMSMapStyle(jsonString: styleJson) + _mapView.mapStyle = try GMSMapStyle(jsonString: styleJson) } catch { throw GoogleMapsNavigationViewError.mapStyleError } @@ -202,12 +210,12 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega func updateMyLocationButton() throws { // Align the behavior with Android: the default value of myLocationButton is true, // but it is not shown if my location is disabled. - _navigationView.settings.myLocationButton = _navigationView + _mapView.settings.myLocationButton = _mapView .isMyLocationEnabled && _myLocationButton } func setZoomGesturesEnabled(_ enabled: Bool) throws { - _navigationView.settings.zoomGestures = enabled + _mapView.settings.zoomGestures = enabled } func setZoomControlsEnabled(_ enabled: Bool) throws { @@ -215,23 +223,23 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega } func setCompassEnabled(_ enabled: Bool) throws { - _navigationView.settings.compassButton = enabled + _mapView.settings.compassButton = enabled } func setRotateGesturesEnabled(_ enabled: Bool) throws { - _navigationView.settings.rotateGestures = enabled + _mapView.settings.rotateGestures = enabled } func setScrollGesturesEnabled(_ enabled: Bool) throws { - _navigationView.settings.scrollGestures = enabled + _mapView.settings.scrollGestures = enabled } func setScrollGesturesDuringRotateOrZoomEnabled(_ enabled: Bool) throws { - _navigationView.settings.allowScrollGesturesDuringRotateOrZoom = enabled + _mapView.settings.allowScrollGesturesDuringRotateOrZoom = enabled } func setTiltGesturesEnabled(_ enabled: Bool) throws { - _navigationView.settings.tiltGestures = enabled + _mapView.settings.tiltGestures = enabled } func setMapToolbarEnabled(_ enabled: Bool) throws { @@ -239,7 +247,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega } func setTrafficEnabled(_ enabled: Bool) throws { - _navigationView.isTrafficEnabled = enabled + _mapView.isTrafficEnabled = enabled } func isMyLocationButtonEnabled() -> Bool { @@ -247,7 +255,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega } func isZoomGesturesEnabled() -> Bool { - _navigationView.settings.zoomGestures + _mapView.settings.zoomGestures } func isZoomControlsEnabled() throws -> Bool { @@ -255,23 +263,23 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega } func isCompassEnabled() -> Bool { - _navigationView.settings.compassButton + _mapView.settings.compassButton } func isRotateGesturesEnabled() -> Bool { - _navigationView.settings.rotateGestures + _mapView.settings.rotateGestures } func isScrollGesturesEnabled() -> Bool { - _navigationView.settings.scrollGestures + _mapView.settings.scrollGestures } func isScrollGesturesEnabledDuringRotateOrZoom() -> Bool { - _navigationView.settings.allowScrollGesturesDuringRotateOrZoom + _mapView.settings.allowScrollGesturesDuringRotateOrZoom } func isTiltGesturesEnabled() -> Bool { - _navigationView.settings.tiltGestures + _mapView.settings.tiltGestures } func isMapToolbarEnabled() throws -> Bool { @@ -279,15 +287,15 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega } func isTrafficEnabled() -> Bool { - _navigationView.isTrafficEnabled + _mapView.isTrafficEnabled } func showRouteOverview() { - _navigationView.cameraMode = .overview + _mapView.cameraMode = .overview } func getMyLocation() -> CLLocationCoordinate2D? { - if let location = _navigationView.myLocation { + if let location = _mapView.myLocation { return location.coordinate } else { return nil @@ -295,82 +303,82 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega } func getCameraPosition() -> GMSCameraPosition { - _navigationView.camera + _mapView.camera } func getVisibleRegion() -> GMSCoordinateBounds { - GMSCoordinateBounds(region: _navigationView.projection.visibleRegion()) + GMSCoordinateBounds(region: _mapView.projection.visibleRegion()) } func animateCameraToCameraPosition(cameraPosition: GMSCameraPosition) { - _navigationView.animate(with: GMSCameraUpdate.setCamera(cameraPosition)) + _mapView.animate(with: GMSCameraUpdate.setCamera(cameraPosition)) } func animateCameraToLatLng(point: CLLocationCoordinate2D) { - _navigationView.animate(with: GMSCameraUpdate.setTarget(point)) + _mapView.animate(with: GMSCameraUpdate.setTarget(point)) } func animateCameraToLatLngBounds(bounds: GMSCoordinateBounds, padding: Double) { - _navigationView.animate(with: GMSCameraUpdate.fit(bounds, withPadding: padding)) + _mapView.animate(with: GMSCameraUpdate.fit(bounds, withPadding: padding)) } func animateCameraToLatLngZoom(point: CLLocationCoordinate2D, zoom: Double) { - _navigationView.animate(with: GMSCameraUpdate.setTarget(point, zoom: Float(zoom))) + _mapView.animate(with: GMSCameraUpdate.setTarget(point, zoom: Float(zoom))) } func animateCameraByScroll(dx: Double, dy: Double) { - _navigationView.animate(with: GMSCameraUpdate.scrollBy(x: CGFloat(dx), y: CGFloat(dy))) + _mapView.animate(with: GMSCameraUpdate.scrollBy(x: CGFloat(dx), y: CGFloat(dy))) } func animateCameraByZoom(zoomBy: Double, focus: CGPoint?) { if focus != nil { - _navigationView.animate(with: GMSCameraUpdate.zoom(by: Float(zoomBy), at: focus!)) + _mapView.animate(with: GMSCameraUpdate.zoom(by: Float(zoomBy), at: focus!)) } else { - _navigationView.animate(with: GMSCameraUpdate.zoom(by: Float(zoomBy))) + _mapView.animate(with: GMSCameraUpdate.zoom(by: Float(zoomBy))) } } func animateCameraToZoom(zoom: Double) { - _navigationView.animate(with: GMSCameraUpdate.zoom(to: Float(zoom))) + _mapView.animate(with: GMSCameraUpdate.zoom(to: Float(zoom))) } func moveCameraToCameraPosition(cameraPosition: GMSCameraPosition) { - _navigationView.moveCamera(GMSCameraUpdate.setCamera(cameraPosition)) + _mapView.moveCamera(GMSCameraUpdate.setCamera(cameraPosition)) } func moveCameraToLatLng(point: CLLocationCoordinate2D) { - _navigationView.moveCamera(GMSCameraUpdate.setTarget(point)) + _mapView.moveCamera(GMSCameraUpdate.setTarget(point)) } func moveCameraToLatLngBounds(bounds: GMSCoordinateBounds, padding: Double) { - _navigationView.moveCamera(GMSCameraUpdate.fit(bounds, withPadding: padding)) + _mapView.moveCamera(GMSCameraUpdate.fit(bounds, withPadding: padding)) } func moveCameraToLatLngZoom(point: CLLocationCoordinate2D, zoom: Double) { - _navigationView.moveCamera(GMSCameraUpdate.setTarget(point, zoom: Float(zoom))) + _mapView.moveCamera(GMSCameraUpdate.setTarget(point, zoom: Float(zoom))) } func moveCameraByScroll(dx: Double, dy: Double) { - _navigationView.moveCamera(GMSCameraUpdate.scrollBy(x: CGFloat(dx), y: CGFloat(dy))) + _mapView.moveCamera(GMSCameraUpdate.scrollBy(x: CGFloat(dx), y: CGFloat(dy))) } func moveCameraByZoom(zoomBy: Double, focus: CGPoint?) { if focus != nil { - _navigationView.moveCamera(GMSCameraUpdate.zoom(by: Float(zoomBy), at: focus!)) + _mapView.moveCamera(GMSCameraUpdate.zoom(by: Float(zoomBy), at: focus!)) } else { - _navigationView.moveCamera(GMSCameraUpdate.zoom(by: Float(zoomBy))) + _mapView.moveCamera(GMSCameraUpdate.zoom(by: Float(zoomBy))) } } func moveCameraToZoom(zoom: Double) { - _navigationView.moveCamera(GMSCameraUpdate.zoom(to: Float(zoom))) + _mapView.moveCamera(GMSCameraUpdate.zoom(to: Float(zoom))) } func followMyLocation(perspective: GMSNavigationCameraPerspective, zoomLevel: Double?) { - _navigationView.followingPerspective = perspective - _navigationView.cameraMode = .following + _mapView.followingPerspective = perspective + _mapView.cameraMode = .following if zoomLevel != nil { - _navigationView.followingZoomLevel = Float(zoomLevel!) + _mapView.followingZoomLevel = Float(zoomLevel!) } } @@ -379,105 +387,110 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega // Navigation UI delegate needs to be set after attaching // the session to the map view. - let navigationWasEnabled = _navigationView.isNavigationEnabled + if !_isNavigationView { + // Navigation session cannot be attached to view that is not initialized as navigation view. + return false + } + + let navigationWasEnabled = _mapView.isNavigationEnabled - let result = _navigationView.enableNavigation(with: session) + let result = _mapView.enableNavigation(with: session) - if navigationWasEnabled != _navigationView.isNavigationEnabled { + if navigationWasEnabled != _mapView.isNavigationEnabled { // Navigation UI got enabled, send enabled change event. - _navigationViewEventApi + _viewEventApi .onNavigationUIEnabledChanged( viewId: _viewId, - navigationUIEnabled: _navigationView.isNavigationEnabled + navigationUIEnabled: _mapView.isNavigationEnabled ) { _ in } } - _navigationView.navigationUIDelegate = self + _mapView.navigationUIDelegate = self isAttachedToSession = true return result } func showDestinationMarkers(show: Bool) { - _navigationView.settings.showsDestinationMarkers = show + _mapView.settings.showsDestinationMarkers = show } func showTrafficLights(show: Bool) { - _navigationView.settings.showsTrafficLights = show + _mapView.settings.showsTrafficLights = show } func showStopSigns(show: Bool) { - _navigationView.settings.showsStopSigns = show + _mapView.settings.showsStopSigns = show } func isNavigationTripProgressBarEnabled() throws -> Bool { - _navigationView.settings.isNavigationTripProgressBarEnabled + _mapView.settings.isNavigationTripProgressBarEnabled } func setNavigationTripProgressBarEnabled(_ enabled: Bool) { - _navigationView.settings.isNavigationTripProgressBarEnabled = enabled + _mapView.settings.isNavigationTripProgressBarEnabled = enabled } func isNavigationHeaderEnabled() -> Bool { - _navigationView.settings.isNavigationHeaderEnabled + _mapView.settings.isNavigationHeaderEnabled } func setNavigationHeaderEnabled(_ enabled: Bool) { - _navigationView.settings.isNavigationHeaderEnabled = enabled + _mapView.settings.isNavigationHeaderEnabled = enabled } func isNavigationFooterEnabled() -> Bool { - _navigationView.settings.isNavigationFooterEnabled + _mapView.settings.isNavigationFooterEnabled } func setNavigationFooterEnabled(_ enabled: Bool) { - _navigationView.settings.isNavigationFooterEnabled = enabled + _mapView.settings.isNavigationFooterEnabled = enabled } func isRecenterButtonEnabled() -> Bool { - _navigationView.settings.isRecenterButtonEnabled + _mapView.settings.isRecenterButtonEnabled } func setRecenterButtonEnabled(_ enabled: Bool) { - _navigationView.settings.isRecenterButtonEnabled = enabled + _mapView.settings.isRecenterButtonEnabled = enabled } func isSpeedLimitIconEnabled() -> Bool { - _navigationView.shouldDisplaySpeedLimit + _mapView.shouldDisplaySpeedLimit } func setSpeedLimitIconEnabled(_ enabled: Bool) { - _navigationView.shouldDisplaySpeedLimit = enabled + _mapView.shouldDisplaySpeedLimit = enabled } func isSpeedometerEnabled() -> Bool { - _navigationView.shouldDisplaySpeedometer + _mapView.shouldDisplaySpeedometer } func setSpeedometerEnabled(_ enabled: Bool) { - _navigationView.shouldDisplaySpeedometer = enabled + _mapView.shouldDisplaySpeedometer = enabled } func isTrafficIncidentCardsEnabled() -> Bool { - _navigationView.settings.showsIncidentCards + _mapView.settings.showsIncidentCards } func setTrafficIncidentCardsEnabled(_ enabled: Bool) { - _navigationView.settings.showsIncidentCards = enabled + _mapView.settings.showsIncidentCards = enabled } func isNavigationUIEnabled() -> Bool { - _navigationView.isNavigationEnabled + _mapView.isNavigationEnabled } func setNavigationUIEnabled(_ enabled: Bool) { - if _navigationView.isNavigationEnabled != enabled { - _navigationView.isNavigationEnabled = enabled - _navigationViewEventApi + if _mapView.isNavigationEnabled != enabled { + _mapView.isNavigationEnabled = enabled + _viewEventApi .onNavigationUIEnabledChanged(viewId: _viewId, navigationUIEnabled: enabled) { _ in } if !enabled { - let camera = _navigationView.camera - _navigationView.animate(to: GMSCameraPosition( + let camera = _mapView.camera + _mapView.animate(to: GMSCameraPosition( target: camera.target, zoom: camera.zoom, bearing: 0.0, @@ -488,31 +501,31 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega } func getMinZoomPreference() -> Float { - _navigationView.minZoom + _mapView.minZoom } func getMaxZoomPreference() -> Float { - _navigationView.maxZoom + _mapView.maxZoom } func resetMinMaxZoomPreference() { - _navigationView.setMinZoom(kGMSMinZoomLevel, maxZoom: kGMSMaxZoomLevel) + _mapView.setMinZoom(kGMSMinZoomLevel, maxZoom: kGMSMaxZoomLevel) } func setMinZoomPreference(minZoomPreference: Float) throws { - if minZoomPreference > _navigationView.maxZoom { + if minZoomPreference > _mapView.maxZoom { throw GoogleMapsNavigationViewError.minZoomGreaterThanMaxZoom } - _navigationView.setMinZoom(minZoomPreference, maxZoom: _navigationView.maxZoom) + _mapView.setMinZoom(minZoomPreference, maxZoom: _mapView.maxZoom) } func setMaxZoomPreference(maxZoomPreference: Float) throws { - if maxZoomPreference < _navigationView.minZoom { + if maxZoomPreference < _mapView.minZoom { throw GoogleMapsNavigationViewError.maxZoomLessThanMinZoom } - _navigationView.setMinZoom(_navigationView.minZoom, maxZoom: maxZoomPreference) + _mapView.setMinZoom(_mapView.minZoom, maxZoom: maxZoomPreference) } func getMarkers() -> [MarkerDto] { @@ -527,7 +540,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega markerController.update(from: marker, imageRegistry: _imageRegistry) // Handle visibility property on iOS by removing/not putting the marker // on the map. - markerController.gmsMarker.map = marker.isVisible() ? _navigationView : nil + markerController.gmsMarker.map = marker.isVisible() ? _mapView : nil _markerControllers.append(markerController) return marker } @@ -542,7 +555,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega markerController.update(from: updatedMarker, imageRegistry: _imageRegistry) // Handle visibility property on iOS by removing/not putting the marker // on the map. - markerController.gmsMarker.map = updatedMarker.isVisible() ? _navigationView : nil + markerController.gmsMarker.map = updatedMarker.isVisible() ? _mapView : nil return updatedMarker } return markers @@ -578,7 +591,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega gmsPolygon.setPolygonId(polygon.polygonId) // Handle visibility property on iOS by removing/not putting the polygon // on the map. - gmsPolygon.map = polygon.isVisible() ? _navigationView : nil + gmsPolygon.map = polygon.isVisible() ? _mapView : nil _gmsPolygons.append(gmsPolygon) return polygon } @@ -593,7 +606,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega gmsPolygon.update(from: pigeonPolygon) // Handle visibility property on iOS by removing/not putting the polygon // on the map. - gmsPolygon.map = pigeonPolygon.isVisible() ? _navigationView : nil + gmsPolygon.map = pigeonPolygon.isVisible() ? _mapView : nil return pigeonPolygon } return polygons @@ -629,7 +642,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega gmsPolyline.setPolylineId(polyline.polylineId) // Handle visibility property on iOS by removing/not putting the polyline // on the map. - gmsPolyline.map = polyline.isVisible() ? _navigationView : nil + gmsPolyline.map = polyline.isVisible() ? _mapView : nil _gmsPolylines.append(gmsPolyline) return polyline } @@ -644,7 +657,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega gmsPolyline.update(from: pigeonPolyline) // Handle visibility property on iOS by removing/not putting the polyline // on the map. - gmsPolyline.map = pigeonPolyline.isVisible() ? _navigationView : nil + gmsPolyline.map = pigeonPolyline.isVisible() ? _mapView : nil return pigeonPolyline } return polylines @@ -680,7 +693,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega gmsCircle.setCircleId(circle.circleId) // Handle visibility property on iOS by removing/not putting the circle // on the map. - gmsCircle.map = circle.isVisible() ? _navigationView : nil + gmsCircle.map = circle.isVisible() ? _mapView : nil _gmsCircles.append(gmsCircle) return circle } @@ -695,7 +708,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega gmsCircle.update(from: pigeonCircle) // Handle visibility property on iOS by removing/not putting the circle // on the map. - gmsCircle.map = pigeonCircle.isVisible() ? _navigationView : nil + gmsCircle.map = pigeonCircle.isVisible() ? _mapView : nil return pigeonCircle } return circles @@ -725,14 +738,14 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega _gmsPolylines.removeAll() _gmsPolygons.removeAll() _gmsCircles.removeAll() - _navigationView.clear() + _mapView.clear() } private func sendMarkerEvent(marker: GMSMarker, eventType: MarkerEventTypeDto) { do { let markerController = try findMarkerController(gmsMarker: marker) - _navigationViewEventApi.onMarkerEvent( + _viewEventApi.onMarkerEvent( viewId: _viewId, markerId: markerController.markerId, eventType: eventType, @@ -747,7 +760,7 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega eventType: MarkerDragEventTypeDto) { do { let markerController = try findMarkerController(gmsMarker: marker) - _navigationViewEventApi.onMarkerDragEvent( + _viewEventApi.onMarkerDragEvent( viewId: _viewId, markerId: markerController.markerId, eventType: eventType, @@ -780,13 +793,13 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega extension GoogleMapsNavigationView: GMSMapViewNavigationUIDelegate { func mapViewDidTapRecenterButton(_ mapView: GMSMapView) { - _navigationViewEventApi.onRecenterButtonClicked(viewId: _viewId) { _ in } + _viewEventApi.onRecenterButtonClicked(viewId: _viewId) { _ in } } } extension GoogleMapsNavigationView: GMSMapViewDelegate { func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) { - _navigationViewEventApi.onMapClickEvent( + _viewEventApi.onMapClickEvent( viewId: _viewId, latLng: .init( latitude: coordinate.latitude, @@ -797,7 +810,7 @@ extension GoogleMapsNavigationView: GMSMapViewDelegate { } func mapView(_ mapView: GMSMapView, didLongPressAt coordinate: CLLocationCoordinate2D) { - _navigationViewEventApi.onMapLongClickEvent( + _viewEventApi.onMapLongClickEvent( viewId: _viewId, latLng: .init( latitude: coordinate.latitude, @@ -848,19 +861,19 @@ extension GoogleMapsNavigationView: GMSMapViewDelegate { func mapView(_ mapView: GMSMapView, didTap overlay: GMSOverlay) { if let polygon = overlay as? GMSPolygon { - _navigationViewEventApi.onPolygonClicked( + _viewEventApi.onPolygonClicked( viewId: _viewId, polygonId: polygon.getPolygonId(), completion: { _ in } ) } else if let polyline = overlay as? GMSPolyline { - _navigationViewEventApi.onPolylineClicked( + _viewEventApi.onPolylineClicked( viewId: _viewId, polylineId: polyline.getPolylineId(), completion: { _ in } ) } else if let circle = overlay as? GMSCircle { - _navigationViewEventApi.onCircleClicked( + _viewEventApi.onCircleClicked( viewId: _viewId, circleId: circle.getCircleId(), completion: { _ in } @@ -869,18 +882,18 @@ extension GoogleMapsNavigationView: GMSMapViewDelegate { } func mapView(_ mapView: GMSMapView, didTapMyLocation location: CLLocationCoordinate2D) { - _navigationViewEventApi.onMyLocationClicked(viewId: _viewId, completion: { _ in }) + _viewEventApi.onMyLocationClicked(viewId: _viewId, completion: { _ in }) } func didTapMyLocationButton(for mapView: GMSMapView) -> Bool { - _navigationViewEventApi.onMyLocationButtonClicked(viewId: _viewId, completion: { _ in }) + _viewEventApi.onMyLocationButtonClicked(viewId: _viewId, completion: { _ in }) return _consumeMyLocationButtonClickEventsEnabled } func mapView(_ mapView: GMSMapView, willMove gesture: Bool) { if _listenCameraChanges { let position = Convert.convertCameraPosition(position: mapView.camera) - _navigationViewEventApi.onCameraChanged( + _viewEventApi.onCameraChanged( viewId: _viewId, eventType: gesture ? .moveStartedByGesture : .moveStartedByApi, position: position, @@ -891,7 +904,7 @@ extension GoogleMapsNavigationView: GMSMapViewDelegate { func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) { if _listenCameraChanges { - _navigationViewEventApi.onCameraChanged( + _viewEventApi.onCameraChanged( viewId: _viewId, eventType: .onCameraIdle, position: Convert.convertCameraPosition(position: position), @@ -902,7 +915,7 @@ extension GoogleMapsNavigationView: GMSMapViewDelegate { func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) { if _listenCameraChanges { - _navigationViewEventApi.onCameraChanged( + _viewEventApi.onCameraChanged( viewId: _viewId, eventType: .onCameraMove, position: Convert.convertCameraPosition(position: position), diff --git a/ios/Classes/GoogleMapsNavigationViewFactory.swift b/ios/Classes/GoogleMapsNavigationViewFactory.swift index 60dfcea..65f0c89 100644 --- a/ios/Classes/GoogleMapsNavigationViewFactory.swift +++ b/ios/Classes/GoogleMapsNavigationViewFactory.swift @@ -17,13 +17,13 @@ import UIKit class GoogleMapsNavigationViewFactory: NSObject, FlutterPlatformViewFactory { private var viewRegistry: GoogleMapsNavigationViewRegistry - private var navigationViewEventApi: NavigationViewEventApi + private var viewEventApi: ViewEventApi private var imageRegistry: ImageRegistry init(viewRegistry: GoogleMapsNavigationViewRegistry, - navigationViewEventApi: NavigationViewEventApi, imageRegistry: ImageRegistry) { + viewEventApi: ViewEventApi, imageRegistry: ImageRegistry) { self.viewRegistry = viewRegistry - self.navigationViewEventApi = navigationViewEventApi + self.viewEventApi = viewEventApi self.imageRegistry = imageRegistry super.init() } @@ -36,20 +36,22 @@ class GoogleMapsNavigationViewFactory: NSObject, FlutterPlatformViewFactory { viewIdentifier viewId: Int64, arguments args: Any?) -> FlutterPlatformView { guard let argsList = args as? [Any?], - let params = NavigationViewCreationOptionsDto.fromList(argsList) else { + let params = ViewCreationOptionsDto.fromList(argsList) else { fatalError("Failed to decode NavigationViewCreationOptionsDto") } let mapConfiguration = Convert.convertMapOptions(params.mapOptions) + let isNavigationView = params.mapViewType == MapViewTypeDto.navigation + return GoogleMapsNavigationView( frame: frame, viewIdentifier: viewId, + isNavigationView: isNavigationView, viewRegistry: viewRegistry, - navigationViewEventApi: navigationViewEventApi, + viewEventApi: viewEventApi, navigationUIEnabledPreference: Convert - .convertNavigationUIEnabledPreference(preference: params.navigationViewOptions - .navigationUIEnabledPreference), + .convertNavigationUIEnabledPreference(preference: params.navigationViewOptions?.navigationUIEnabledPreference), mapConfiguration: mapConfiguration, imageRegistry: imageRegistry ) diff --git a/ios/Classes/GoogleMapsNavigationViewMessageHandler.swift b/ios/Classes/GoogleMapsNavigationViewMessageHandler.swift index 5d5e080..85b95e8 100644 --- a/ios/Classes/GoogleMapsNavigationViewMessageHandler.swift +++ b/ios/Classes/GoogleMapsNavigationViewMessageHandler.swift @@ -19,7 +19,7 @@ enum GoogleMapsNavigationViewHandlerError: Error { case badFunctionCall } -class GoogleMapsNavigationViewMessageHandler: NavigationViewApi { +class GoogleMapsNavigationViewMessageHandler: MapViewApi { private let viewRegistry: GoogleMapsNavigationViewRegistry init(viewRegistry: GoogleMapsNavigationViewRegistry) { diff --git a/ios/Classes/GoogleMapsNavigationViewRegistry.swift b/ios/Classes/GoogleMapsNavigationViewRegistry.swift index b69f4db..fbdbb71 100644 --- a/ios/Classes/GoogleMapsNavigationViewRegistry.swift +++ b/ios/Classes/GoogleMapsNavigationViewRegistry.swift @@ -55,4 +55,9 @@ class GoogleMapsNavigationViewRegistry { Array(views.values) } } + + func getAllRegisteredNavigationViewIds() -> [Int64] { + // Filter the views dictionary to include only those views that are navigation views + views.filter { $0.value.isNavigationView() }.map(\.key) + } } diff --git a/lib/src/google_maps_map_view.dart b/lib/src/google_maps_map_view.dart index f68362d..9d4ea61 100644 --- a/lib/src/google_maps_map_view.dart +++ b/lib/src/google_maps_map_view.dart @@ -46,8 +46,6 @@ class GoogleMapsMapView extends StatefulWidget { this.initialMaxZoomPreference, this.initialZoomControlsEnabled = true, this.initialCameraTargetBounds, - this.initialNavigationUIEnabledPreference = - NavigationUIEnabledPreference.automatic, this.layoutDirection, this.gestureRecognizers = const >{}, this.onRecenterButtonClicked, @@ -155,21 +153,6 @@ class GoogleMapsMapView extends StatefulWidget { /// Null by default (unbounded). final LatLngBounds? initialCameraTargetBounds; - /// Determines the initial visibility of the navigation UI on map initialization. - /// - /// By default set to [NavigationUIEnabledPreference.automatic], - /// meaning the navigation UI gets enabled if the navigation - /// session has already been successfully started. - /// - /// If set to [NavigationUIEnabledPreference.disabled] the navigation view - /// initially displays a classic map view. - /// - /// Note on Android enabling the navigation UI for the view requires that the - /// navigation session has already been successfully started with - /// [GoogleMapsNavigator.initializeNavigationSession]. On iOS accepting - /// the terms and conditions is enough. - final NavigationUIEnabledPreference initialNavigationUIEnabledPreference; - /// Which gestures should be forwarded to the PlatformView. /// /// When this set is empty, the map will only handle pointer events for gestures that @@ -253,29 +236,27 @@ class GoogleMapsMapViewState extends State { Widget build(BuildContext context) { return GoogleMapsNavigationPlatform.instance.buildMapView( initializationOptions: MapViewInitializationOptions( - layoutDirection: widget.layoutDirection ?? - Directionality.maybeOf(context) ?? - TextDirection.ltr, - gestureRecognizers: widget.gestureRecognizers, - mapOptions: MapOptions( - cameraPosition: widget.initialCameraPosition, - mapType: widget.initialMapType, - compassEnabled: widget.initialCompassEnabled, - rotateGesturesEnabled: widget.initialRotateGesturesEnabled, - scrollGesturesEnabled: widget.initialScrollGesturesEnabled, - tiltGesturesEnabled: widget.initialTiltGesturesEnabled, - zoomGesturesEnabled: widget.initialZoomGesturesEnabled, - scrollGesturesEnabledDuringRotateOrZoom: - widget.initialScrollGesturesEnabledDuringRotateOrZoom, - mapToolbarEnabled: widget.initialMapToolbarEnabled, - minZoomPreference: widget.initialMinZoomPreference, - maxZoomPreference: widget.initialMaxZoomPreference, - zoomControlsEnabled: widget.initialZoomControlsEnabled, - cameraTargetBounds: widget.initialCameraTargetBounds, - ), - navigationViewOptions: NavigationViewOptions( - navigationUIEnabledPreference: - widget.initialNavigationUIEnabledPreference)), + layoutDirection: widget.layoutDirection ?? + Directionality.maybeOf(context) ?? + TextDirection.ltr, + gestureRecognizers: widget.gestureRecognizers, + mapOptions: MapOptions( + cameraPosition: widget.initialCameraPosition, + mapType: widget.initialMapType, + compassEnabled: widget.initialCompassEnabled, + rotateGesturesEnabled: widget.initialRotateGesturesEnabled, + scrollGesturesEnabled: widget.initialScrollGesturesEnabled, + tiltGesturesEnabled: widget.initialTiltGesturesEnabled, + zoomGesturesEnabled: widget.initialZoomGesturesEnabled, + scrollGesturesEnabledDuringRotateOrZoom: + widget.initialScrollGesturesEnabledDuringRotateOrZoom, + mapToolbarEnabled: widget.initialMapToolbarEnabled, + minZoomPreference: widget.initialMinZoomPreference, + maxZoomPreference: widget.initialMaxZoomPreference, + zoomControlsEnabled: widget.initialZoomControlsEnabled, + cameraTargetBounds: widget.initialCameraTargetBounds, + ), + ), onMapReady: _onPlatformViewCreated); } diff --git a/lib/src/google_maps_map_view_controller.dart b/lib/src/google_maps_map_view_controller.dart index 7014f66..1cf714f 100644 --- a/lib/src/google_maps_map_view_controller.dart +++ b/lib/src/google_maps_map_view_controller.dart @@ -28,16 +28,11 @@ class GoogleMapViewController { /// Initializes the event channel listeners for the map view instance. void _initListeners() { _setOnMapClickedListeners(); - _setOnRecenterButtonClickedListener(); _setOnMarkerClickedListeners(); _setOnMarkerDragListeners(); _setOnPolygonClickedListener(); _setOnPolylineClickedListener(); _setOnCircleClickedListener(); - _setOnNavigationUIEnabledChangedListener(); - _setOnMyLocationClickedListener(); - _setOnMyLocationButtonClickedListener(); - _setOnCameraChangedListener(); } /// Sets the event channel listener for the map click event listeners. @@ -60,16 +55,6 @@ class GoogleMapViewController { } } - /// Sets the event channel listener for the on recenter button clicked event. - void _setOnRecenterButtonClickedListener() { - if (_viewState != null && - _viewState.widget.onRecenterButtonClicked != null) { - GoogleMapsNavigationPlatform.instance - .getNavigationRecenterButtonClickedEventStream(viewId: _viewId) - .listen(_viewState.widget.onRecenterButtonClicked); - } - } - /// Sets the event channel listener for the marker clicked events. void _setOnMarkerClickedListeners() { GoogleMapsNavigationPlatform.instance @@ -89,56 +74,6 @@ class GoogleMapViewController { }); } - /// Sets the event channel listener for the on my location clicked event. - void _setOnMyLocationClickedListener() { - if (_viewState != null && _viewState.widget.onMyLocationClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMyLocationClickedEventStream(viewId: _viewId) - .listen(_viewState.widget.onMyLocationClicked); - } - } - - /// Sets the event channel listener for the on my location button clicked event. - void _setOnMyLocationButtonClickedListener() { - if (_viewState != null && - _viewState.widget.onMyLocationButtonClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMyLocationButtonClickedEventStream(viewId: _viewId) - .listen(_viewState.widget.onMyLocationButtonClicked); - } - } - - /// Sets the event channel listener for camera changed events. - void _setOnCameraChangedListener() { - // Register listeners if any of the callbacks are not null. - if (_viewState?.widget.onCameraMoveStarted != null || - _viewState?.widget.onCameraMove != null || - _viewState?.widget.onCameraIdle != null) { - GoogleMapsNavigationPlatform.instance - .registerOnCameraChangedListener(viewId: _viewId); - } - GoogleMapsNavigationPlatform.instance - .getCameraChangedEventStream(viewId: _viewId) - .listen((CameraChangedEvent event) { - switch (event.eventType) { - case CameraEventType.moveStartedByApi: - _viewState?.widget.onCameraMoveStarted?.call(event.position, false); - case CameraEventType.moveStartedByGesture: - _viewState?.widget.onCameraMoveStarted?.call(event.position, true); - case CameraEventType.onCameraMove: - _viewState?.widget.onCameraMove?.call(event.position); - case CameraEventType.onCameraIdle: - _viewState?.widget.onCameraIdle?.call(event.position); - case CameraEventType.onCameraStartedFollowingLocation: - _viewState?.widget.onCameraStartedFollowingLocation - ?.call(event.position); - case CameraEventType.onCameraStoppedFollowingLocation: - _viewState?.widget.onCameraStoppedFollowingLocation - ?.call(event.position); - } - }); - } - /// Sets the event channel listener for the marker drag event. void _setOnMarkerDragListeners() { GoogleMapsNavigationPlatform.instance @@ -184,16 +119,6 @@ class GoogleMapViewController { }); } - /// Sets the event channel listener for the navigation UI enabled changed event. - void _setOnNavigationUIEnabledChangedListener() { - GoogleMapsNavigationPlatform.instance - .getNavigationUIEnabledChangedEventStream(viewId: _viewId) - .listen((NavigationUIEnabledChangedEvent event) { - _viewState?.widget.onNavigationUIEnabledChanged - ?.call(event.navigationUIEnabled); - }); - } - /// Change status of my location enabled. /// /// By default, the my location layer is disabled, but gets From c079aae52d796e958ff93de54f1e947db6967603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Thu, 10 Oct 2024 18:35:10 +0800 Subject: [PATCH 03/18] feat: map view android separation wip --- .../maps/flutter/navigation/GoogleMapView.kt | 83 ++ .../navigation/GoogleMapsBaseMapView.kt | 852 ++++++++++++++++++ .../GoogleMapsNavigationInspectorHandler.kt | 4 +- .../navigation/GoogleMapsNavigationPlugin.kt | 18 +- .../navigation/GoogleMapsNavigationView.kt | 774 +--------------- .../GoogleMapsNavigationViewRegistry.kt | 71 -- ...iewFactory.kt => GoogleMapsViewFactory.kt} | 44 +- ...ler.kt => GoogleMapsViewMessageHandler.kt} | 67 +- .../navigation/GoogleMapsViewRegistry.kt | 91 ++ .../GoogleMapsNavigationViewFactory.swift | 2 +- 10 files changed, 1135 insertions(+), 871 deletions(-) create mode 100644 android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt create mode 100644 android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt delete mode 100644 android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationViewRegistry.kt rename android/src/main/kotlin/com/google/maps/flutter/navigation/{GoogleMapsNavigationViewFactory.kt => GoogleMapsViewFactory.kt} (58%) rename android/src/main/kotlin/com/google/maps/flutter/navigation/{GoogleMapsNavigationViewMessageHandler.kt => GoogleMapsViewMessageHandler.kt} (85%) create mode 100644 android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewRegistry.kt diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt new file mode 100644 index 0000000..edaa889 --- /dev/null +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt @@ -0,0 +1,83 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.maps.flutter.navigation + +import android.content.Context +import android.view.View +import com.google.android.gms.maps.GoogleMapOptions +import com.google.android.gms.maps.MapView +import io.flutter.plugin.platform.PlatformView + +class GoogleMapView +internal constructor( + context: Context, + mapOptions: GoogleMapOptions, + viewId: Int, + viewEventApi: ViewEventApi, + private val viewRegistry: GoogleMapsViewRegistry, + imageRegistry: ImageRegistry +) : PlatformView, GoogleMapsBaseMapView(viewId, viewEventApi, imageRegistry) { + private val _mapView: MapView = MapView(context, mapOptions) + + override fun getView(): View { + return _mapView + } + + init { + // Call all of these three lifecycle functions in sequence to fully + // initialize the map view. + _mapView.onCreate(context.applicationInfo.metaData) + _mapView.onStart() + _mapView.onResume() + + _mapView.getMapAsync { map -> + setMap(map) + initListeners() + imageRegistry.mapViewInitializationComplete() + mapReady() + invalidateViewAfterMapLoad() + } + + viewRegistry.registerMapView(viewId, this) + } + + override fun dispose() { + // When view is disposed, all of these lifecycle functions must be + // called to properly dispose navigation view and prevent leaks. + _mapView.onPause() + _mapView.onStop() + _mapView.onDestroy() + + viewRegistry.unregisterMapView(viewId) + } + + override fun onStart() { + _mapView.onStart() + } + + override fun onResume() { + _mapView.onResume() + } + + override fun onStop() { + _mapView.onStop() + } + + override fun onPause() { + _mapView.onPause() + } +} \ No newline at end of file diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt new file mode 100644 index 0000000..098a82b --- /dev/null +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt @@ -0,0 +1,852 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.maps.flutter.navigation + +import android.annotation.SuppressLint +import android.content.res.Resources +import android.graphics.Point +import android.location.Location +import android.view.View +import com.google.android.gms.maps.CameraUpdate +import com.google.android.gms.maps.CameraUpdateFactory +import com.google.android.gms.maps.GoogleMap +import com.google.android.gms.maps.GoogleMap.OnMarkerDragListener +import com.google.android.gms.maps.GoogleMapOptions +import com.google.android.gms.maps.model.CameraPosition +import com.google.android.gms.maps.model.Circle +import com.google.android.gms.maps.model.FollowMyLocationOptions +import com.google.android.gms.maps.model.LatLng +import com.google.android.gms.maps.model.LatLngBounds +import com.google.android.gms.maps.model.MapStyleOptions +import com.google.android.gms.maps.model.Marker +import com.google.android.gms.maps.model.Polygon +import com.google.android.gms.maps.model.Polyline +import com.google.android.libraries.navigation.NavigationView + +abstract class GoogleMapsBaseMapView( + protected val viewId: Int, + protected val viewEventApi: ViewEventApi, + private val imageRegistry: ImageRegistry +) { + companion object { + const val INVALIDATION_FRAME_SKIP_AMOUNT = 4 // Amount of skip frames before invalidation + } + + private val _frameDelayHandler = FrameDelayHandler(INVALIDATION_FRAME_SKIP_AMOUNT) + private var _map: GoogleMap? = null + private val _markers = mutableListOf() + private val _polygons = mutableListOf() + private val _polylines = mutableListOf() + private val _circles = mutableListOf() + + // Nullable variable to hold the callback function + private var _mapReadyCallback: ((Result) -> Unit)? = null + private var _loadedCallbackPending = false + + /// Default values for UI features. + private var _consumeMyLocationButtonClickEventsEnabled: Boolean = false + + abstract fun getView(): View; + abstract fun onStart(); + abstract fun onResume(); + abstract fun onStop(); + abstract fun onPause(); + + // Method to set the _map object + protected fun setMap(map: GoogleMap) { + _map = map + } + + @Throws(FlutterError::class) + protected fun getMap(): GoogleMap { + if (_map != null) { + return _map!! + } else { + throw FlutterError("mapNotFound", "GoogleMap not initialized yet") + } + } + + protected fun mapReady() { + // Call and clear view ready callback if available. + _mapReadyCallback?.let { callback -> + callback(Result.success(Unit)) + _mapReadyCallback = null + } + } + + protected open fun initListeners() { + getMap().setOnMapClickListener { + viewEventApi.onMapClickEvent( + viewId.toLong(), + LatLngDto(it.latitude, it.longitude), + ) {} + } + getMap().setOnMapLongClickListener { + viewEventApi.onMapLongClickEvent( + viewId.toLong(), + LatLngDto(it.latitude, it.longitude), + ) {} + } + getMap().setOnMarkerClickListener { marker -> + val markerId = findMarkerId(marker) + val controller = findMarkerController(markerId) + + sendMarkerEvent(marker, MarkerEventTypeDto.CLICKED) + + // This return value controls the default onClick behaviour, + // return true for default behaviour to occur and false to not. + // Default behavior is for the camera to move to the marker and an info window to + // appear. + controller?.consumeTapEvents ?: false + } + getMap() + .setOnMarkerDragListener( + object : OnMarkerDragListener { + override fun onMarkerDrag(marker: Marker) { + sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAG) + } + + override fun onMarkerDragEnd(marker: Marker) { + sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAGEND) + } + + override fun onMarkerDragStart(marker: Marker) { + sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAGSTART) + } + } + ) + getMap().setOnInfoWindowClickListener { marker -> + sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWCLICKED) + } + getMap().setOnInfoWindowCloseListener { marker -> + try { + sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWCLOSED) + } catch (exception: FlutterError) { + // Google maps trigger this callback if info window is open for marker that is removed. + // As marker and it's information that maps the marker to the markerId is removed, + // [FlutterError] is thrown. In this case info window close event is not sent. + } + } + getMap().setOnInfoWindowLongClickListener { marker -> + sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWLONGCLICKED) + } + + getMap().setOnPolygonClickListener { polygon -> + val polygonId = findPolygonId(polygon) + viewEventApi.onPolygonClicked(viewId.toLong(), polygonId) {} + } + + getMap().setOnPolylineClickListener { polyline -> + val polylineId = findPolylineId(polyline) + viewEventApi.onPolylineClicked(viewId.toLong(), polylineId) {} + } + + getMap().setOnCircleClickListener { circle -> + val circleId = findCircleId(circle) + viewEventApi.onCircleClicked(viewId.toLong(), circleId) {} + } + + getMap().setOnMyLocationClickListener { + viewEventApi.onMyLocationClicked(viewId.toLong()) {} + } + + getMap().setOnMyLocationButtonClickListener { + viewEventApi.onMyLocationButtonClicked(viewId.toLong()) {} + _consumeMyLocationButtonClickEventsEnabled + } + + getMap() + .setOnFollowMyLocationCallback( + object : GoogleMap.OnCameraFollowLocationCallback { + override fun onCameraStartedFollowingLocation() { + viewEventApi.onCameraChanged( + viewId.toLong(), + CameraEventTypeDto.ONCAMERASTARTEDFOLLOWINGLOCATION, + Convert.convertCameraPositionToDto(getMap().cameraPosition) + ) {} + } + + override fun onCameraStoppedFollowingLocation() { + viewEventApi.onCameraChanged( + viewId.toLong(), + CameraEventTypeDto.ONCAMERASTOPPEDFOLLOWINGLOCATION, + Convert.convertCameraPositionToDto(getMap().cameraPosition) + ) {} + } + } + ) + } + + /** + * Workaround for map view not showing added or edited map objects immediately after add/edit. + * Schedules [NavigationView.invalidate] call after a certain amount of frames are drawn. In + * marker updates short delay is not enough, [doubleInvalidate] is set to true. + * + * @param doubleInvalidate if true, schedules another invalidate event after the first one. + */ + protected fun invalidateViewAfterMapLoad(doubleInvalidate: Boolean = false) { + if (_loadedCallbackPending) { + return + } + _loadedCallbackPending = true + getMap().setOnMapLoadedCallback { + _loadedCallbackPending = false + _frameDelayHandler.scheduleActionWithFrameDelay { + getView().invalidate() + if (doubleInvalidate) { + _frameDelayHandler.scheduleActionWithFrameDelay { getView().invalidate() } + } + } + } + } + + @Throws(FlutterError::class) + private fun findMarkerId(marker: Marker): String { + return _markers.find { it.marker == marker }?.markerId + ?: throw FlutterError("markerNotFound", "Could not find the marker.") + } + + @Throws(FlutterError::class) + private fun findMarkerController(markerId: String): MarkerController? { + return _markers.find { it.markerId == markerId } + } + + @Throws(FlutterError::class) + private fun findPolygonId(polygon: Polygon): String { + return _polygons.find { it.polygon == polygon }?.polygonId + ?: throw FlutterError("polygonNotFound", "Could not find the polygon.") + } + + @Throws(FlutterError::class) + private fun findPolylineId(polyline: Polyline): String { + return _polylines.find { it.polyline == polyline }?.polylineId + ?: throw FlutterError("polylineNotFound", "Could not find the polyline.") + } + + @Throws(FlutterError::class) + private fun findCircleId(circle: Circle): String { + return _circles.find { it.circle == circle }?.circleId + ?: throw FlutterError("circleNotFound", "Could not find the circle") + } + + @Throws(FlutterError::class) + private fun findPolygonController(polygonId: String): PolygonController? { + return _polygons.find { it.polygonId == polygonId } + } + + @Throws(FlutterError::class) + private fun findPolylineController(polylineId: String): PolylineController? { + return _polylines.find { it.polylineId == polylineId } + } + + @Throws(FlutterError::class) + private fun findCircleController(circleId: String): CircleController? { + return _circles.find { it.circleId == circleId } + } + + @Throws(FlutterError::class) + private fun sendMarkerEvent(marker: Marker, eventType: MarkerEventTypeDto) { + val markerId = findMarkerId(marker) + viewEventApi.onMarkerEvent(viewId.toLong(), markerId, eventType) {} + } + + @Throws(FlutterError::class) + private fun sendMarkerDragEvent(marker: Marker, eventType: MarkerDragEventTypeDto) { + val markerId = findMarkerId(marker) + viewEventApi.onMarkerDragEvent( + viewId.toLong(), + markerId, + eventType, + LatLngDto(marker.position.latitude, marker.position.longitude) + ) {} + } + + fun isMyLocationEnabled(): Boolean { + return getMap().isMyLocationEnabled + } + + @SuppressLint("MissingPermission") + fun setMyLocationEnabled(enabled: Boolean) { + invalidateViewAfterMapLoad() + getMap().isMyLocationEnabled = enabled + } + + fun setMyLocationButtonEnabled(enabled: Boolean) { + invalidateViewAfterMapLoad() + getMap().uiSettings.isMyLocationButtonEnabled = enabled + } + + fun setZoomGesturesEnabled(enabled: Boolean) { + invalidateViewAfterMapLoad() + getMap().uiSettings.isZoomGesturesEnabled = enabled + } + + fun setZoomControlsEnabled(enabled: Boolean) { + invalidateViewAfterMapLoad() + getMap().uiSettings.isZoomControlsEnabled = enabled + } + + fun setCompassEnabled(enabled: Boolean) { + invalidateViewAfterMapLoad() + getMap().uiSettings.isCompassEnabled = enabled + } + + fun setRotateGesturesEnabled(enabled: Boolean) { + getMap().uiSettings.isRotateGesturesEnabled = enabled + } + + fun setScrollGesturesEnabled(enabled: Boolean) { + getMap().uiSettings.isScrollGesturesEnabled = enabled + } + + fun setScrollGesturesDuringRotateOrZoomEnabled(enabled: Boolean) { + getMap().uiSettings.isScrollGesturesEnabledDuringRotateOrZoom = enabled + } + + fun setTiltGesturesEnabled(enabled: Boolean) { + getMap().uiSettings.isTiltGesturesEnabled = enabled + } + + fun setMapToolbarEnabled(enabled: Boolean) { + getMap().uiSettings.isMapToolbarEnabled = enabled + } + + fun setTrafficEnabled(enabled: Boolean) { + getMap().isTrafficEnabled = enabled + } + + fun isMyLocationButtonEnabled(): Boolean { + return getMap().uiSettings.isMyLocationButtonEnabled + } + + fun isZoomGesturesEnabled(): Boolean { + return getMap().uiSettings.isZoomGesturesEnabled + } + + fun isZoomControlsEnabled(): Boolean { + return getMap().uiSettings.isZoomControlsEnabled + } + + fun isCompassEnabled(): Boolean { + return getMap().uiSettings.isCompassEnabled + } + + fun isRotateGesturesEnabled(): Boolean { + return getMap().uiSettings.isRotateGesturesEnabled + } + + fun isScrollGesturesEnabled(): Boolean { + return getMap().uiSettings.isScrollGesturesEnabled + } + + fun isScrollGesturesEnabledDuringRotateOrZoom(): Boolean { + return getMap().uiSettings.isScrollGesturesEnabledDuringRotateOrZoom + } + + fun isTiltGesturesEnabled(): Boolean { + return getMap().uiSettings.isTiltGesturesEnabled + } + + fun isMapToolbarEnabled(): Boolean { + return getMap().uiSettings.isMapToolbarEnabled + } + + fun isTrafficEnabled(): Boolean { + return getMap().isTrafficEnabled + } + + fun getMyLocation(): Location? { + // Remove this functionality and either guide users to use separate flutter + // library for geolocation or implement separate method under + // [GoogleMapsNavigationSessionManager] to fetch the location + // using the [FusedLocationProviderApi]. + @Suppress("DEPRECATION") return getMap().myLocation + } + + fun getCameraPosition(): CameraPosition { + return getMap().cameraPosition ?: CameraPosition(LatLng(0.0, 0.0), 0.0F, 0.0F, 0.0F) + } + + fun getVisibleRegion(): LatLngBounds { + return getMap().projection.visibleRegion.latLngBounds + } + + private fun getMapCallback(callback: (Result) -> Unit): GoogleMap.CancelableCallback { + return object : GoogleMap.CancelableCallback { + override fun onFinish() { + callback(Result.success(true)) + } + + override fun onCancel() { + callback(Result.success(false)) + } + } + } + + private fun animateCamera( + cameraUpdate: CameraUpdate, + duration: Long?, + callback: (Result) -> Unit + ) { + // Native animateCamera() doesn't allow setting null duration so need to do two calls + if (duration == null) { + getMap().animateCamera(cameraUpdate, getMapCallback(callback)) + } else { + getMap().animateCamera(cameraUpdate, duration.toInt(), getMapCallback(callback)) + } + } + + fun animateCameraToCameraPosition( + cameraPosition: CameraPosition, + duration: Long?, + callback: (Result) -> Unit + ) { + animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), duration, callback) + } + + fun animateCameraToLatLng(point: LatLng, duration: Long?, callback: (Result) -> Unit) { + animateCamera(CameraUpdateFactory.newLatLng(point), duration, callback) + } + + fun animateCameraToLatLngBounds( + bounds: LatLngBounds, + padding: Double, + duration: Long?, + callback: (Result) -> Unit + ) { + animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding.toInt()), duration, callback) + } + + fun animateCameraToLatLngZoom( + point: LatLng, + zoom: Double, + duration: Long?, + callback: (Result) -> Unit + ) { + animateCamera(CameraUpdateFactory.newLatLngZoom(point, zoom.toFloat()), duration, callback) + } + + fun animateCameraByScroll( + scrollByDx: Double, + scrollByDy: Double, + duration: Long?, + callback: (Result) -> Unit + ) { + animateCamera( + CameraUpdateFactory.scrollBy(scrollByDx.toFloat(), scrollByDy.toFloat()), + duration, + callback + ) + } + + fun animateCameraByZoom( + zoomBy: Double, + focus: Point?, + duration: Long?, + callback: (Result) -> Unit + ) { + // Native animateCamera() doesn't allow setting null duration or focus so need to split to + // multiple calls + val cameraUpdate = + if (focus != null) { + CameraUpdateFactory.zoomBy(zoomBy.toFloat(), focus) + } else { + CameraUpdateFactory.zoomBy(zoomBy.toFloat()) + } + animateCamera(cameraUpdate, duration, callback) + } + + fun animateCameraToZoom(zoom: Double, duration: Long?, callback: (Result) -> Unit) { + animateCamera(CameraUpdateFactory.zoomTo(zoom.toFloat()), duration, callback) + } + + fun moveCameraToCameraPosition(cameraPosition: CameraPosition) { + return getMap().moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) + } + + fun moveCameraToLatLng(point: LatLng) { + return getMap().moveCamera(CameraUpdateFactory.newLatLng(point)) + } + + fun moveCameraToLatLngBounds(bounds: LatLngBounds, padding: Double) { + return getMap().moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding.toInt())) + } + + fun moveCameraToLatLngZoom(point: LatLng, zoom: Double) { + return getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(point, zoom.toFloat())) + } + + fun moveCameraByScroll(scrollByDx: Double, scrollByDy: Double) { + return getMap() + .moveCamera(CameraUpdateFactory.scrollBy(scrollByDx.toFloat(), scrollByDy.toFloat())) + } + + fun moveCameraByZoom(zoomBy: Double, focus: Point?) { + if (focus != null) { + getMap().moveCamera(CameraUpdateFactory.zoomBy(zoomBy.toFloat(), focus)) + } else { + getMap().moveCamera(CameraUpdateFactory.zoomBy(zoomBy.toFloat())) + } + } + + fun moveCameraToZoom(zoom: Double) { + return getMap().moveCamera(CameraUpdateFactory.zoomTo(zoom.toFloat())) + } + + fun getMapType(): Int { + return getMap().mapType + } + + fun setMapType(mapType: Int) { + invalidateViewAfterMapLoad() + getMap().mapType = mapType + } + + fun setMapStyle(styleJson: String) { + invalidateViewAfterMapLoad() + if (!getMap().setMapStyle(MapStyleOptions(styleJson))) { + throw FlutterError("mapStyleError", "Failed to set map style") + } + } + + @SuppressLint("MissingPermission") + fun followMyLocation(perspective: Int, zoomLevel: Double?) { + invalidateViewAfterMapLoad() + getMap().followMyLocation(perspective) + if (zoomLevel != null) { + val options: FollowMyLocationOptions = + FollowMyLocationOptions.builder().setZoomLevel(zoomLevel.toFloat()).build() + getMap().followMyLocation(perspective, options) + } else { + getMap().followMyLocation(perspective) + } + } + + fun awaitMapReady(callback: (Result) -> Unit) { + if (_map != null) { + // Call the callback immediately as the map is already initialized + callback(Result.success(Unit)) + } else if (_mapReadyCallback != null) { + // If there is already a callback pending, throw an error to avoid overriding it + callback( + Result.failure( + FlutterError( + "mapReadyCallbackAlreadyPending", + "A callback is already pending and cannot be overridden." + ) + ) + ) + } else { + // Save the callback to be called once the map is initialized + _mapReadyCallback = callback + } + } + + fun setConsumeMyLocationButtonClickEventsEnabled(enabled: Boolean) { + _consumeMyLocationButtonClickEventsEnabled = enabled + } + + fun isConsumeMyLocationButtonClickEventsEnabled(): Boolean { + return _consumeMyLocationButtonClickEventsEnabled + } + + fun getMarkers(): List { + return _markers.map { MarkerDto(it.markerId, Convert.markerControllerToMarkerOptions(it)) } + } + + fun addMarkers(markers: List): List { + val result = mutableListOf() + markers.forEach { + val builder = MarkerBuilder() + Convert.sinkMarkerOptions(it.options, builder, imageRegistry) + val options = builder.build() + val marker = getMap().addMarker(options) + if (marker != null) { + val registeredImage = + it.options.icon.registeredImageId?.let { id -> imageRegistry.findRegisteredImage(id) } + val controller = + MarkerController( + marker, + it.markerId, + builder.consumeTapEvents, + it.options.anchor.u.toFloat(), + it.options.anchor.v.toFloat(), + it.options.infoWindow.anchor.u.toFloat(), + it.options.infoWindow.anchor.v.toFloat(), + registeredImage + ) + _markers.add(controller) + result.add(it) + } + } + // Double invalidate map view. Marker icon updates seem to take extra + // time and some times icon did not update properly after single invalidate. + invalidateViewAfterMapLoad(true) + return result + } + + @Throws(FlutterError::class) + fun updateMarkers(markers: List): List { + val result = mutableListOf() + var error: Throwable? = null + markers.forEach { + findMarkerController(it.markerId)?.let { controller -> + Convert.sinkMarkerOptions(it.options, controller, imageRegistry) + result.add(it) + } + ?: run { + error = FlutterError("markerNotFound", "Failed to update marker with id ${it.markerId}") + } + } + error?.let { throw error as Throwable } + // Double invalidate map view. Marker icon updates seem to take extra + // time and some times icon did not update properly after single invalidate. + invalidateViewAfterMapLoad(true) + return result + } + + @Throws(FlutterError::class) + fun removeMarkers(markers: List) { + invalidateViewAfterMapLoad() + var error: Throwable? = null + markers.forEach { + findMarkerController(it.markerId)?.let { controller -> + controller.remove() + _markers.remove(controller) + } + ?: run { + error = FlutterError("markerNotFound", "Failed to remove marker with id ${it.markerId}") + } + } + error?.let { throw error as Throwable } + } + + fun clearMarkers() { + invalidateViewAfterMapLoad() + _markers.forEach { controller -> controller.remove() } + _markers.clear() + } + + fun clear() { + getMap().clear() + _markers.clear() + _polygons.clear() + _polylines.clear() + _circles.clear() + } + + fun getPolygons(): List { + val density = Resources.getSystem().displayMetrics.density + return _polygons.map { + PolygonDto(it.polygonId, Convert.polygonToPolygonOptions(it.polygon, density)) + } + } + + fun addPolygons( + polygons: List, + ): List { + val density = Resources.getSystem().displayMetrics.density + invalidateViewAfterMapLoad() + val result = mutableListOf() + polygons.forEach { + val builder = PolygonBuilder() + Convert.sinkPolygonOptions(it.options, builder, density) + val options = builder.build() + val polygon = getMap().addPolygon(options) + if (polygon != null) { + val controller = PolygonController(polygon, it.polygonId) + _polygons.add(controller) + result.add(it) + } + } + return result + } + + fun updatePolygons(polygons: List): List { + invalidateViewAfterMapLoad() + var error: Throwable? = null + val result = mutableListOf() + val density = Resources.getSystem().displayMetrics.density + polygons.forEach { + findPolygonController(it.polygonId)?.let { controller -> + Convert.sinkPolygonOptions(it.options, controller, density) + result.add(it) + } + ?: run { + error = + FlutterError("polygonNotFound", "Failed to update polygon with id ${it.polygonId}") + } + } + error?.let { throw error as Throwable } + + return result + } + + fun removePolygons(polygons: List) { + invalidateViewAfterMapLoad() + var error: Throwable? = null + polygons.forEach { + findPolygonController(it.polygonId)?.let { controller -> + controller.remove() + _polygons.remove(controller) + } + ?: run { + error = + FlutterError("polygonNotFound", "Failed to remove polygon with id ${it.polygonId}") + } + } + error?.let { throw error as Throwable } + } + + fun clearPolygons() { + invalidateViewAfterMapLoad() + _polygons.forEach { controller -> controller.remove() } + _polygons.clear() + } + + fun getPolylines(): List { + val density = Resources.getSystem().displayMetrics.density + return _polylines.map { + PolylineDto(it.polylineId, Convert.polylineToPolylineOptions(it.polyline, density)) + } + } + + fun addPolylines( + polylines: List, + ): List { + val density = Resources.getSystem().displayMetrics.density + invalidateViewAfterMapLoad() + val result = mutableListOf() + polylines.forEach { + val builder = PolylineBuilder() + Convert.sinkPolylineOptions(it.options, builder, density) + val options = builder.build() + val polyline = getMap().addPolyline(options) + if (polyline != null) { + val controller = PolylineController(polyline, it.polylineId) + _polylines.add(controller) + result.add(it) + } + } + return result + } + + fun updatePolylines(polylines: List): List { + var error: Throwable? = null + val density = Resources.getSystem().displayMetrics.density + invalidateViewAfterMapLoad() + val result = mutableListOf() + polylines.forEach { + findPolylineController(it.polylineId)?.let { controller -> + Convert.sinkPolylineOptions(it.options, controller, density) + result.add(it) + } + ?: run { + error = + FlutterError("polylineNotFound", "Failed to update polyline with id ${it.polylineId}") + } + } + error?.let { throw error as Throwable } + return result + } + + fun removePolylines(polylines: List) { + invalidateViewAfterMapLoad() + var error: Throwable? = null + polylines.forEach { + findPolylineController(it.polylineId)?.let { controller -> + controller.remove() + _polylines.remove(controller) + } + ?: run { + error = + FlutterError("polylineNotFound", "Failed to remove polyline with id ${it.polylineId}") + } + } + error?.let { throw error as Throwable } + } + + fun clearPolylines() { + invalidateViewAfterMapLoad() + _polylines.forEach { controller -> controller.remove() } + _polylines.clear() + } + + fun getCircles(): List { + val density = Resources.getSystem().displayMetrics.density + return _circles.map { + CircleDto(it.circleId, Convert.circleToCircleOptions(it.circle, density)) + } + } + + fun addCircles(circles: List): List { + val density = Resources.getSystem().displayMetrics.density + invalidateViewAfterMapLoad() + val result = mutableListOf() + circles.forEach { + val builder = CircleBuilder() + Convert.sinkCircleOptions(it.options, builder, density) + val options = builder.build() + val circle = getMap().addCircle(options) + if (circle != null) { + val controller = CircleController(circle, it.circleId) + _circles.add(controller) + result.add(it) + } + } + return result + } + + fun updateCircles(circles: List): List { + val density = Resources.getSystem().displayMetrics.density + invalidateViewAfterMapLoad() + val result = mutableListOf() + var error: Throwable? = null + circles.forEach { + findCircleController(it.circleId)?.let { controller -> + Convert.sinkCircleOptions(it.options, controller, density) + result.add(it) + } + ?: run { + error = FlutterError("circleNotFound", "Failed to update circle with id ${it.circleId}") + } + } + error?.let { throw error as Throwable } + return result + } + + fun removeCircles(circles: List) { + invalidateViewAfterMapLoad() + var error: Throwable? = null + circles.forEach { + findCircleController(it.circleId)?.let { controller -> + controller.remove() + _circles.remove(controller) + } + ?: run { + error = FlutterError("circleNotFound", "Failed to remove circle with id ${it.circleId}") + } + } + error?.let { throw error as Throwable } + } + + fun clearCircles() { + invalidateViewAfterMapLoad() + _circles.forEach { controller -> controller.remove() } + _circles.clear() + } +} \ No newline at end of file diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationInspectorHandler.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationInspectorHandler.kt index 37740cc..de688b6 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationInspectorHandler.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationInspectorHandler.kt @@ -15,7 +15,7 @@ package com.google.maps.flutter.navigation class GoogleMapsNavigationInspectorHandler( - private val viewRegistry: GoogleMapsNavigationViewRegistry + private val viewRegistry: GoogleMapsViewRegistry ) : NavigationInspector { private fun manager(): GoogleMapsNavigationSessionManager { return GoogleMapsNavigationSessionManager.getInstance() @@ -23,7 +23,7 @@ class GoogleMapsNavigationInspectorHandler( override fun isViewAttachedToSession(viewId: Long): Boolean { /// Is session exists, it's automatically attached to any existing view. - if (viewRegistry.getView(viewId.toInt()) != null) { + if (viewRegistry.getNavigationView(viewId.toInt()) != null) { return manager().isInitialized() } return false diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt index 14ac770..e017fc9 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt @@ -24,28 +24,28 @@ import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter /** GoogleMapsNavigationPlugin */ class GoogleMapsNavigationPlugin : FlutterPlugin, ActivityAware { - private lateinit var viewRegistry: GoogleMapsNavigationViewRegistry - private lateinit var viewMessageHandler: GoogleMapsNavigationViewMessageHandler + private lateinit var viewRegistry: GoogleMapsViewRegistry + private lateinit var viewMessageHandler: GoogleMapsViewMessageHandler private lateinit var imageRegistryMessageHandler: GoogleMapsImageRegistryMessageHandler - private lateinit var navigationViewEventApi: NavigationViewEventApi + private lateinit var navigationViewEventApi: ViewEventApi private lateinit var _binding: FlutterPlugin.FlutterPluginBinding private lateinit var lifecycle: Lifecycle private lateinit var imageRegistry: ImageRegistry override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) { - viewRegistry = GoogleMapsNavigationViewRegistry() + viewRegistry = GoogleMapsViewRegistry() imageRegistry = ImageRegistry() - viewMessageHandler = GoogleMapsNavigationViewMessageHandler(viewRegistry) - NavigationViewApi.setUp(binding.binaryMessenger, viewMessageHandler) + viewMessageHandler = GoogleMapsViewMessageHandler(viewRegistry) + MapViewApi.setUp(binding.binaryMessenger, viewMessageHandler) imageRegistryMessageHandler = GoogleMapsImageRegistryMessageHandler(imageRegistry) ImageRegistryApi.setUp(binding.binaryMessenger, imageRegistryMessageHandler) - navigationViewEventApi = NavigationViewEventApi(binding.binaryMessenger) + navigationViewEventApi = ViewEventApi(binding.binaryMessenger) _binding = binding binding.applicationContext.registerComponentCallbacks(viewRegistry) } override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { - NavigationViewApi.setUp(binding.binaryMessenger, null) // Cleanup + MapViewApi.setUp(binding.binaryMessenger, null) // Cleanup ImageRegistryApi.setUp(binding.binaryMessenger, null) GoogleMapsNavigationSessionManager.destroyInstance() binding.applicationContext.unregisterComponentCallbacks(viewRegistry) @@ -53,7 +53,7 @@ class GoogleMapsNavigationPlugin : FlutterPlugin, ActivityAware { override fun onAttachedToActivity(binding: ActivityPluginBinding) { val factory = - GoogleMapsNavigationViewFactory(viewRegistry, navigationViewEventApi, imageRegistry) + GoogleMapsViewFactory(viewRegistry, navigationViewEventApi, imageRegistry) _binding.platformViewRegistry.registerViewFactory("google_navigation_flutter", factory) GoogleMapsNavigationSessionManager.createInstance(_binding.binaryMessenger) val inspectorHandler = GoogleMapsNavigationInspectorHandler(viewRegistry) diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt index 1dd9512..fafa2b4 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt @@ -46,18 +46,17 @@ class GoogleMapsNavigationView internal constructor( context: Context, mapOptions: GoogleMapOptions, - navigationOptions: NavigationViewOptions, - private val viewId: Int, - private val viewRegistry: GoogleMapsNavigationViewRegistry, - private val navigationViewEventApi: NavigationViewEventApi, + navigationOptions: NavigationViewOptions?, + viewId: Int, + private val viewRegistry: GoogleMapsViewRegistry, + viewEventApi: ViewEventApi, private val imageRegistry: ImageRegistry -) : PlatformView { +) : PlatformView, GoogleMapsBaseMapView(viewId, viewEventApi, imageRegistry) { companion object { const val INVALIDATION_FRAME_SKIP_AMOUNT = 4 // Amount of skip frames before invalidation } - private val _navigationView: NavigationView - private var _map: GoogleMap? = null + private val _navigationView: NavigationView = NavigationView(context, mapOptions) private val _frameDelayHandler = FrameDelayHandler(INVALIDATION_FRAME_SKIP_AMOUNT) private var _loadedCallbackPending = false private val _markers = mutableListOf() @@ -78,7 +77,6 @@ internal constructor( private var _isSpeedLimitIconEnabled: Boolean = false private var _isSpeedometerEnabled: Boolean = false private var _isTrafficIncidentCardsEnabled: Boolean = true - private var _consumeMyLocationButtonClickEventsEnabled: Boolean = false // Nullable variable to hold the callback function private var _mapReadyCallback: ((Result) -> Unit)? = null @@ -88,8 +86,6 @@ internal constructor( } init { - _navigationView = NavigationView(context, mapOptions) - // Call all of these three lifecycle functions in sequence to fully // initialize the navigation view. _navigationView.onCreate(context.applicationInfo.metaData) @@ -99,7 +95,7 @@ internal constructor( // Initialize navigation view with given navigation view options var navigationViewEnabled: Boolean = false if ( - navigationOptions.navigationUiEnabledPreference == NavigationUIEnabledPreference.AUTOMATIC + navigationOptions?.navigationUiEnabledPreference == NavigationUIEnabledPreference.AUTOMATIC ) { val navigatorInitialized = GoogleMapsNavigationSessionManager.getInstance().isInitialized() if (navigatorInitialized) { @@ -112,7 +108,7 @@ internal constructor( _maxZoomLevelPreference = mapOptions.maxZoomPreference _navigationView.getMapAsync { map -> - _map = map + setMap(map) initListeners() imageRegistry.mapViewInitializationComplete() @@ -124,15 +120,11 @@ internal constructor( } // Call and clear view ready callback if available. - _mapReadyCallback?.let { callback -> - callback(Result.success(Unit)) - _mapReadyCallback = null - } - + mapReady() invalidateViewAfterMapLoad() } - viewRegistry.registerView(viewId, this) + viewRegistry.registerNavigationView(viewId, this) } override fun dispose() { @@ -155,163 +147,22 @@ internal constructor( _navigationView.removeOnRecenterButtonClickedListener {} - viewRegistry.unregisterView(viewId) - } - - private fun initListeners() { - _navigationView.addOnRecenterButtonClickedListener { - navigationViewEventApi.onRecenterButtonClicked(viewId.toLong()) {} - } - _navigationView.addOnNavigationUiChangedListener { - navigationViewEventApi.onNavigationUIEnabledChanged(viewId.toLong(), it) {} - } - getMap().setOnMapClickListener { - navigationViewEventApi.onMapClickEvent( - viewId.toLong(), - LatLngDto(it.latitude, it.longitude), - ) {} - } - getMap().setOnMapLongClickListener { - navigationViewEventApi.onMapLongClickEvent( - viewId.toLong(), - LatLngDto(it.latitude, it.longitude), - ) {} - } - getMap().setOnMarkerClickListener { marker -> - val markerId = findMarkerId(marker) - val controller = findMarkerController(markerId) - - sendMarkerEvent(marker, MarkerEventTypeDto.CLICKED) - - // This return value controls the default onClick behaviour, - // return true for default behaviour to occur and false to not. - // Default behavior is for the camera to move to the marker and an info window to - // appear. - controller?.consumeTapEvents ?: false - } - getMap() - .setOnMarkerDragListener( - object : OnMarkerDragListener { - override fun onMarkerDrag(marker: Marker) { - sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAG) - } - - override fun onMarkerDragEnd(marker: Marker) { - sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAGEND) - } - - override fun onMarkerDragStart(marker: Marker) { - sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAGSTART) - } - } - ) - getMap().setOnInfoWindowClickListener { marker -> - sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWCLICKED) - } - getMap().setOnInfoWindowCloseListener { marker -> - try { - sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWCLOSED) - } catch (exception: FlutterError) { - // Google maps trigger this callback if info window is open for marker that is removed. - // As marker and it's information that maps the marker to the markerId is removed, - // [FlutterError] is thrown. In this case info window close event is not sent. - } - } - getMap().setOnInfoWindowLongClickListener { marker -> - sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWLONGCLICKED) - } - - getMap().setOnPolygonClickListener { polygon -> - val polygonId = findPolygonId(polygon) - navigationViewEventApi.onPolygonClicked(viewId.toLong(), polygonId) {} - } - - getMap().setOnPolylineClickListener { polyline -> - val polylineId = findPolylineId(polyline) - navigationViewEventApi.onPolylineClicked(viewId.toLong(), polylineId) {} - } - - getMap().setOnCircleClickListener { circle -> - val circleId = findCircleId(circle) - navigationViewEventApi.onCircleClicked(viewId.toLong(), circleId) {} - } - - getMap().setOnMyLocationClickListener { - navigationViewEventApi.onMyLocationClicked(viewId.toLong()) {} - } - - getMap().setOnMyLocationButtonClickListener { - navigationViewEventApi.onMyLocationButtonClicked(viewId.toLong()) {} - _consumeMyLocationButtonClickEventsEnabled - } - - getMap() - .setOnFollowMyLocationCallback( - object : OnCameraFollowLocationCallback { - override fun onCameraStartedFollowingLocation() { - navigationViewEventApi.onCameraChanged( - viewId.toLong(), - CameraEventTypeDto.ONCAMERASTARTEDFOLLOWINGLOCATION, - Convert.convertCameraPositionToDto(getMap().cameraPosition) - ) {} - } - - override fun onCameraStoppedFollowingLocation() { - navigationViewEventApi.onCameraChanged( - viewId.toLong(), - CameraEventTypeDto.ONCAMERASTOPPEDFOLLOWINGLOCATION, - Convert.convertCameraPositionToDto(getMap().cameraPosition) - ) {} - } - } - ) - } - - @Throws(FlutterError::class) - private fun getMap(): GoogleMap { - if (_map != null) { - return _map!! - } else { - throw FlutterError("mapNotFound", "GoogleMap not initialized yet") - } - } - - /** - * Workaround for map view not showing added or edited map objects immediately after add/edit. - * Schedules [NavigationView.invalidate] call after a certain amount of frames are drawn. In - * marker updates short delay is not enough, [doubleInvalidate] is set to true. - * - * @param doubleInvalidate if true, schedules another invalidate event after the first one. - */ - private fun invalidateViewAfterMapLoad(doubleInvalidate: Boolean = false) { - if (_loadedCallbackPending) { - return - } - _loadedCallbackPending = true - getMap().setOnMapLoadedCallback { - _loadedCallbackPending = false - _frameDelayHandler.scheduleActionWithFrameDelay { - _navigationView.invalidate() - if (doubleInvalidate) { - _frameDelayHandler.scheduleActionWithFrameDelay { _navigationView.invalidate() } - } - } - } + viewRegistry.unregisterNavigationView(viewId) } - fun onStart() { + override fun onStart() { _navigationView.onStart() } - fun onResume() { + override fun onResume() { _navigationView.onResume() } - fun onStop() { + override fun onStop() { _navigationView.onStop() } - fun onPause() { + override fun onPause() { _navigationView.onPause() } @@ -323,6 +174,16 @@ internal constructor( _navigationView.onTrimMemory(level) } + override fun initListeners() { + _navigationView.addOnRecenterButtonClickedListener { + viewEventApi.onRecenterButtonClicked(viewId.toLong()) {} + } + _navigationView.addOnNavigationUiChangedListener { + viewEventApi.onNavigationUIEnabledChanged(viewId.toLong(), it) {} + } + super.initListeners() + } + @Throws(FlutterError::class) private fun findMarkerId(marker: Marker): String { return _markers.find { it.marker == marker }?.markerId @@ -370,13 +231,13 @@ internal constructor( @Throws(FlutterError::class) private fun sendMarkerEvent(marker: Marker, eventType: MarkerEventTypeDto) { val markerId = findMarkerId(marker) - navigationViewEventApi.onMarkerEvent(viewId.toLong(), markerId, eventType) {} + viewEventApi.onMarkerEvent(viewId.toLong(), markerId, eventType) {} } @Throws(FlutterError::class) private fun sendMarkerDragEvent(marker: Marker, eventType: MarkerDragEventTypeDto) { val markerId = findMarkerId(marker) - navigationViewEventApi.onMarkerDragEvent( + viewEventApi.onMarkerDragEvent( viewId.toLong(), markerId, eventType, @@ -384,271 +245,10 @@ internal constructor( ) {} } - fun isMyLocationEnabled(): Boolean { - return getMap().isMyLocationEnabled - } - - @SuppressLint("MissingPermission") - fun setMyLocationEnabled(enabled: Boolean) { - invalidateViewAfterMapLoad() - getMap().isMyLocationEnabled = enabled - } - - fun setMyLocationButtonEnabled(enabled: Boolean) { - invalidateViewAfterMapLoad() - getMap().uiSettings.isMyLocationButtonEnabled = enabled - } - - fun setZoomGesturesEnabled(enabled: Boolean) { - invalidateViewAfterMapLoad() - getMap().uiSettings.isZoomGesturesEnabled = enabled - } - - fun setZoomControlsEnabled(enabled: Boolean) { - invalidateViewAfterMapLoad() - getMap().uiSettings.isZoomControlsEnabled = enabled - } - - fun setCompassEnabled(enabled: Boolean) { - invalidateViewAfterMapLoad() - getMap().uiSettings.isCompassEnabled = enabled - } - - fun setRotateGesturesEnabled(enabled: Boolean) { - getMap().uiSettings.isRotateGesturesEnabled = enabled - } - - fun setScrollGesturesEnabled(enabled: Boolean) { - getMap().uiSettings.isScrollGesturesEnabled = enabled - } - - fun setScrollGesturesDuringRotateOrZoomEnabled(enabled: Boolean) { - getMap().uiSettings.isScrollGesturesEnabledDuringRotateOrZoom = enabled - } - - fun setTiltGesturesEnabled(enabled: Boolean) { - getMap().uiSettings.isTiltGesturesEnabled = enabled - } - - fun setMapToolbarEnabled(enabled: Boolean) { - getMap().uiSettings.isMapToolbarEnabled = enabled - } - - fun setTrafficEnabled(enabled: Boolean) { - getMap().isTrafficEnabled = enabled - } - - fun isMyLocationButtonEnabled(): Boolean { - return getMap().uiSettings.isMyLocationButtonEnabled - } - - fun isZoomGesturesEnabled(): Boolean { - return getMap().uiSettings.isZoomGesturesEnabled - } - - fun isZoomControlsEnabled(): Boolean { - return getMap().uiSettings.isZoomControlsEnabled - } - - fun isCompassEnabled(): Boolean { - return getMap().uiSettings.isCompassEnabled - } - - fun isRotateGesturesEnabled(): Boolean { - return getMap().uiSettings.isRotateGesturesEnabled - } - - fun isScrollGesturesEnabled(): Boolean { - return getMap().uiSettings.isScrollGesturesEnabled - } - - fun isScrollGesturesEnabledDuringRotateOrZoom(): Boolean { - return getMap().uiSettings.isScrollGesturesEnabledDuringRotateOrZoom - } - - fun isTiltGesturesEnabled(): Boolean { - return getMap().uiSettings.isTiltGesturesEnabled - } - - fun isMapToolbarEnabled(): Boolean { - return getMap().uiSettings.isMapToolbarEnabled - } - - fun isTrafficEnabled(): Boolean { - return getMap().isTrafficEnabled - } - - fun getMyLocation(): Location? { - // Remove this functionality and either guide users to use separate flutter - // library for geolocation or implement separate method under - // [GoogleMapsNavigationSessionManager] to fetch the location - // using the [FusedLocationProviderApi]. - @Suppress("DEPRECATION") return getMap().myLocation - } - - fun getCameraPosition(): CameraPosition { - return getMap().cameraPosition ?: CameraPosition(LatLng(0.0, 0.0), 0.0F, 0.0F, 0.0F) - } - - fun getVisibleRegion(): LatLngBounds { - return getMap().projection.visibleRegion.latLngBounds - } - - private fun getMapCallback(callback: (Result) -> Unit): GoogleMap.CancelableCallback { - return object : GoogleMap.CancelableCallback { - override fun onFinish() { - callback(Result.success(true)) - } - - override fun onCancel() { - callback(Result.success(false)) - } - } - } - - private fun animateCamera( - cameraUpdate: CameraUpdate, - duration: Long?, - callback: (Result) -> Unit - ) { - // Native animateCamera() doesn't allow setting null duration so need to do two calls - if (duration == null) { - getMap().animateCamera(cameraUpdate, getMapCallback(callback)) - } else { - getMap().animateCamera(cameraUpdate, duration.toInt(), getMapCallback(callback)) - } - } - - fun animateCameraToCameraPosition( - cameraPosition: CameraPosition, - duration: Long?, - callback: (Result) -> Unit - ) { - animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), duration, callback) - } - - fun animateCameraToLatLng(point: LatLng, duration: Long?, callback: (Result) -> Unit) { - animateCamera(CameraUpdateFactory.newLatLng(point), duration, callback) - } - - fun animateCameraToLatLngBounds( - bounds: LatLngBounds, - padding: Double, - duration: Long?, - callback: (Result) -> Unit - ) { - animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding.toInt()), duration, callback) - } - - fun animateCameraToLatLngZoom( - point: LatLng, - zoom: Double, - duration: Long?, - callback: (Result) -> Unit - ) { - animateCamera(CameraUpdateFactory.newLatLngZoom(point, zoom.toFloat()), duration, callback) - } - - fun animateCameraByScroll( - scrollByDx: Double, - scrollByDy: Double, - duration: Long?, - callback: (Result) -> Unit - ) { - animateCamera( - CameraUpdateFactory.scrollBy(scrollByDx.toFloat(), scrollByDy.toFloat()), - duration, - callback - ) - } - - fun animateCameraByZoom( - zoomBy: Double, - focus: Point?, - duration: Long?, - callback: (Result) -> Unit - ) { - // Native animateCamera() doesn't allow setting null duration or focus so need to split to - // multiple calls - val cameraUpdate = - if (focus != null) { - CameraUpdateFactory.zoomBy(zoomBy.toFloat(), focus) - } else { - CameraUpdateFactory.zoomBy(zoomBy.toFloat()) - } - animateCamera(cameraUpdate, duration, callback) - } - - fun animateCameraToZoom(zoom: Double, duration: Long?, callback: (Result) -> Unit) { - animateCamera(CameraUpdateFactory.zoomTo(zoom.toFloat()), duration, callback) - } - - fun moveCameraToCameraPosition(cameraPosition: CameraPosition) { - return getMap().moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) - } - - fun moveCameraToLatLng(point: LatLng) { - return getMap().moveCamera(CameraUpdateFactory.newLatLng(point)) - } - - fun moveCameraToLatLngBounds(bounds: LatLngBounds, padding: Double) { - return getMap().moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding.toInt())) - } - - fun moveCameraToLatLngZoom(point: LatLng, zoom: Double) { - return getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(point, zoom.toFloat())) - } - - fun moveCameraByScroll(scrollByDx: Double, scrollByDy: Double) { - return getMap() - .moveCamera(CameraUpdateFactory.scrollBy(scrollByDx.toFloat(), scrollByDy.toFloat())) - } - - fun moveCameraByZoom(zoomBy: Double, focus: Point?) { - if (focus != null) { - getMap().moveCamera(CameraUpdateFactory.zoomBy(zoomBy.toFloat(), focus)) - } else { - getMap().moveCamera(CameraUpdateFactory.zoomBy(zoomBy.toFloat())) - } - } - - fun moveCameraToZoom(zoom: Double) { - return getMap().moveCamera(CameraUpdateFactory.zoomTo(zoom.toFloat())) - } - - fun getMapType(): Int { - return getMap().mapType - } - - fun setMapType(mapType: Int) { - invalidateViewAfterMapLoad() - getMap().mapType = mapType - } - - fun setMapStyle(styleJson: String) { - invalidateViewAfterMapLoad() - if (!getMap().setMapStyle(MapStyleOptions(styleJson))) { - throw FlutterError("mapStyleError", "Failed to set map style") - } - } - fun isNavigationTripProgressBarEnabled(): Boolean { return _isNavigationTripProgressBarEnabled } - @SuppressLint("MissingPermission") - fun followMyLocation(perspective: Int, zoomLevel: Double?) { - invalidateViewAfterMapLoad() - getMap().followMyLocation(perspective) - if (zoomLevel != null) { - val options: FollowMyLocationOptions = - FollowMyLocationOptions.builder().setZoomLevel(zoomLevel.toFloat()).build() - getMap().followMyLocation(perspective, options) - } else { - getMap().followMyLocation(perspective) - } - } - fun setNavigationTripProgressBarEnabled(enabled: Boolean) { invalidateViewAfterMapLoad() _navigationView.setTripProgressBarEnabled(enabled) @@ -771,320 +371,6 @@ internal constructor( getMap().setMaxZoomPreference(maxZoomPreference) } - fun awaitMapReady(callback: (Result) -> Unit) { - if (_map != null) { - // Call the callback immediately as the map is already initialized - callback(Result.success(Unit)) - } else if (_mapReadyCallback != null) { - // If there is already a callback pending, throw an error to avoid overriding it - callback( - Result.failure( - FlutterError( - "mapReadyCallbackAlreadyPending", - "A callback is already pending and cannot be overridden." - ) - ) - ) - } else { - // Save the callback to be called once the map is initialized - _mapReadyCallback = callback - } - } - - fun getMarkers(): List { - return _markers.map { MarkerDto(it.markerId, Convert.markerControllerToMarkerOptions(it)) } - } - - fun addMarkers(markers: List): List { - val result = mutableListOf() - markers.forEach { - val builder = MarkerBuilder() - Convert.sinkMarkerOptions(it.options, builder, imageRegistry) - val options = builder.build() - val marker = getMap().addMarker(options) - if (marker != null) { - val registeredImage = - it.options.icon.registeredImageId?.let { id -> imageRegistry.findRegisteredImage(id) } - val controller = - MarkerController( - marker, - it.markerId, - builder.consumeTapEvents, - it.options.anchor.u.toFloat(), - it.options.anchor.v.toFloat(), - it.options.infoWindow.anchor.u.toFloat(), - it.options.infoWindow.anchor.v.toFloat(), - registeredImage - ) - _markers.add(controller) - result.add(it) - } - } - // Double invalidate map view. Marker icon updates seem to take extra - // time and some times icon did not update properly after single invalidate. - invalidateViewAfterMapLoad(true) - return result - } - - @Throws(FlutterError::class) - fun updateMarkers(markers: List): List { - val result = mutableListOf() - var error: Throwable? = null - markers.forEach { - findMarkerController(it.markerId)?.let { controller -> - Convert.sinkMarkerOptions(it.options, controller, imageRegistry) - result.add(it) - } - ?: run { - error = FlutterError("markerNotFound", "Failed to update marker with id ${it.markerId}") - } - } - error?.let { throw error as Throwable } - // Double invalidate map view. Marker icon updates seem to take extra - // time and some times icon did not update properly after single invalidate. - invalidateViewAfterMapLoad(true) - return result - } - - @Throws(FlutterError::class) - fun removeMarkers(markers: List) { - invalidateViewAfterMapLoad() - var error: Throwable? = null - markers.forEach { - findMarkerController(it.markerId)?.let { controller -> - controller.remove() - _markers.remove(controller) - } - ?: run { - error = FlutterError("markerNotFound", "Failed to remove marker with id ${it.markerId}") - } - } - error?.let { throw error as Throwable } - } - - fun clearMarkers() { - invalidateViewAfterMapLoad() - _markers.forEach { controller -> controller.remove() } - _markers.clear() - } - - fun clear() { - getMap().clear() - _markers.clear() - _polygons.clear() - _polylines.clear() - _circles.clear() - } - - fun getPolygons(): List { - val density = Resources.getSystem().displayMetrics.density - return _polygons.map { - PolygonDto(it.polygonId, Convert.polygonToPolygonOptions(it.polygon, density)) - } - } - - fun addPolygons( - polygons: List, - ): List { - val density = Resources.getSystem().displayMetrics.density - invalidateViewAfterMapLoad() - val result = mutableListOf() - polygons.forEach { - val builder = PolygonBuilder() - Convert.sinkPolygonOptions(it.options, builder, density) - val options = builder.build() - val polygon = getMap().addPolygon(options) - if (polygon != null) { - val controller = PolygonController(polygon, it.polygonId) - _polygons.add(controller) - result.add(it) - } - } - return result - } - - fun updatePolygons(polygons: List): List { - invalidateViewAfterMapLoad() - var error: Throwable? = null - val result = mutableListOf() - val density = Resources.getSystem().displayMetrics.density - polygons.forEach { - findPolygonController(it.polygonId)?.let { controller -> - Convert.sinkPolygonOptions(it.options, controller, density) - result.add(it) - } - ?: run { - error = - FlutterError("polygonNotFound", "Failed to update polygon with id ${it.polygonId}") - } - } - error?.let { throw error as Throwable } - - return result - } - - fun removePolygons(polygons: List) { - invalidateViewAfterMapLoad() - var error: Throwable? = null - polygons.forEach { - findPolygonController(it.polygonId)?.let { controller -> - controller.remove() - _polygons.remove(controller) - } - ?: run { - error = - FlutterError("polygonNotFound", "Failed to remove polygon with id ${it.polygonId}") - } - } - error?.let { throw error as Throwable } - } - - fun clearPolygons() { - invalidateViewAfterMapLoad() - _polygons.forEach { controller -> controller.remove() } - _polygons.clear() - } - - fun getPolylines(): List { - val density = Resources.getSystem().displayMetrics.density - return _polylines.map { - PolylineDto(it.polylineId, Convert.polylineToPolylineOptions(it.polyline, density)) - } - } - - fun addPolylines( - polylines: List, - ): List { - val density = Resources.getSystem().displayMetrics.density - invalidateViewAfterMapLoad() - val result = mutableListOf() - polylines.forEach { - val builder = PolylineBuilder() - Convert.sinkPolylineOptions(it.options, builder, density) - val options = builder.build() - val polyline = getMap().addPolyline(options) - if (polyline != null) { - val controller = PolylineController(polyline, it.polylineId) - _polylines.add(controller) - result.add(it) - } - } - return result - } - - fun updatePolylines(polylines: List): List { - var error: Throwable? = null - val density = Resources.getSystem().displayMetrics.density - invalidateViewAfterMapLoad() - val result = mutableListOf() - polylines.forEach { - findPolylineController(it.polylineId)?.let { controller -> - Convert.sinkPolylineOptions(it.options, controller, density) - result.add(it) - } - ?: run { - error = - FlutterError("polylineNotFound", "Failed to update polyline with id ${it.polylineId}") - } - } - error?.let { throw error as Throwable } - return result - } - - fun removePolylines(polylines: List) { - invalidateViewAfterMapLoad() - var error: Throwable? = null - polylines.forEach { - findPolylineController(it.polylineId)?.let { controller -> - controller.remove() - _polylines.remove(controller) - } - ?: run { - error = - FlutterError("polylineNotFound", "Failed to remove polyline with id ${it.polylineId}") - } - } - error?.let { throw error as Throwable } - } - - fun clearPolylines() { - invalidateViewAfterMapLoad() - _polylines.forEach { controller -> controller.remove() } - _polylines.clear() - } - - fun getCircles(): List { - val density = Resources.getSystem().displayMetrics.density - return _circles.map { - CircleDto(it.circleId, Convert.circleToCircleOptions(it.circle, density)) - } - } - - fun addCircles(circles: List): List { - val density = Resources.getSystem().displayMetrics.density - invalidateViewAfterMapLoad() - val result = mutableListOf() - circles.forEach { - val builder = CircleBuilder() - Convert.sinkCircleOptions(it.options, builder, density) - val options = builder.build() - val circle = getMap().addCircle(options) - if (circle != null) { - val controller = CircleController(circle, it.circleId) - _circles.add(controller) - result.add(it) - } - } - return result - } - - fun updateCircles(circles: List): List { - val density = Resources.getSystem().displayMetrics.density - invalidateViewAfterMapLoad() - val result = mutableListOf() - var error: Throwable? = null - circles.forEach { - findCircleController(it.circleId)?.let { controller -> - Convert.sinkCircleOptions(it.options, controller, density) - result.add(it) - } - ?: run { - error = FlutterError("circleNotFound", "Failed to update circle with id ${it.circleId}") - } - } - error?.let { throw error as Throwable } - return result - } - - fun removeCircles(circles: List) { - invalidateViewAfterMapLoad() - var error: Throwable? = null - circles.forEach { - findCircleController(it.circleId)?.let { controller -> - controller.remove() - _circles.remove(controller) - } - ?: run { - error = FlutterError("circleNotFound", "Failed to remove circle with id ${it.circleId}") - } - } - error?.let { throw error as Throwable } - } - - fun clearCircles() { - invalidateViewAfterMapLoad() - _circles.forEach { controller -> controller.remove() } - _circles.clear() - } - - fun setConsumeMyLocationButtonClickEventsEnabled(enabled: Boolean) { - _consumeMyLocationButtonClickEventsEnabled = enabled - } - - fun isConsumeMyLocationButtonClickEventsEnabled(): Boolean { - return _consumeMyLocationButtonClickEventsEnabled - } - fun registerOnCameraChangedListener() { getMap().setOnCameraMoveStartedListener { reason -> val event = @@ -1099,11 +385,11 @@ internal constructor( } } val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) - navigationViewEventApi.onCameraChanged(viewId.toLong(), event, position) {} + viewEventApi.onCameraChanged(viewId.toLong(), event, position) {} } getMap().setOnCameraMoveListener { val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) - navigationViewEventApi.onCameraChanged( + viewEventApi.onCameraChanged( viewId.toLong(), CameraEventTypeDto.ONCAMERAMOVE, position @@ -1111,7 +397,7 @@ internal constructor( } getMap().setOnCameraIdleListener { val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) - navigationViewEventApi.onCameraChanged( + viewEventApi.onCameraChanged( viewId.toLong(), CameraEventTypeDto.ONCAMERAIDLE, position diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationViewRegistry.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationViewRegistry.kt deleted file mode 100644 index 53c3701..0000000 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationViewRegistry.kt +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.maps.flutter.navigation - -import android.content.ComponentCallbacks -import android.content.ComponentCallbacks2 -import android.content.res.Configuration -import android.util.SparseArray -import androidx.core.util.forEach -import androidx.lifecycle.DefaultLifecycleObserver -import androidx.lifecycle.LifecycleOwner - -/** GoogleMapsNavigationViewRegistry */ -class GoogleMapsNavigationViewRegistry : - DefaultLifecycleObserver, ComponentCallbacks, ComponentCallbacks2 { - private val views: SparseArray = SparseArray() - - fun registerView(viewId: Int, view: GoogleMapsNavigationView) { - views.put(viewId, view) - } - - fun unregisterView(viewId: Int) { - views.remove(viewId) - } - - fun getView(viewId: Int): GoogleMapsNavigationView? { - return views.get(viewId) - } - - override fun onStart(owner: LifecycleOwner) { - views.forEach { _, view -> view.onStart() } - } - - override fun onResume(owner: LifecycleOwner) { - views.forEach { _, view -> view.onResume() } - } - - override fun onPause(owner: LifecycleOwner) { - views.forEach { _, view -> view.onPause() } - } - - override fun onStop(owner: LifecycleOwner) { - views.forEach { _, view -> view.onStop() } - } - - override fun onConfigurationChanged(configuration: Configuration) { - views.forEach { _, view -> view.onConfigurationChanged(configuration) } - } - - override fun onLowMemory() { - // Ignored as NavigationView only supports onTrimMemory - } - - override fun onTrimMemory(level: Int) { - views.forEach { _, view -> view.onTrimMemory(level) } - } -} diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationViewFactory.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewFactory.kt similarity index 58% rename from android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationViewFactory.kt rename to android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewFactory.kt index 06fed76..4f529e7 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationViewFactory.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewFactory.kt @@ -21,24 +21,38 @@ import io.flutter.plugin.common.StandardMessageCodec import io.flutter.plugin.platform.PlatformView import io.flutter.plugin.platform.PlatformViewFactory -class GoogleMapsNavigationViewFactory( - private val viewRegistry: GoogleMapsNavigationViewRegistry, - private val navigationViewEventApi: NavigationViewEventApi, +class GoogleMapsViewFactory( + private val viewRegistry: GoogleMapsViewRegistry, + private val viewEventApi: ViewEventApi, private val imageRegistry: ImageRegistry ) : PlatformViewFactory(StandardMessageCodec.INSTANCE) { override fun create(context: Context, viewId: Int, args: Any?): PlatformView { - val params = NavigationViewCreationOptionsDto.fromList(args as List) + val params = ViewCreationOptionsDto.fromList(args as List) val mapOptions = Convert.convertMapOptionsFromDto(params.mapOptions) - val navigationViewOptions = - Convert.convertNavigationViewOptionsFromDto(params.navigationViewOptions) - return GoogleMapsNavigationView( - context, - mapOptions, - navigationViewOptions, - viewId, - viewRegistry, - navigationViewEventApi, - imageRegistry - ) + if (params.mapViewType == MapViewTypeDto.NAVIGATION) { + val navigationViewOptionsDto = params.navigationViewOptions?.let { + Convert.convertNavigationViewOptionsFromDto( + it + ) + } + return GoogleMapsNavigationView( + context, + mapOptions, + navigationViewOptionsDto, + viewId, + viewRegistry, + viewEventApi, + imageRegistry + ) + } else { + return GoogleMapView( + context, + mapOptions, + viewId, + viewEventApi, + viewRegistry, + imageRegistry + ) + } } } diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationViewMessageHandler.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt similarity index 85% rename from android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationViewMessageHandler.kt rename to android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt index c71c735..d77e1c1 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationViewMessageHandler.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt @@ -19,11 +19,20 @@ package com.google.maps.flutter.navigation import android.content.res.Resources /** GoogleMapsNavigationMessageHandler */ -class GoogleMapsNavigationViewMessageHandler( - private val viewRegistry: GoogleMapsNavigationViewRegistry -) : NavigationViewApi { - private fun getView(viewId: Int): GoogleMapsNavigationView { - val view = viewRegistry.getView(viewId) +class GoogleMapsViewMessageHandler( + private val viewRegistry: GoogleMapsViewRegistry +) : MapViewApi { + + private fun getNavigationView(viewId: Int): GoogleMapsNavigationView { + val view = viewRegistry.getNavigationView(viewId) + if (view != null) { + return view + } else { + throw FlutterError("viewNotFound", "No valid navigation view found") + } + } + private fun getView(viewId: Int): GoogleMapsBaseMapView { + val view = viewRegistry.getMapView(viewId) if (view != null) { return view } else { @@ -284,7 +293,7 @@ class GoogleMapsNavigationViewMessageHandler( } override fun isNavigationTripProgressBarEnabled(viewId: Long): Boolean { - return getView(viewId.toInt()).isNavigationTripProgressBarEnabled() + return getNavigationView(viewId.toInt()).isNavigationTripProgressBarEnabled() } override fun followMyLocation( @@ -292,92 +301,92 @@ class GoogleMapsNavigationViewMessageHandler( perspective: CameraPerspectiveDto, zoomLevel: Double? ) { - val view = viewRegistry.getView(viewId.toInt()) + val view = viewRegistry.getMapView(viewId.toInt()) view?.followMyLocation(Convert.convertCameraPerspectiveFromDto(perspective), zoomLevel) } override fun setNavigationTripProgressBarEnabled(viewId: Long, enabled: Boolean) { - getView(viewId.toInt()).setNavigationTripProgressBarEnabled(enabled) + getNavigationView(viewId.toInt()).setNavigationTripProgressBarEnabled(enabled) } override fun isNavigationHeaderEnabled(viewId: Long): Boolean { - return getView(viewId.toInt()).isNavigationHeaderEnabled() + return getNavigationView(viewId.toInt()).isNavigationHeaderEnabled() } override fun setNavigationHeaderEnabled(viewId: Long, enabled: Boolean) { - getView(viewId.toInt()).setNavigationHeaderEnabled(enabled) + getNavigationView(viewId.toInt()).setNavigationHeaderEnabled(enabled) } override fun isNavigationFooterEnabled(viewId: Long): Boolean { - return getView(viewId.toInt()).isNavigationFooterEnabled() + return getNavigationView(viewId.toInt()).isNavigationFooterEnabled() } override fun setNavigationFooterEnabled(viewId: Long, enabled: Boolean) { - getView(viewId.toInt()).setNavigationFooterEnabled(enabled) + getNavigationView(viewId.toInt()).setNavigationFooterEnabled(enabled) } override fun isRecenterButtonEnabled(viewId: Long): Boolean { - return getView(viewId.toInt()).isRecenterButtonEnabled() + return getNavigationView(viewId.toInt()).isRecenterButtonEnabled() } override fun setRecenterButtonEnabled(viewId: Long, enabled: Boolean) { - getView(viewId.toInt()).setRecenterButtonEnabled(enabled) + getNavigationView(viewId.toInt()).setRecenterButtonEnabled(enabled) } override fun isSpeedLimitIconEnabled(viewId: Long): Boolean { - return getView(viewId.toInt()).isSpeedLimitIconEnabled() + return getNavigationView(viewId.toInt()).isSpeedLimitIconEnabled() } override fun setSpeedLimitIconEnabled(viewId: Long, enabled: Boolean) { - getView(viewId.toInt()).setSpeedLimitIconEnabled(enabled) + getNavigationView(viewId.toInt()).setSpeedLimitIconEnabled(enabled) } override fun isSpeedometerEnabled(viewId: Long): Boolean { - return getView(viewId.toInt()).isSpeedometerEnabled() + return getNavigationView(viewId.toInt()).isSpeedometerEnabled() } override fun setSpeedometerEnabled(viewId: Long, enabled: Boolean) { - getView(viewId.toInt()).setSpeedometerEnabled(enabled) + getNavigationView(viewId.toInt()).setSpeedometerEnabled(enabled) } override fun isTrafficIncidentCardsEnabled(viewId: Long): Boolean { - return getView(viewId.toInt()).isTrafficIncidentCardsEnabled() + return getNavigationView(viewId.toInt()).isTrafficIncidentCardsEnabled() } override fun setTrafficIncidentCardsEnabled(viewId: Long, enabled: Boolean) { - getView(viewId.toInt()).setTrafficIncidentCardsEnabled(enabled) + getNavigationView(viewId.toInt()).setTrafficIncidentCardsEnabled(enabled) } override fun isNavigationUIEnabled(viewId: Long): Boolean { - return getView(viewId.toInt()).isNavigationUIEnabled() + return getNavigationView(viewId.toInt()).isNavigationUIEnabled() } override fun setNavigationUIEnabled(viewId: Long, enabled: Boolean) { - getView(viewId.toInt()).setNavigationUIEnabled(enabled) + getNavigationView(viewId.toInt()).setNavigationUIEnabled(enabled) } override fun showRouteOverview(viewId: Long) { - getView(viewId.toInt()).showRouteOverview() + getNavigationView(viewId.toInt()).showRouteOverview() } override fun getMinZoomPreference(viewId: Long): Double { - return getView(viewId.toInt()).getMinZoomPreference().toDouble() + return getNavigationView(viewId.toInt()).getMinZoomPreference().toDouble() } override fun getMaxZoomPreference(viewId: Long): Double { - return getView(viewId.toInt()).getMaxZoomPreference().toDouble() + return getNavigationView(viewId.toInt()).getMaxZoomPreference().toDouble() } override fun resetMinMaxZoomPreference(viewId: Long) { - getView(viewId.toInt()).resetMinMaxZoomPreference() + getNavigationView(viewId.toInt()).resetMinMaxZoomPreference() } override fun setMinZoomPreference(viewId: Long, minZoomPreference: Double) { - getView(viewId.toInt()).setMinZoomPreference(minZoomPreference.toFloat()) + getNavigationView(viewId.toInt()).setMinZoomPreference(minZoomPreference.toFloat()) } override fun setMaxZoomPreference(viewId: Long, maxZoomPreference: Double) { - getView(viewId.toInt()).setMaxZoomPreference(maxZoomPreference.toFloat()) + getNavigationView(viewId.toInt()).setMaxZoomPreference(maxZoomPreference.toFloat()) } override fun getMarkers(viewId: Long): List { @@ -465,6 +474,6 @@ class GoogleMapsNavigationViewMessageHandler( } override fun registerOnCameraChangedListener(viewId: Long) { - getView(viewId.toInt()).registerOnCameraChangedListener() + getNavigationView(viewId.toInt()).registerOnCameraChangedListener() } } diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewRegistry.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewRegistry.kt new file mode 100644 index 0000000..8a5f323 --- /dev/null +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewRegistry.kt @@ -0,0 +1,91 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.maps.flutter.navigation + +import android.content.ComponentCallbacks +import android.content.ComponentCallbacks2 +import android.content.res.Configuration +import android.util.SparseArray +import androidx.core.util.forEach +import androidx.lifecycle.DefaultLifecycleObserver +import androidx.lifecycle.LifecycleOwner + +/** GoogleMapsNavigationViewRegistry */ +class GoogleMapsViewRegistry : + DefaultLifecycleObserver, ComponentCallbacks, ComponentCallbacks2 { + // Separate lists for navigation views, to be able to access them separately for navigation only operations. + private val navigationViews: SparseArray = SparseArray() + + // This list contains all map views, including navigation views. + private val allMapViews: SparseArray = SparseArray() + + fun registerNavigationView(viewId: Int, view: GoogleMapsNavigationView) { + // Navigation views are added both lists. + navigationViews.put(viewId, view) + allMapViews.put(viewId, view) + } + + fun registerMapView(viewId: Int, view: GoogleMapsBaseMapView) { + allMapViews.put(viewId, view) + } + + fun unregisterNavigationView(viewId: Int) { + // Navigation views need to be removed from both lists. + navigationViews.remove(viewId) + allMapViews.remove(viewId) + } + + fun unregisterMapView(viewId: Int) { + allMapViews.remove(viewId) + } + + fun getNavigationView(viewId: Int): GoogleMapsNavigationView? { + return navigationViews.get(viewId) + } + + fun getMapView(viewId: Int): GoogleMapsBaseMapView? { + return allMapViews.get(viewId) + } + + override fun onStart(owner: LifecycleOwner) { + allMapViews.forEach { _, view -> view.onStart() } + } + + override fun onResume(owner: LifecycleOwner) { + allMapViews.forEach { _, view -> view.onResume() } + } + + override fun onPause(owner: LifecycleOwner) { + allMapViews.forEach { _, view -> view.onPause() } + } + + override fun onStop(owner: LifecycleOwner) { + allMapViews.forEach { _, view -> view.onStop() } + } + + override fun onConfigurationChanged(configuration: Configuration) { + navigationViews.forEach { _, view -> view.onConfigurationChanged(configuration) } + } + + override fun onLowMemory() { + // Ignored as NavigationView only supports onTrimMemory + } + + override fun onTrimMemory(level: Int) { + navigationViews.forEach { _, view -> view.onTrimMemory(level) } + } +} diff --git a/ios/Classes/GoogleMapsNavigationViewFactory.swift b/ios/Classes/GoogleMapsNavigationViewFactory.swift index 65f0c89..19a8615 100644 --- a/ios/Classes/GoogleMapsNavigationViewFactory.swift +++ b/ios/Classes/GoogleMapsNavigationViewFactory.swift @@ -37,7 +37,7 @@ class GoogleMapsNavigationViewFactory: NSObject, FlutterPlatformViewFactory { arguments args: Any?) -> FlutterPlatformView { guard let argsList = args as? [Any?], let params = ViewCreationOptionsDto.fromList(argsList) else { - fatalError("Failed to decode NavigationViewCreationOptionsDto") + fatalError("Failed to decode ViewCreationOptionsDto") } let mapConfiguration = Convert.convertMapOptions(params.mapOptions) From 2b8fb8983cc0760e777920f268d4872173cc5e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Tue, 15 Oct 2024 15:04:02 +0800 Subject: [PATCH 04/18] fix: fix tests and format --- .../maps/flutter/navigation/GoogleMapView.kt | 92 +- .../navigation/GoogleMapsBaseMapView.kt | 1557 ++++----- .../GoogleMapsNavigationInspectorHandler.kt | 5 +- .../navigation/GoogleMapsNavigationPlugin.kt | 3 +- .../navigation/GoogleMapsNavigationView.kt | 25 +- .../navigation/GoogleMapsViewFactory.kt | 16 +- .../GoogleMapsViewMessageHandler.kt | 5 +- .../navigation/GoogleMapsViewRegistry.kt | 6 +- .../maps/flutter/navigation/messages.g.kt | 2066 ++++++++---- .../GoogleMapsNavigationViewFactory.swift | 3 +- ios/Classes/messages.g.swift | 2535 ++++++++++----- lib/src/google_maps_map_view.dart | 14 + lib/src/google_maps_map_view_controller.dart | 14 + lib/src/google_maps_navigation_view.dart | 14 + ...oogle_maps_navigation_view_controller.dart | 14 + lib/src/method_channel/common_view_api.dart | 3 +- lib/src/method_channel/messages.g.dart | 1709 ++++++---- test/google_navigation_flutter_test.dart | 30 +- .../google_navigation_flutter_test.mocks.dart | 7 +- test/messages_test.g.dart | 2877 +++++++++++------ 20 files changed, 7092 insertions(+), 3903 deletions(-) diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt index edaa889..76b9261 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt @@ -24,60 +24,60 @@ import io.flutter.plugin.platform.PlatformView class GoogleMapView internal constructor( - context: Context, - mapOptions: GoogleMapOptions, - viewId: Int, - viewEventApi: ViewEventApi, - private val viewRegistry: GoogleMapsViewRegistry, - imageRegistry: ImageRegistry + context: Context, + mapOptions: GoogleMapOptions, + viewId: Int, + viewEventApi: ViewEventApi, + private val viewRegistry: GoogleMapsViewRegistry, + imageRegistry: ImageRegistry ) : PlatformView, GoogleMapsBaseMapView(viewId, viewEventApi, imageRegistry) { - private val _mapView: MapView = MapView(context, mapOptions) + private val _mapView: MapView = MapView(context, mapOptions) - override fun getView(): View { - return _mapView - } - - init { - // Call all of these three lifecycle functions in sequence to fully - // initialize the map view. - _mapView.onCreate(context.applicationInfo.metaData) - _mapView.onStart() - _mapView.onResume() + override fun getView(): View { + return _mapView + } - _mapView.getMapAsync { map -> - setMap(map) - initListeners() - imageRegistry.mapViewInitializationComplete() - mapReady() - invalidateViewAfterMapLoad() - } + init { + // Call all of these three lifecycle functions in sequence to fully + // initialize the map view. + _mapView.onCreate(context.applicationInfo.metaData) + _mapView.onStart() + _mapView.onResume() - viewRegistry.registerMapView(viewId, this) + _mapView.getMapAsync { map -> + setMap(map) + initListeners() + imageRegistry.mapViewInitializationComplete() + mapReady() + invalidateViewAfterMapLoad() } - override fun dispose() { - // When view is disposed, all of these lifecycle functions must be - // called to properly dispose navigation view and prevent leaks. - _mapView.onPause() - _mapView.onStop() - _mapView.onDestroy() + viewRegistry.registerMapView(viewId, this) + } - viewRegistry.unregisterMapView(viewId) - } + override fun dispose() { + // When view is disposed, all of these lifecycle functions must be + // called to properly dispose navigation view and prevent leaks. + _mapView.onPause() + _mapView.onStop() + _mapView.onDestroy() - override fun onStart() { - _mapView.onStart() - } + viewRegistry.unregisterMapView(viewId) + } - override fun onResume() { - _mapView.onResume() - } + override fun onStart() { + _mapView.onStart() + } - override fun onStop() { - _mapView.onStop() - } + override fun onResume() { + _mapView.onResume() + } - override fun onPause() { - _mapView.onPause() - } -} \ No newline at end of file + override fun onStop() { + _mapView.onStop() + } + + override fun onPause() { + _mapView.onPause() + } +} diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt index 098a82b..d992209 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt @@ -25,7 +25,6 @@ import com.google.android.gms.maps.CameraUpdate import com.google.android.gms.maps.CameraUpdateFactory import com.google.android.gms.maps.GoogleMap import com.google.android.gms.maps.GoogleMap.OnMarkerDragListener -import com.google.android.gms.maps.GoogleMapOptions import com.google.android.gms.maps.model.CameraPosition import com.google.android.gms.maps.model.Circle import com.google.android.gms.maps.model.FollowMyLocationOptions @@ -38,815 +37,817 @@ import com.google.android.gms.maps.model.Polyline import com.google.android.libraries.navigation.NavigationView abstract class GoogleMapsBaseMapView( - protected val viewId: Int, - protected val viewEventApi: ViewEventApi, - private val imageRegistry: ImageRegistry + protected val viewId: Int, + protected val viewEventApi: ViewEventApi, + private val imageRegistry: ImageRegistry ) { - companion object { - const val INVALIDATION_FRAME_SKIP_AMOUNT = 4 // Amount of skip frames before invalidation - } - - private val _frameDelayHandler = FrameDelayHandler(INVALIDATION_FRAME_SKIP_AMOUNT) - private var _map: GoogleMap? = null - private val _markers = mutableListOf() - private val _polygons = mutableListOf() - private val _polylines = mutableListOf() - private val _circles = mutableListOf() - - // Nullable variable to hold the callback function - private var _mapReadyCallback: ((Result) -> Unit)? = null - private var _loadedCallbackPending = false - - /// Default values for UI features. - private var _consumeMyLocationButtonClickEventsEnabled: Boolean = false - - abstract fun getView(): View; - abstract fun onStart(); - abstract fun onResume(); - abstract fun onStop(); - abstract fun onPause(); - - // Method to set the _map object - protected fun setMap(map: GoogleMap) { - _map = map - } - - @Throws(FlutterError::class) - protected fun getMap(): GoogleMap { - if (_map != null) { - return _map!! - } else { - throw FlutterError("mapNotFound", "GoogleMap not initialized yet") - } - } - - protected fun mapReady() { - // Call and clear view ready callback if available. - _mapReadyCallback?.let { callback -> - callback(Result.success(Unit)) - _mapReadyCallback = null - } - } - - protected open fun initListeners() { - getMap().setOnMapClickListener { - viewEventApi.onMapClickEvent( - viewId.toLong(), - LatLngDto(it.latitude, it.longitude), - ) {} - } - getMap().setOnMapLongClickListener { - viewEventApi.onMapLongClickEvent( - viewId.toLong(), - LatLngDto(it.latitude, it.longitude), - ) {} - } - getMap().setOnMarkerClickListener { marker -> - val markerId = findMarkerId(marker) - val controller = findMarkerController(markerId) - - sendMarkerEvent(marker, MarkerEventTypeDto.CLICKED) - - // This return value controls the default onClick behaviour, - // return true for default behaviour to occur and false to not. - // Default behavior is for the camera to move to the marker and an info window to - // appear. - controller?.consumeTapEvents ?: false - } - getMap() - .setOnMarkerDragListener( - object : OnMarkerDragListener { - override fun onMarkerDrag(marker: Marker) { - sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAG) - } - - override fun onMarkerDragEnd(marker: Marker) { - sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAGEND) - } - - override fun onMarkerDragStart(marker: Marker) { - sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAGSTART) - } - } - ) - getMap().setOnInfoWindowClickListener { marker -> - sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWCLICKED) - } - getMap().setOnInfoWindowCloseListener { marker -> - try { - sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWCLOSED) - } catch (exception: FlutterError) { - // Google maps trigger this callback if info window is open for marker that is removed. - // As marker and it's information that maps the marker to the markerId is removed, - // [FlutterError] is thrown. In this case info window close event is not sent. - } - } - getMap().setOnInfoWindowLongClickListener { marker -> - sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWLONGCLICKED) - } - - getMap().setOnPolygonClickListener { polygon -> - val polygonId = findPolygonId(polygon) - viewEventApi.onPolygonClicked(viewId.toLong(), polygonId) {} - } - - getMap().setOnPolylineClickListener { polyline -> - val polylineId = findPolylineId(polyline) - viewEventApi.onPolylineClicked(viewId.toLong(), polylineId) {} - } - - getMap().setOnCircleClickListener { circle -> - val circleId = findCircleId(circle) - viewEventApi.onCircleClicked(viewId.toLong(), circleId) {} - } - - getMap().setOnMyLocationClickListener { - viewEventApi.onMyLocationClicked(viewId.toLong()) {} - } - - getMap().setOnMyLocationButtonClickListener { - viewEventApi.onMyLocationButtonClicked(viewId.toLong()) {} - _consumeMyLocationButtonClickEventsEnabled - } - - getMap() - .setOnFollowMyLocationCallback( - object : GoogleMap.OnCameraFollowLocationCallback { - override fun onCameraStartedFollowingLocation() { - viewEventApi.onCameraChanged( - viewId.toLong(), - CameraEventTypeDto.ONCAMERASTARTEDFOLLOWINGLOCATION, - Convert.convertCameraPositionToDto(getMap().cameraPosition) - ) {} - } - - override fun onCameraStoppedFollowingLocation() { - viewEventApi.onCameraChanged( - viewId.toLong(), - CameraEventTypeDto.ONCAMERASTOPPEDFOLLOWINGLOCATION, - Convert.convertCameraPositionToDto(getMap().cameraPosition) - ) {} - } - } - ) - } - - /** - * Workaround for map view not showing added or edited map objects immediately after add/edit. - * Schedules [NavigationView.invalidate] call after a certain amount of frames are drawn. In - * marker updates short delay is not enough, [doubleInvalidate] is set to true. - * - * @param doubleInvalidate if true, schedules another invalidate event after the first one. - */ - protected fun invalidateViewAfterMapLoad(doubleInvalidate: Boolean = false) { - if (_loadedCallbackPending) { - return - } - _loadedCallbackPending = true - getMap().setOnMapLoadedCallback { - _loadedCallbackPending = false - _frameDelayHandler.scheduleActionWithFrameDelay { - getView().invalidate() - if (doubleInvalidate) { - _frameDelayHandler.scheduleActionWithFrameDelay { getView().invalidate() } - } - } - } - } - - @Throws(FlutterError::class) - private fun findMarkerId(marker: Marker): String { - return _markers.find { it.marker == marker }?.markerId - ?: throw FlutterError("markerNotFound", "Could not find the marker.") - } - - @Throws(FlutterError::class) - private fun findMarkerController(markerId: String): MarkerController? { - return _markers.find { it.markerId == markerId } - } - - @Throws(FlutterError::class) - private fun findPolygonId(polygon: Polygon): String { - return _polygons.find { it.polygon == polygon }?.polygonId - ?: throw FlutterError("polygonNotFound", "Could not find the polygon.") - } - - @Throws(FlutterError::class) - private fun findPolylineId(polyline: Polyline): String { - return _polylines.find { it.polyline == polyline }?.polylineId - ?: throw FlutterError("polylineNotFound", "Could not find the polyline.") - } - - @Throws(FlutterError::class) - private fun findCircleId(circle: Circle): String { - return _circles.find { it.circle == circle }?.circleId - ?: throw FlutterError("circleNotFound", "Could not find the circle") - } - - @Throws(FlutterError::class) - private fun findPolygonController(polygonId: String): PolygonController? { - return _polygons.find { it.polygonId == polygonId } - } - - @Throws(FlutterError::class) - private fun findPolylineController(polylineId: String): PolylineController? { - return _polylines.find { it.polylineId == polylineId } - } - - @Throws(FlutterError::class) - private fun findCircleController(circleId: String): CircleController? { - return _circles.find { it.circleId == circleId } - } - - @Throws(FlutterError::class) - private fun sendMarkerEvent(marker: Marker, eventType: MarkerEventTypeDto) { - val markerId = findMarkerId(marker) - viewEventApi.onMarkerEvent(viewId.toLong(), markerId, eventType) {} - } - - @Throws(FlutterError::class) - private fun sendMarkerDragEvent(marker: Marker, eventType: MarkerDragEventTypeDto) { - val markerId = findMarkerId(marker) - viewEventApi.onMarkerDragEvent( - viewId.toLong(), - markerId, - eventType, - LatLngDto(marker.position.latitude, marker.position.longitude) - ) {} - } - - fun isMyLocationEnabled(): Boolean { - return getMap().isMyLocationEnabled - } - - @SuppressLint("MissingPermission") - fun setMyLocationEnabled(enabled: Boolean) { - invalidateViewAfterMapLoad() - getMap().isMyLocationEnabled = enabled - } - - fun setMyLocationButtonEnabled(enabled: Boolean) { - invalidateViewAfterMapLoad() - getMap().uiSettings.isMyLocationButtonEnabled = enabled - } - - fun setZoomGesturesEnabled(enabled: Boolean) { - invalidateViewAfterMapLoad() - getMap().uiSettings.isZoomGesturesEnabled = enabled - } - - fun setZoomControlsEnabled(enabled: Boolean) { - invalidateViewAfterMapLoad() - getMap().uiSettings.isZoomControlsEnabled = enabled - } - - fun setCompassEnabled(enabled: Boolean) { - invalidateViewAfterMapLoad() - getMap().uiSettings.isCompassEnabled = enabled - } - - fun setRotateGesturesEnabled(enabled: Boolean) { - getMap().uiSettings.isRotateGesturesEnabled = enabled - } - - fun setScrollGesturesEnabled(enabled: Boolean) { - getMap().uiSettings.isScrollGesturesEnabled = enabled - } - - fun setScrollGesturesDuringRotateOrZoomEnabled(enabled: Boolean) { - getMap().uiSettings.isScrollGesturesEnabledDuringRotateOrZoom = enabled - } - - fun setTiltGesturesEnabled(enabled: Boolean) { - getMap().uiSettings.isTiltGesturesEnabled = enabled - } - - fun setMapToolbarEnabled(enabled: Boolean) { - getMap().uiSettings.isMapToolbarEnabled = enabled - } - - fun setTrafficEnabled(enabled: Boolean) { - getMap().isTrafficEnabled = enabled - } - - fun isMyLocationButtonEnabled(): Boolean { - return getMap().uiSettings.isMyLocationButtonEnabled - } - - fun isZoomGesturesEnabled(): Boolean { - return getMap().uiSettings.isZoomGesturesEnabled - } - - fun isZoomControlsEnabled(): Boolean { - return getMap().uiSettings.isZoomControlsEnabled - } - - fun isCompassEnabled(): Boolean { - return getMap().uiSettings.isCompassEnabled - } - - fun isRotateGesturesEnabled(): Boolean { - return getMap().uiSettings.isRotateGesturesEnabled - } - - fun isScrollGesturesEnabled(): Boolean { - return getMap().uiSettings.isScrollGesturesEnabled - } - - fun isScrollGesturesEnabledDuringRotateOrZoom(): Boolean { - return getMap().uiSettings.isScrollGesturesEnabledDuringRotateOrZoom - } - - fun isTiltGesturesEnabled(): Boolean { - return getMap().uiSettings.isTiltGesturesEnabled - } - - fun isMapToolbarEnabled(): Boolean { - return getMap().uiSettings.isMapToolbarEnabled - } - - fun isTrafficEnabled(): Boolean { - return getMap().isTrafficEnabled - } - - fun getMyLocation(): Location? { - // Remove this functionality and either guide users to use separate flutter - // library for geolocation or implement separate method under - // [GoogleMapsNavigationSessionManager] to fetch the location - // using the [FusedLocationProviderApi]. - @Suppress("DEPRECATION") return getMap().myLocation - } + companion object { + const val INVALIDATION_FRAME_SKIP_AMOUNT = 4 // Amount of skip frames before invalidation + } + + private val _frameDelayHandler = FrameDelayHandler(INVALIDATION_FRAME_SKIP_AMOUNT) + private var _map: GoogleMap? = null + private val _markers = mutableListOf() + private val _polygons = mutableListOf() + private val _polylines = mutableListOf() + private val _circles = mutableListOf() - fun getCameraPosition(): CameraPosition { - return getMap().cameraPosition ?: CameraPosition(LatLng(0.0, 0.0), 0.0F, 0.0F, 0.0F) - } + // Nullable variable to hold the callback function + private var _mapReadyCallback: ((Result) -> Unit)? = null + private var _loadedCallbackPending = false - fun getVisibleRegion(): LatLngBounds { - return getMap().projection.visibleRegion.latLngBounds - } + /// Default values for UI features. + private var _consumeMyLocationButtonClickEventsEnabled: Boolean = false - private fun getMapCallback(callback: (Result) -> Unit): GoogleMap.CancelableCallback { - return object : GoogleMap.CancelableCallback { - override fun onFinish() { - callback(Result.success(true)) - } + abstract fun getView(): View - override fun onCancel() { - callback(Result.success(false)) - } - } - } + abstract fun onStart() - private fun animateCamera( - cameraUpdate: CameraUpdate, - duration: Long?, - callback: (Result) -> Unit - ) { - // Native animateCamera() doesn't allow setting null duration so need to do two calls - if (duration == null) { - getMap().animateCamera(cameraUpdate, getMapCallback(callback)) - } else { - getMap().animateCamera(cameraUpdate, duration.toInt(), getMapCallback(callback)) - } - } + abstract fun onResume() - fun animateCameraToCameraPosition( - cameraPosition: CameraPosition, - duration: Long?, - callback: (Result) -> Unit - ) { - animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), duration, callback) - } + abstract fun onStop() - fun animateCameraToLatLng(point: LatLng, duration: Long?, callback: (Result) -> Unit) { - animateCamera(CameraUpdateFactory.newLatLng(point), duration, callback) - } + abstract fun onPause() - fun animateCameraToLatLngBounds( - bounds: LatLngBounds, - padding: Double, - duration: Long?, - callback: (Result) -> Unit - ) { - animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding.toInt()), duration, callback) - } + // Method to set the _map object + protected fun setMap(map: GoogleMap) { + _map = map + } - fun animateCameraToLatLngZoom( - point: LatLng, - zoom: Double, - duration: Long?, - callback: (Result) -> Unit - ) { - animateCamera(CameraUpdateFactory.newLatLngZoom(point, zoom.toFloat()), duration, callback) + @Throws(FlutterError::class) + protected fun getMap(): GoogleMap { + if (_map != null) { + return _map!! + } else { + throw FlutterError("mapNotFound", "GoogleMap not initialized yet") } + } - fun animateCameraByScroll( - scrollByDx: Double, - scrollByDy: Double, - duration: Long?, - callback: (Result) -> Unit - ) { - animateCamera( - CameraUpdateFactory.scrollBy(scrollByDx.toFloat(), scrollByDy.toFloat()), - duration, - callback - ) + protected fun mapReady() { + // Call and clear view ready callback if available. + _mapReadyCallback?.let { callback -> + callback(Result.success(Unit)) + _mapReadyCallback = null } + } - fun animateCameraByZoom( - zoomBy: Double, - focus: Point?, - duration: Long?, - callback: (Result) -> Unit - ) { - // Native animateCamera() doesn't allow setting null duration or focus so need to split to - // multiple calls - val cameraUpdate = - if (focus != null) { - CameraUpdateFactory.zoomBy(zoomBy.toFloat(), focus) - } else { - CameraUpdateFactory.zoomBy(zoomBy.toFloat()) - } - animateCamera(cameraUpdate, duration, callback) + protected open fun initListeners() { + getMap().setOnMapClickListener { + viewEventApi.onMapClickEvent( + viewId.toLong(), + LatLngDto(it.latitude, it.longitude), + ) {} } - - fun animateCameraToZoom(zoom: Double, duration: Long?, callback: (Result) -> Unit) { - animateCamera(CameraUpdateFactory.zoomTo(zoom.toFloat()), duration, callback) + getMap().setOnMapLongClickListener { + viewEventApi.onMapLongClickEvent( + viewId.toLong(), + LatLngDto(it.latitude, it.longitude), + ) {} } + getMap().setOnMarkerClickListener { marker -> + val markerId = findMarkerId(marker) + val controller = findMarkerController(markerId) - fun moveCameraToCameraPosition(cameraPosition: CameraPosition) { - return getMap().moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) - } - - fun moveCameraToLatLng(point: LatLng) { - return getMap().moveCamera(CameraUpdateFactory.newLatLng(point)) - } - - fun moveCameraToLatLngBounds(bounds: LatLngBounds, padding: Double) { - return getMap().moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding.toInt())) - } + sendMarkerEvent(marker, MarkerEventTypeDto.CLICKED) - fun moveCameraToLatLngZoom(point: LatLng, zoom: Double) { - return getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(point, zoom.toFloat())) + // This return value controls the default onClick behaviour, + // return true for default behaviour to occur and false to not. + // Default behavior is for the camera to move to the marker and an info window to + // appear. + controller?.consumeTapEvents ?: false } + getMap() + .setOnMarkerDragListener( + object : OnMarkerDragListener { + override fun onMarkerDrag(marker: Marker) { + sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAG) + } - fun moveCameraByScroll(scrollByDx: Double, scrollByDy: Double) { - return getMap() - .moveCamera(CameraUpdateFactory.scrollBy(scrollByDx.toFloat(), scrollByDy.toFloat())) - } + override fun onMarkerDragEnd(marker: Marker) { + sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAGEND) + } - fun moveCameraByZoom(zoomBy: Double, focus: Point?) { - if (focus != null) { - getMap().moveCamera(CameraUpdateFactory.zoomBy(zoomBy.toFloat(), focus)) - } else { - getMap().moveCamera(CameraUpdateFactory.zoomBy(zoomBy.toFloat())) + override fun onMarkerDragStart(marker: Marker) { + sendMarkerDragEvent(marker, MarkerDragEventTypeDto.DRAGSTART) + } } + ) + getMap().setOnInfoWindowClickListener { marker -> + sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWCLICKED) } - - fun moveCameraToZoom(zoom: Double) { - return getMap().moveCamera(CameraUpdateFactory.zoomTo(zoom.toFloat())) + getMap().setOnInfoWindowCloseListener { marker -> + try { + sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWCLOSED) + } catch (exception: FlutterError) { + // Google maps trigger this callback if info window is open for marker that is removed. + // As marker and it's information that maps the marker to the markerId is removed, + // [FlutterError] is thrown. In this case info window close event is not sent. + } } - - fun getMapType(): Int { - return getMap().mapType + getMap().setOnInfoWindowLongClickListener { marker -> + sendMarkerEvent(marker, MarkerEventTypeDto.INFOWINDOWLONGCLICKED) } - fun setMapType(mapType: Int) { - invalidateViewAfterMapLoad() - getMap().mapType = mapType + getMap().setOnPolygonClickListener { polygon -> + val polygonId = findPolygonId(polygon) + viewEventApi.onPolygonClicked(viewId.toLong(), polygonId) {} } - fun setMapStyle(styleJson: String) { - invalidateViewAfterMapLoad() - if (!getMap().setMapStyle(MapStyleOptions(styleJson))) { - throw FlutterError("mapStyleError", "Failed to set map style") - } + getMap().setOnPolylineClickListener { polyline -> + val polylineId = findPolylineId(polyline) + viewEventApi.onPolylineClicked(viewId.toLong(), polylineId) {} } - @SuppressLint("MissingPermission") - fun followMyLocation(perspective: Int, zoomLevel: Double?) { - invalidateViewAfterMapLoad() - getMap().followMyLocation(perspective) - if (zoomLevel != null) { - val options: FollowMyLocationOptions = - FollowMyLocationOptions.builder().setZoomLevel(zoomLevel.toFloat()).build() - getMap().followMyLocation(perspective, options) - } else { - getMap().followMyLocation(perspective) - } + getMap().setOnCircleClickListener { circle -> + val circleId = findCircleId(circle) + viewEventApi.onCircleClicked(viewId.toLong(), circleId) {} } - fun awaitMapReady(callback: (Result) -> Unit) { - if (_map != null) { - // Call the callback immediately as the map is already initialized - callback(Result.success(Unit)) - } else if (_mapReadyCallback != null) { - // If there is already a callback pending, throw an error to avoid overriding it - callback( - Result.failure( - FlutterError( - "mapReadyCallbackAlreadyPending", - "A callback is already pending and cannot be overridden." - ) - ) - ) - } else { - // Save the callback to be called once the map is initialized - _mapReadyCallback = callback - } - } + getMap().setOnMyLocationClickListener { viewEventApi.onMyLocationClicked(viewId.toLong()) {} } - fun setConsumeMyLocationButtonClickEventsEnabled(enabled: Boolean) { - _consumeMyLocationButtonClickEventsEnabled = enabled - } - - fun isConsumeMyLocationButtonClickEventsEnabled(): Boolean { - return _consumeMyLocationButtonClickEventsEnabled - } - - fun getMarkers(): List { - return _markers.map { MarkerDto(it.markerId, Convert.markerControllerToMarkerOptions(it)) } - } - - fun addMarkers(markers: List): List { - val result = mutableListOf() - markers.forEach { - val builder = MarkerBuilder() - Convert.sinkMarkerOptions(it.options, builder, imageRegistry) - val options = builder.build() - val marker = getMap().addMarker(options) - if (marker != null) { - val registeredImage = - it.options.icon.registeredImageId?.let { id -> imageRegistry.findRegisteredImage(id) } - val controller = - MarkerController( - marker, - it.markerId, - builder.consumeTapEvents, - it.options.anchor.u.toFloat(), - it.options.anchor.v.toFloat(), - it.options.infoWindow.anchor.u.toFloat(), - it.options.infoWindow.anchor.v.toFloat(), - registeredImage - ) - _markers.add(controller) - result.add(it) - } - } - // Double invalidate map view. Marker icon updates seem to take extra - // time and some times icon did not update properly after single invalidate. - invalidateViewAfterMapLoad(true) - return result - } - - @Throws(FlutterError::class) - fun updateMarkers(markers: List): List { - val result = mutableListOf() - var error: Throwable? = null - markers.forEach { - findMarkerController(it.markerId)?.let { controller -> - Convert.sinkMarkerOptions(it.options, controller, imageRegistry) - result.add(it) - } - ?: run { - error = FlutterError("markerNotFound", "Failed to update marker with id ${it.markerId}") - } - } - error?.let { throw error as Throwable } - // Double invalidate map view. Marker icon updates seem to take extra - // time and some times icon did not update properly after single invalidate. - invalidateViewAfterMapLoad(true) - return result - } - - @Throws(FlutterError::class) - fun removeMarkers(markers: List) { - invalidateViewAfterMapLoad() - var error: Throwable? = null - markers.forEach { - findMarkerController(it.markerId)?.let { controller -> - controller.remove() - _markers.remove(controller) - } - ?: run { - error = FlutterError("markerNotFound", "Failed to remove marker with id ${it.markerId}") - } - } - error?.let { throw error as Throwable } - } - - fun clearMarkers() { - invalidateViewAfterMapLoad() - _markers.forEach { controller -> controller.remove() } - _markers.clear() - } - - fun clear() { - getMap().clear() - _markers.clear() - _polygons.clear() - _polylines.clear() - _circles.clear() - } - - fun getPolygons(): List { - val density = Resources.getSystem().displayMetrics.density - return _polygons.map { - PolygonDto(it.polygonId, Convert.polygonToPolygonOptions(it.polygon, density)) - } - } - - fun addPolygons( - polygons: List, - ): List { - val density = Resources.getSystem().displayMetrics.density - invalidateViewAfterMapLoad() - val result = mutableListOf() - polygons.forEach { - val builder = PolygonBuilder() - Convert.sinkPolygonOptions(it.options, builder, density) - val options = builder.build() - val polygon = getMap().addPolygon(options) - if (polygon != null) { - val controller = PolygonController(polygon, it.polygonId) - _polygons.add(controller) - result.add(it) - } - } - return result - } - - fun updatePolygons(polygons: List): List { - invalidateViewAfterMapLoad() - var error: Throwable? = null - val result = mutableListOf() - val density = Resources.getSystem().displayMetrics.density - polygons.forEach { - findPolygonController(it.polygonId)?.let { controller -> - Convert.sinkPolygonOptions(it.options, controller, density) - result.add(it) - } - ?: run { - error = - FlutterError("polygonNotFound", "Failed to update polygon with id ${it.polygonId}") - } - } - error?.let { throw error as Throwable } - - return result - } - - fun removePolygons(polygons: List) { - invalidateViewAfterMapLoad() - var error: Throwable? = null - polygons.forEach { - findPolygonController(it.polygonId)?.let { controller -> - controller.remove() - _polygons.remove(controller) - } - ?: run { - error = - FlutterError("polygonNotFound", "Failed to remove polygon with id ${it.polygonId}") - } - } - error?.let { throw error as Throwable } - } - - fun clearPolygons() { - invalidateViewAfterMapLoad() - _polygons.forEach { controller -> controller.remove() } - _polygons.clear() - } - - fun getPolylines(): List { - val density = Resources.getSystem().displayMetrics.density - return _polylines.map { - PolylineDto(it.polylineId, Convert.polylineToPolylineOptions(it.polyline, density)) - } - } - - fun addPolylines( - polylines: List, - ): List { - val density = Resources.getSystem().displayMetrics.density - invalidateViewAfterMapLoad() - val result = mutableListOf() - polylines.forEach { - val builder = PolylineBuilder() - Convert.sinkPolylineOptions(it.options, builder, density) - val options = builder.build() - val polyline = getMap().addPolyline(options) - if (polyline != null) { - val controller = PolylineController(polyline, it.polylineId) - _polylines.add(controller) - result.add(it) - } - } - return result - } - - fun updatePolylines(polylines: List): List { - var error: Throwable? = null - val density = Resources.getSystem().displayMetrics.density - invalidateViewAfterMapLoad() - val result = mutableListOf() - polylines.forEach { - findPolylineController(it.polylineId)?.let { controller -> - Convert.sinkPolylineOptions(it.options, controller, density) - result.add(it) - } - ?: run { - error = - FlutterError("polylineNotFound", "Failed to update polyline with id ${it.polylineId}") - } - } - error?.let { throw error as Throwable } - return result - } - - fun removePolylines(polylines: List) { - invalidateViewAfterMapLoad() - var error: Throwable? = null - polylines.forEach { - findPolylineController(it.polylineId)?.let { controller -> - controller.remove() - _polylines.remove(controller) - } - ?: run { - error = - FlutterError("polylineNotFound", "Failed to remove polyline with id ${it.polylineId}") - } - } - error?.let { throw error as Throwable } - } - - fun clearPolylines() { - invalidateViewAfterMapLoad() - _polylines.forEach { controller -> controller.remove() } - _polylines.clear() - } - - fun getCircles(): List { - val density = Resources.getSystem().displayMetrics.density - return _circles.map { - CircleDto(it.circleId, Convert.circleToCircleOptions(it.circle, density)) - } - } - - fun addCircles(circles: List): List { - val density = Resources.getSystem().displayMetrics.density - invalidateViewAfterMapLoad() - val result = mutableListOf() - circles.forEach { - val builder = CircleBuilder() - Convert.sinkCircleOptions(it.options, builder, density) - val options = builder.build() - val circle = getMap().addCircle(options) - if (circle != null) { - val controller = CircleController(circle, it.circleId) - _circles.add(controller) - result.add(it) - } - } - return result - } - - fun updateCircles(circles: List): List { - val density = Resources.getSystem().displayMetrics.density - invalidateViewAfterMapLoad() - val result = mutableListOf() - var error: Throwable? = null - circles.forEach { - findCircleController(it.circleId)?.let { controller -> - Convert.sinkCircleOptions(it.options, controller, density) - result.add(it) - } - ?: run { - error = FlutterError("circleNotFound", "Failed to update circle with id ${it.circleId}") - } - } - error?.let { throw error as Throwable } - return result - } - - fun removeCircles(circles: List) { - invalidateViewAfterMapLoad() - var error: Throwable? = null - circles.forEach { - findCircleController(it.circleId)?.let { controller -> - controller.remove() - _circles.remove(controller) - } - ?: run { - error = FlutterError("circleNotFound", "Failed to remove circle with id ${it.circleId}") - } - } - error?.let { throw error as Throwable } + getMap().setOnMyLocationButtonClickListener { + viewEventApi.onMyLocationButtonClicked(viewId.toLong()) {} + _consumeMyLocationButtonClickEventsEnabled } - fun clearCircles() { - invalidateViewAfterMapLoad() - _circles.forEach { controller -> controller.remove() } - _circles.clear() - } -} \ No newline at end of file + getMap() + .setOnFollowMyLocationCallback( + object : GoogleMap.OnCameraFollowLocationCallback { + override fun onCameraStartedFollowingLocation() { + viewEventApi.onCameraChanged( + viewId.toLong(), + CameraEventTypeDto.ONCAMERASTARTEDFOLLOWINGLOCATION, + Convert.convertCameraPositionToDto(getMap().cameraPosition) + ) {} + } + + override fun onCameraStoppedFollowingLocation() { + viewEventApi.onCameraChanged( + viewId.toLong(), + CameraEventTypeDto.ONCAMERASTOPPEDFOLLOWINGLOCATION, + Convert.convertCameraPositionToDto(getMap().cameraPosition) + ) {} + } + } + ) + } + + /** + * Workaround for map view not showing added or edited map objects immediately after add/edit. + * Schedules [NavigationView.invalidate] call after a certain amount of frames are drawn. In + * marker updates short delay is not enough, [doubleInvalidate] is set to true. + * + * @param doubleInvalidate if true, schedules another invalidate event after the first one. + */ + protected fun invalidateViewAfterMapLoad(doubleInvalidate: Boolean = false) { + if (_loadedCallbackPending) { + return + } + _loadedCallbackPending = true + getMap().setOnMapLoadedCallback { + _loadedCallbackPending = false + _frameDelayHandler.scheduleActionWithFrameDelay { + getView().invalidate() + if (doubleInvalidate) { + _frameDelayHandler.scheduleActionWithFrameDelay { getView().invalidate() } + } + } + } + } + + @Throws(FlutterError::class) + private fun findMarkerId(marker: Marker): String { + return _markers.find { it.marker == marker }?.markerId + ?: throw FlutterError("markerNotFound", "Could not find the marker.") + } + + @Throws(FlutterError::class) + private fun findMarkerController(markerId: String): MarkerController? { + return _markers.find { it.markerId == markerId } + } + + @Throws(FlutterError::class) + private fun findPolygonId(polygon: Polygon): String { + return _polygons.find { it.polygon == polygon }?.polygonId + ?: throw FlutterError("polygonNotFound", "Could not find the polygon.") + } + + @Throws(FlutterError::class) + private fun findPolylineId(polyline: Polyline): String { + return _polylines.find { it.polyline == polyline }?.polylineId + ?: throw FlutterError("polylineNotFound", "Could not find the polyline.") + } + + @Throws(FlutterError::class) + private fun findCircleId(circle: Circle): String { + return _circles.find { it.circle == circle }?.circleId + ?: throw FlutterError("circleNotFound", "Could not find the circle") + } + + @Throws(FlutterError::class) + private fun findPolygonController(polygonId: String): PolygonController? { + return _polygons.find { it.polygonId == polygonId } + } + + @Throws(FlutterError::class) + private fun findPolylineController(polylineId: String): PolylineController? { + return _polylines.find { it.polylineId == polylineId } + } + + @Throws(FlutterError::class) + private fun findCircleController(circleId: String): CircleController? { + return _circles.find { it.circleId == circleId } + } + + @Throws(FlutterError::class) + private fun sendMarkerEvent(marker: Marker, eventType: MarkerEventTypeDto) { + val markerId = findMarkerId(marker) + viewEventApi.onMarkerEvent(viewId.toLong(), markerId, eventType) {} + } + + @Throws(FlutterError::class) + private fun sendMarkerDragEvent(marker: Marker, eventType: MarkerDragEventTypeDto) { + val markerId = findMarkerId(marker) + viewEventApi.onMarkerDragEvent( + viewId.toLong(), + markerId, + eventType, + LatLngDto(marker.position.latitude, marker.position.longitude) + ) {} + } + + fun isMyLocationEnabled(): Boolean { + return getMap().isMyLocationEnabled + } + + @SuppressLint("MissingPermission") + fun setMyLocationEnabled(enabled: Boolean) { + invalidateViewAfterMapLoad() + getMap().isMyLocationEnabled = enabled + } + + fun setMyLocationButtonEnabled(enabled: Boolean) { + invalidateViewAfterMapLoad() + getMap().uiSettings.isMyLocationButtonEnabled = enabled + } + + fun setZoomGesturesEnabled(enabled: Boolean) { + invalidateViewAfterMapLoad() + getMap().uiSettings.isZoomGesturesEnabled = enabled + } + + fun setZoomControlsEnabled(enabled: Boolean) { + invalidateViewAfterMapLoad() + getMap().uiSettings.isZoomControlsEnabled = enabled + } + + fun setCompassEnabled(enabled: Boolean) { + invalidateViewAfterMapLoad() + getMap().uiSettings.isCompassEnabled = enabled + } + + fun setRotateGesturesEnabled(enabled: Boolean) { + getMap().uiSettings.isRotateGesturesEnabled = enabled + } + + fun setScrollGesturesEnabled(enabled: Boolean) { + getMap().uiSettings.isScrollGesturesEnabled = enabled + } + + fun setScrollGesturesDuringRotateOrZoomEnabled(enabled: Boolean) { + getMap().uiSettings.isScrollGesturesEnabledDuringRotateOrZoom = enabled + } + + fun setTiltGesturesEnabled(enabled: Boolean) { + getMap().uiSettings.isTiltGesturesEnabled = enabled + } + + fun setMapToolbarEnabled(enabled: Boolean) { + getMap().uiSettings.isMapToolbarEnabled = enabled + } + + fun setTrafficEnabled(enabled: Boolean) { + getMap().isTrafficEnabled = enabled + } + + fun isMyLocationButtonEnabled(): Boolean { + return getMap().uiSettings.isMyLocationButtonEnabled + } + + fun isZoomGesturesEnabled(): Boolean { + return getMap().uiSettings.isZoomGesturesEnabled + } + + fun isZoomControlsEnabled(): Boolean { + return getMap().uiSettings.isZoomControlsEnabled + } + + fun isCompassEnabled(): Boolean { + return getMap().uiSettings.isCompassEnabled + } + + fun isRotateGesturesEnabled(): Boolean { + return getMap().uiSettings.isRotateGesturesEnabled + } + + fun isScrollGesturesEnabled(): Boolean { + return getMap().uiSettings.isScrollGesturesEnabled + } + + fun isScrollGesturesEnabledDuringRotateOrZoom(): Boolean { + return getMap().uiSettings.isScrollGesturesEnabledDuringRotateOrZoom + } + + fun isTiltGesturesEnabled(): Boolean { + return getMap().uiSettings.isTiltGesturesEnabled + } + + fun isMapToolbarEnabled(): Boolean { + return getMap().uiSettings.isMapToolbarEnabled + } + + fun isTrafficEnabled(): Boolean { + return getMap().isTrafficEnabled + } + + fun getMyLocation(): Location? { + // Remove this functionality and either guide users to use separate flutter + // library for geolocation or implement separate method under + // [GoogleMapsNavigationSessionManager] to fetch the location + // using the [FusedLocationProviderApi]. + @Suppress("DEPRECATION") return getMap().myLocation + } + + fun getCameraPosition(): CameraPosition { + return getMap().cameraPosition ?: CameraPosition(LatLng(0.0, 0.0), 0.0F, 0.0F, 0.0F) + } + + fun getVisibleRegion(): LatLngBounds { + return getMap().projection.visibleRegion.latLngBounds + } + + private fun getMapCallback(callback: (Result) -> Unit): GoogleMap.CancelableCallback { + return object : GoogleMap.CancelableCallback { + override fun onFinish() { + callback(Result.success(true)) + } + + override fun onCancel() { + callback(Result.success(false)) + } + } + } + + private fun animateCamera( + cameraUpdate: CameraUpdate, + duration: Long?, + callback: (Result) -> Unit + ) { + // Native animateCamera() doesn't allow setting null duration so need to do two calls + if (duration == null) { + getMap().animateCamera(cameraUpdate, getMapCallback(callback)) + } else { + getMap().animateCamera(cameraUpdate, duration.toInt(), getMapCallback(callback)) + } + } + + fun animateCameraToCameraPosition( + cameraPosition: CameraPosition, + duration: Long?, + callback: (Result) -> Unit + ) { + animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), duration, callback) + } + + fun animateCameraToLatLng(point: LatLng, duration: Long?, callback: (Result) -> Unit) { + animateCamera(CameraUpdateFactory.newLatLng(point), duration, callback) + } + + fun animateCameraToLatLngBounds( + bounds: LatLngBounds, + padding: Double, + duration: Long?, + callback: (Result) -> Unit + ) { + animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding.toInt()), duration, callback) + } + + fun animateCameraToLatLngZoom( + point: LatLng, + zoom: Double, + duration: Long?, + callback: (Result) -> Unit + ) { + animateCamera(CameraUpdateFactory.newLatLngZoom(point, zoom.toFloat()), duration, callback) + } + + fun animateCameraByScroll( + scrollByDx: Double, + scrollByDy: Double, + duration: Long?, + callback: (Result) -> Unit + ) { + animateCamera( + CameraUpdateFactory.scrollBy(scrollByDx.toFloat(), scrollByDy.toFloat()), + duration, + callback + ) + } + + fun animateCameraByZoom( + zoomBy: Double, + focus: Point?, + duration: Long?, + callback: (Result) -> Unit + ) { + // Native animateCamera() doesn't allow setting null duration or focus so need to split to + // multiple calls + val cameraUpdate = + if (focus != null) { + CameraUpdateFactory.zoomBy(zoomBy.toFloat(), focus) + } else { + CameraUpdateFactory.zoomBy(zoomBy.toFloat()) + } + animateCamera(cameraUpdate, duration, callback) + } + + fun animateCameraToZoom(zoom: Double, duration: Long?, callback: (Result) -> Unit) { + animateCamera(CameraUpdateFactory.zoomTo(zoom.toFloat()), duration, callback) + } + + fun moveCameraToCameraPosition(cameraPosition: CameraPosition) { + return getMap().moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) + } + + fun moveCameraToLatLng(point: LatLng) { + return getMap().moveCamera(CameraUpdateFactory.newLatLng(point)) + } + + fun moveCameraToLatLngBounds(bounds: LatLngBounds, padding: Double) { + return getMap().moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding.toInt())) + } + + fun moveCameraToLatLngZoom(point: LatLng, zoom: Double) { + return getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(point, zoom.toFloat())) + } + + fun moveCameraByScroll(scrollByDx: Double, scrollByDy: Double) { + return getMap() + .moveCamera(CameraUpdateFactory.scrollBy(scrollByDx.toFloat(), scrollByDy.toFloat())) + } + + fun moveCameraByZoom(zoomBy: Double, focus: Point?) { + if (focus != null) { + getMap().moveCamera(CameraUpdateFactory.zoomBy(zoomBy.toFloat(), focus)) + } else { + getMap().moveCamera(CameraUpdateFactory.zoomBy(zoomBy.toFloat())) + } + } + + fun moveCameraToZoom(zoom: Double) { + return getMap().moveCamera(CameraUpdateFactory.zoomTo(zoom.toFloat())) + } + + fun getMapType(): Int { + return getMap().mapType + } + + fun setMapType(mapType: Int) { + invalidateViewAfterMapLoad() + getMap().mapType = mapType + } + + fun setMapStyle(styleJson: String) { + invalidateViewAfterMapLoad() + if (!getMap().setMapStyle(MapStyleOptions(styleJson))) { + throw FlutterError("mapStyleError", "Failed to set map style") + } + } + + @SuppressLint("MissingPermission") + fun followMyLocation(perspective: Int, zoomLevel: Double?) { + invalidateViewAfterMapLoad() + getMap().followMyLocation(perspective) + if (zoomLevel != null) { + val options: FollowMyLocationOptions = + FollowMyLocationOptions.builder().setZoomLevel(zoomLevel.toFloat()).build() + getMap().followMyLocation(perspective, options) + } else { + getMap().followMyLocation(perspective) + } + } + + fun awaitMapReady(callback: (Result) -> Unit) { + if (_map != null) { + // Call the callback immediately as the map is already initialized + callback(Result.success(Unit)) + } else if (_mapReadyCallback != null) { + // If there is already a callback pending, throw an error to avoid overriding it + callback( + Result.failure( + FlutterError( + "mapReadyCallbackAlreadyPending", + "A callback is already pending and cannot be overridden." + ) + ) + ) + } else { + // Save the callback to be called once the map is initialized + _mapReadyCallback = callback + } + } + + fun setConsumeMyLocationButtonClickEventsEnabled(enabled: Boolean) { + _consumeMyLocationButtonClickEventsEnabled = enabled + } + + fun isConsumeMyLocationButtonClickEventsEnabled(): Boolean { + return _consumeMyLocationButtonClickEventsEnabled + } + + fun getMarkers(): List { + return _markers.map { MarkerDto(it.markerId, Convert.markerControllerToMarkerOptions(it)) } + } + + fun addMarkers(markers: List): List { + val result = mutableListOf() + markers.forEach { + val builder = MarkerBuilder() + Convert.sinkMarkerOptions(it.options, builder, imageRegistry) + val options = builder.build() + val marker = getMap().addMarker(options) + if (marker != null) { + val registeredImage = + it.options.icon.registeredImageId?.let { id -> imageRegistry.findRegisteredImage(id) } + val controller = + MarkerController( + marker, + it.markerId, + builder.consumeTapEvents, + it.options.anchor.u.toFloat(), + it.options.anchor.v.toFloat(), + it.options.infoWindow.anchor.u.toFloat(), + it.options.infoWindow.anchor.v.toFloat(), + registeredImage + ) + _markers.add(controller) + result.add(it) + } + } + // Double invalidate map view. Marker icon updates seem to take extra + // time and some times icon did not update properly after single invalidate. + invalidateViewAfterMapLoad(true) + return result + } + + @Throws(FlutterError::class) + fun updateMarkers(markers: List): List { + val result = mutableListOf() + var error: Throwable? = null + markers.forEach { + findMarkerController(it.markerId)?.let { controller -> + Convert.sinkMarkerOptions(it.options, controller, imageRegistry) + result.add(it) + } + ?: run { + error = FlutterError("markerNotFound", "Failed to update marker with id ${it.markerId}") + } + } + error?.let { throw error as Throwable } + // Double invalidate map view. Marker icon updates seem to take extra + // time and some times icon did not update properly after single invalidate. + invalidateViewAfterMapLoad(true) + return result + } + + @Throws(FlutterError::class) + fun removeMarkers(markers: List) { + invalidateViewAfterMapLoad() + var error: Throwable? = null + markers.forEach { + findMarkerController(it.markerId)?.let { controller -> + controller.remove() + _markers.remove(controller) + } + ?: run { + error = FlutterError("markerNotFound", "Failed to remove marker with id ${it.markerId}") + } + } + error?.let { throw error as Throwable } + } + + fun clearMarkers() { + invalidateViewAfterMapLoad() + _markers.forEach { controller -> controller.remove() } + _markers.clear() + } + + fun clear() { + getMap().clear() + _markers.clear() + _polygons.clear() + _polylines.clear() + _circles.clear() + } + + fun getPolygons(): List { + val density = Resources.getSystem().displayMetrics.density + return _polygons.map { + PolygonDto(it.polygonId, Convert.polygonToPolygonOptions(it.polygon, density)) + } + } + + fun addPolygons( + polygons: List, + ): List { + val density = Resources.getSystem().displayMetrics.density + invalidateViewAfterMapLoad() + val result = mutableListOf() + polygons.forEach { + val builder = PolygonBuilder() + Convert.sinkPolygonOptions(it.options, builder, density) + val options = builder.build() + val polygon = getMap().addPolygon(options) + if (polygon != null) { + val controller = PolygonController(polygon, it.polygonId) + _polygons.add(controller) + result.add(it) + } + } + return result + } + + fun updatePolygons(polygons: List): List { + invalidateViewAfterMapLoad() + var error: Throwable? = null + val result = mutableListOf() + val density = Resources.getSystem().displayMetrics.density + polygons.forEach { + findPolygonController(it.polygonId)?.let { controller -> + Convert.sinkPolygonOptions(it.options, controller, density) + result.add(it) + } + ?: run { + error = + FlutterError("polygonNotFound", "Failed to update polygon with id ${it.polygonId}") + } + } + error?.let { throw error as Throwable } + + return result + } + + fun removePolygons(polygons: List) { + invalidateViewAfterMapLoad() + var error: Throwable? = null + polygons.forEach { + findPolygonController(it.polygonId)?.let { controller -> + controller.remove() + _polygons.remove(controller) + } + ?: run { + error = + FlutterError("polygonNotFound", "Failed to remove polygon with id ${it.polygonId}") + } + } + error?.let { throw error as Throwable } + } + + fun clearPolygons() { + invalidateViewAfterMapLoad() + _polygons.forEach { controller -> controller.remove() } + _polygons.clear() + } + + fun getPolylines(): List { + val density = Resources.getSystem().displayMetrics.density + return _polylines.map { + PolylineDto(it.polylineId, Convert.polylineToPolylineOptions(it.polyline, density)) + } + } + + fun addPolylines( + polylines: List, + ): List { + val density = Resources.getSystem().displayMetrics.density + invalidateViewAfterMapLoad() + val result = mutableListOf() + polylines.forEach { + val builder = PolylineBuilder() + Convert.sinkPolylineOptions(it.options, builder, density) + val options = builder.build() + val polyline = getMap().addPolyline(options) + if (polyline != null) { + val controller = PolylineController(polyline, it.polylineId) + _polylines.add(controller) + result.add(it) + } + } + return result + } + + fun updatePolylines(polylines: List): List { + var error: Throwable? = null + val density = Resources.getSystem().displayMetrics.density + invalidateViewAfterMapLoad() + val result = mutableListOf() + polylines.forEach { + findPolylineController(it.polylineId)?.let { controller -> + Convert.sinkPolylineOptions(it.options, controller, density) + result.add(it) + } + ?: run { + error = + FlutterError("polylineNotFound", "Failed to update polyline with id ${it.polylineId}") + } + } + error?.let { throw error as Throwable } + return result + } + + fun removePolylines(polylines: List) { + invalidateViewAfterMapLoad() + var error: Throwable? = null + polylines.forEach { + findPolylineController(it.polylineId)?.let { controller -> + controller.remove() + _polylines.remove(controller) + } + ?: run { + error = + FlutterError("polylineNotFound", "Failed to remove polyline with id ${it.polylineId}") + } + } + error?.let { throw error as Throwable } + } + + fun clearPolylines() { + invalidateViewAfterMapLoad() + _polylines.forEach { controller -> controller.remove() } + _polylines.clear() + } + + fun getCircles(): List { + val density = Resources.getSystem().displayMetrics.density + return _circles.map { + CircleDto(it.circleId, Convert.circleToCircleOptions(it.circle, density)) + } + } + + fun addCircles(circles: List): List { + val density = Resources.getSystem().displayMetrics.density + invalidateViewAfterMapLoad() + val result = mutableListOf() + circles.forEach { + val builder = CircleBuilder() + Convert.sinkCircleOptions(it.options, builder, density) + val options = builder.build() + val circle = getMap().addCircle(options) + if (circle != null) { + val controller = CircleController(circle, it.circleId) + _circles.add(controller) + result.add(it) + } + } + return result + } + + fun updateCircles(circles: List): List { + val density = Resources.getSystem().displayMetrics.density + invalidateViewAfterMapLoad() + val result = mutableListOf() + var error: Throwable? = null + circles.forEach { + findCircleController(it.circleId)?.let { controller -> + Convert.sinkCircleOptions(it.options, controller, density) + result.add(it) + } + ?: run { + error = FlutterError("circleNotFound", "Failed to update circle with id ${it.circleId}") + } + } + error?.let { throw error as Throwable } + return result + } + + fun removeCircles(circles: List) { + invalidateViewAfterMapLoad() + var error: Throwable? = null + circles.forEach { + findCircleController(it.circleId)?.let { controller -> + controller.remove() + _circles.remove(controller) + } + ?: run { + error = FlutterError("circleNotFound", "Failed to remove circle with id ${it.circleId}") + } + } + error?.let { throw error as Throwable } + } + + fun clearCircles() { + invalidateViewAfterMapLoad() + _circles.forEach { controller -> controller.remove() } + _circles.clear() + } +} diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationInspectorHandler.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationInspectorHandler.kt index de688b6..6a67bde 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationInspectorHandler.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationInspectorHandler.kt @@ -14,9 +14,8 @@ package com.google.maps.flutter.navigation -class GoogleMapsNavigationInspectorHandler( - private val viewRegistry: GoogleMapsViewRegistry -) : NavigationInspector { +class GoogleMapsNavigationInspectorHandler(private val viewRegistry: GoogleMapsViewRegistry) : + NavigationInspector { private fun manager(): GoogleMapsNavigationSessionManager { return GoogleMapsNavigationSessionManager.getInstance() } diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt index e017fc9..4f63fe5 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt @@ -52,8 +52,7 @@ class GoogleMapsNavigationPlugin : FlutterPlugin, ActivityAware { } override fun onAttachedToActivity(binding: ActivityPluginBinding) { - val factory = - GoogleMapsViewFactory(viewRegistry, navigationViewEventApi, imageRegistry) + val factory = GoogleMapsViewFactory(viewRegistry, navigationViewEventApi, imageRegistry) _binding.platformViewRegistry.registerViewFactory("google_navigation_flutter", factory) GoogleMapsNavigationSessionManager.createInstance(_binding.binaryMessenger) val inspectorHandler = GoogleMapsNavigationInspectorHandler(viewRegistry) diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt index fafa2b4..d42f43b 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt @@ -16,26 +16,13 @@ package com.google.maps.flutter.navigation -import android.annotation.SuppressLint import android.content.Context import android.content.res.Configuration -import android.content.res.Resources -import android.graphics.Point -import android.location.Location import android.view.View -import com.google.android.gms.maps.CameraUpdate import com.google.android.gms.maps.CameraUpdateFactory -import com.google.android.gms.maps.GoogleMap -import com.google.android.gms.maps.GoogleMap.OnCameraFollowLocationCallback import com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener -import com.google.android.gms.maps.GoogleMap.OnMarkerDragListener import com.google.android.gms.maps.GoogleMapOptions -import com.google.android.gms.maps.model.CameraPosition import com.google.android.gms.maps.model.Circle -import com.google.android.gms.maps.model.FollowMyLocationOptions -import com.google.android.gms.maps.model.LatLng -import com.google.android.gms.maps.model.LatLngBounds -import com.google.android.gms.maps.model.MapStyleOptions import com.google.android.gms.maps.model.Marker import com.google.android.gms.maps.model.Polygon import com.google.android.gms.maps.model.Polyline @@ -389,19 +376,11 @@ internal constructor( } getMap().setOnCameraMoveListener { val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) - viewEventApi.onCameraChanged( - viewId.toLong(), - CameraEventTypeDto.ONCAMERAMOVE, - position - ) {} + viewEventApi.onCameraChanged(viewId.toLong(), CameraEventTypeDto.ONCAMERAMOVE, position) {} } getMap().setOnCameraIdleListener { val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) - viewEventApi.onCameraChanged( - viewId.toLong(), - CameraEventTypeDto.ONCAMERAIDLE, - position - ) {} + viewEventApi.onCameraChanged(viewId.toLong(), CameraEventTypeDto.ONCAMERAIDLE, position) {} } } } diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewFactory.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewFactory.kt index 4f529e7..3776ac1 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewFactory.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewFactory.kt @@ -30,11 +30,8 @@ class GoogleMapsViewFactory( val params = ViewCreationOptionsDto.fromList(args as List) val mapOptions = Convert.convertMapOptionsFromDto(params.mapOptions) if (params.mapViewType == MapViewTypeDto.NAVIGATION) { - val navigationViewOptionsDto = params.navigationViewOptions?.let { - Convert.convertNavigationViewOptionsFromDto( - it - ) - } + val navigationViewOptionsDto = + params.navigationViewOptions?.let { Convert.convertNavigationViewOptionsFromDto(it) } return GoogleMapsNavigationView( context, mapOptions, @@ -45,14 +42,7 @@ class GoogleMapsViewFactory( imageRegistry ) } else { - return GoogleMapView( - context, - mapOptions, - viewId, - viewEventApi, - viewRegistry, - imageRegistry - ) + return GoogleMapView(context, mapOptions, viewId, viewEventApi, viewRegistry, imageRegistry) } } } diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt index d77e1c1..dadfc21 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt @@ -19,9 +19,7 @@ package com.google.maps.flutter.navigation import android.content.res.Resources /** GoogleMapsNavigationMessageHandler */ -class GoogleMapsViewMessageHandler( - private val viewRegistry: GoogleMapsViewRegistry -) : MapViewApi { +class GoogleMapsViewMessageHandler(private val viewRegistry: GoogleMapsViewRegistry) : MapViewApi { private fun getNavigationView(viewId: Int): GoogleMapsNavigationView { val view = viewRegistry.getNavigationView(viewId) @@ -31,6 +29,7 @@ class GoogleMapsViewMessageHandler( throw FlutterError("viewNotFound", "No valid navigation view found") } } + private fun getView(viewId: Int): GoogleMapsBaseMapView { val view = viewRegistry.getMapView(viewId) if (view != null) { diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewRegistry.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewRegistry.kt index 8a5f323..bda737c 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewRegistry.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewRegistry.kt @@ -25,9 +25,9 @@ import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner /** GoogleMapsNavigationViewRegistry */ -class GoogleMapsViewRegistry : - DefaultLifecycleObserver, ComponentCallbacks, ComponentCallbacks2 { - // Separate lists for navigation views, to be able to access them separately for navigation only operations. +class GoogleMapsViewRegistry : DefaultLifecycleObserver, ComponentCallbacks, ComponentCallbacks2 { + // Separate lists for navigation views, to be able to access them separately for navigation only + // operations. private val navigationViews: SparseArray = SparseArray() // This list contains all map views, including navigation views. diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/messages.g.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/messages.g.kt index 88d165d..965b27a 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/messages.g.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/messages.g.kt @@ -1,17 +1,17 @@ // Copyright 2023 Google LLC -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // https://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Autogenerated from Pigeon (v15.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -31,11 +31,7 @@ private fun wrapResult(result: Any?): List { private fun wrapError(exception: Throwable): List { if (exception is FlutterError) { - return listOf( - exception.code, - exception.message, - exception.details - ) + return listOf(exception.code, exception.message, exception.details) } else { return listOf( exception.javaClass.simpleName, @@ -46,15 +42,21 @@ private fun wrapError(exception: Throwable): List { } private fun createConnectionError(channelName: String): FlutterError { - return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")} + return FlutterError( + "channel-error", + "Unable to establish connection on channel: '$channelName'.", + "" + ) +} /** * Error class for passing custom error details to Flutter via a thrown PlatformException. + * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class FlutterError ( +class FlutterError( val code: String, override val message: String? = null, val details: Any? = null @@ -62,7 +64,10 @@ class FlutterError ( /** Describes the type of map to construct. */ enum class MapViewTypeDto(val raw: Int) { - /** Navigation view supports navigation overlay, and current navigation session is displayed on the map. */ + /** + * Navigation view supports navigation overlay, and current navigation session is displayed on the + * map. + */ NAVIGATION(0), /** Classic map view, without navigation overlay. */ MAP(1); @@ -76,10 +81,7 @@ enum class MapViewTypeDto(val raw: Int) { /** Determines the initial visibility of the navigation UI on map initialization. */ enum class NavigationUIEnabledPreferenceDto(val raw: Int) { - /** - * Navigation UI gets enabled if the navigation - * session has already been successfully started. - */ + /** Navigation UI gets enabled if the navigation session has already been successfully started. */ AUTOMATIC(0), /** Navigation UI is disabled. */ DISABLED(1); @@ -341,7 +343,9 @@ enum class ManeuverDto(val raw: Int) { OFFRAMPUTURNCOUNTERCLOCKWISE(22), /** Keep to the left side of the road when entering a turnpike or freeway as the road diverges. */ ONRAMPKEEPLEFT(23), - /** Keep to the right side of the road when entering a turnpike or freeway as the road diverges. */ + /** + * Keep to the right side of the road when entering a turnpike or freeway as the road diverges. + */ ONRAMPKEEPRIGHT(24), /** Regular left turn to enter a turnpike or freeway. */ ONRAMPLEFT(25), @@ -397,9 +401,15 @@ enum class ManeuverDto(val raw: Int) { ROUNDABOUTSTRAIGHTCLOCKWISE(50), /** Enter a roundabout in the counterclockwise direction and continue straight. */ ROUNDABOUTSTRAIGHTCOUNTERCLOCKWISE(51), - /** Enter a roundabout in the clockwise direction and turn clockwise onto the opposite side of the street. */ + /** + * Enter a roundabout in the clockwise direction and turn clockwise onto the opposite side of the + * street. + */ ROUNDABOUTUTURNCLOCKWISE(52), - /** Enter a roundabout in the counterclockwise direction and turn counterclockwise onto the opposite side of the street. */ + /** + * Enter a roundabout in the counterclockwise direction and turn counterclockwise onto the + * opposite side of the street. + */ ROUNDABOUTUTURNCOUNTERCLOCKWISE(53), /** Continue straight. */ STRAIGHT(54), @@ -502,7 +512,7 @@ enum class LaneShapeDto(val raw: Int) { * * Generated class from Pigeon that represents data sent in messages. */ -data class MapOptionsDto ( +data class MapOptionsDto( /** The initial positioning of the camera in the map view. */ val cameraPosition: CameraPositionDto, /** The type of map to display (e.g., satellite, terrain, hybrid, etc.). */ @@ -532,7 +542,6 @@ data class MapOptionsDto ( * the camera target does not move outside these bounds. */ val cameraTargetBounds: LatLngBoundsDto? = null - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -549,12 +558,26 @@ data class MapOptionsDto ( val minZoomPreference = list[9] as Double? val maxZoomPreference = list[10] as Double? val zoomControlsEnabled = list[11] as Boolean - val cameraTargetBounds: LatLngBoundsDto? = (list[12] as List?)?.let { - LatLngBoundsDto.fromList(it) - } - return MapOptionsDto(cameraPosition, mapType, compassEnabled, rotateGesturesEnabled, scrollGesturesEnabled, tiltGesturesEnabled, zoomGesturesEnabled, scrollGesturesEnabledDuringRotateOrZoom, mapToolbarEnabled, minZoomPreference, maxZoomPreference, zoomControlsEnabled, cameraTargetBounds) + val cameraTargetBounds: LatLngBoundsDto? = + (list[12] as List?)?.let { LatLngBoundsDto.fromList(it) } + return MapOptionsDto( + cameraPosition, + mapType, + compassEnabled, + rotateGesturesEnabled, + scrollGesturesEnabled, + tiltGesturesEnabled, + zoomGesturesEnabled, + scrollGesturesEnabledDuringRotateOrZoom, + mapToolbarEnabled, + minZoomPreference, + maxZoomPreference, + zoomControlsEnabled, + cameraTargetBounds + ) } } + fun toList(): List { return listOf( cameraPosition.toList(), @@ -579,10 +602,9 @@ data class MapOptionsDto ( * * Generated class from Pigeon that represents data sent in messages. */ -data class NavigationViewOptionsDto ( +data class NavigationViewOptionsDto( /** Determines the initial visibility of the navigation UI on map initialization. */ val navigationUIEnabledPreference: NavigationUIEnabledPreferenceDto - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -591,6 +613,7 @@ data class NavigationViewOptionsDto ( return NavigationViewOptionsDto(navigationUIEnabledPreference) } } + fun toList(): List { return listOf( navigationUIEnabledPreference.raw, @@ -601,28 +624,26 @@ data class NavigationViewOptionsDto ( /** * A message for creating a new navigation view. * - * This message is used to initialize a new navigation view with a - * specified initial parameters. + * This message is used to initialize a new navigation view with a specified initial parameters. * * Generated class from Pigeon that represents data sent in messages. */ -data class ViewCreationOptionsDto ( +data class ViewCreationOptionsDto( val mapViewType: MapViewTypeDto, val mapOptions: MapOptionsDto, val navigationViewOptions: NavigationViewOptionsDto? = null - ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): ViewCreationOptionsDto { val mapViewType = MapViewTypeDto.ofRaw(list[0] as Int)!! val mapOptions = MapOptionsDto.fromList(list[1] as List) - val navigationViewOptions: NavigationViewOptionsDto? = (list[2] as List?)?.let { - NavigationViewOptionsDto.fromList(it) - } + val navigationViewOptions: NavigationViewOptionsDto? = + (list[2] as List?)?.let { NavigationViewOptionsDto.fromList(it) } return ViewCreationOptionsDto(mapViewType, mapOptions, navigationViewOptions) } } + fun toList(): List { return listOf( mapViewType.raw, @@ -633,12 +654,11 @@ data class ViewCreationOptionsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class CameraPositionDto ( +data class CameraPositionDto( val bearing: Double, val target: LatLngDto, val tilt: Double, val zoom: Double - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -650,6 +670,7 @@ data class CameraPositionDto ( return CameraPositionDto(bearing, target, tilt, zoom) } } + fun toList(): List { return listOf( bearing, @@ -661,12 +682,11 @@ data class CameraPositionDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class MarkerDto ( +data class MarkerDto( /** Identifies marker */ val markerId: String, /** Options for marker */ val options: MarkerOptionsDto - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -676,6 +696,7 @@ data class MarkerDto ( return MarkerDto(markerId, options) } } + fun toList(): List { return listOf( markerId, @@ -685,7 +706,7 @@ data class MarkerDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class MarkerOptionsDto ( +data class MarkerOptionsDto( val alpha: Double, val anchor: MarkerAnchorDto, val draggable: Boolean, @@ -697,7 +718,6 @@ data class MarkerOptionsDto ( val visible: Boolean, val zIndex: Double, val icon: ImageDescriptorDto - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -713,9 +733,22 @@ data class MarkerOptionsDto ( val visible = list[8] as Boolean val zIndex = list[9] as Double val icon = ImageDescriptorDto.fromList(list[10] as List) - return MarkerOptionsDto(alpha, anchor, draggable, flat, consumeTapEvents, position, rotation, infoWindow, visible, zIndex, icon) + return MarkerOptionsDto( + alpha, + anchor, + draggable, + flat, + consumeTapEvents, + position, + rotation, + infoWindow, + visible, + zIndex, + icon + ) } } + fun toList(): List { return listOf( alpha, @@ -734,12 +767,11 @@ data class MarkerOptionsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class ImageDescriptorDto ( +data class ImageDescriptorDto( val registeredImageId: String? = null, val imagePixelRatio: Double? = null, val width: Double? = null, val height: Double? = null - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -751,6 +783,7 @@ data class ImageDescriptorDto ( return ImageDescriptorDto(registeredImageId, imagePixelRatio, width, height) } } + fun toList(): List { return listOf( registeredImageId, @@ -762,11 +795,10 @@ data class ImageDescriptorDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class InfoWindowDto ( +data class InfoWindowDto( val title: String? = null, val snippet: String? = null, val anchor: MarkerAnchorDto - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -777,6 +809,7 @@ data class InfoWindowDto ( return InfoWindowDto(title, snippet, anchor) } } + fun toList(): List { return listOf( title, @@ -787,11 +820,8 @@ data class InfoWindowDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class MarkerAnchorDto ( - val u: Double, - val v: Double +data class MarkerAnchorDto(val u: Double, val v: Double) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): MarkerAnchorDto { @@ -800,6 +830,7 @@ data class MarkerAnchorDto ( return MarkerAnchorDto(u, v) } } + fun toList(): List { return listOf( u, @@ -809,11 +840,8 @@ data class MarkerAnchorDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class PolygonDto ( - val polygonId: String, - val options: PolygonOptionsDto +data class PolygonDto(val polygonId: String, val options: PolygonOptionsDto) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): PolygonDto { @@ -822,6 +850,7 @@ data class PolygonDto ( return PolygonDto(polygonId, options) } } + fun toList(): List { return listOf( polygonId, @@ -831,7 +860,7 @@ data class PolygonDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class PolygonOptionsDto ( +data class PolygonOptionsDto( val points: List, val holes: List, val clickable: Boolean, @@ -841,7 +870,6 @@ data class PolygonOptionsDto ( val strokeWidth: Double, val visible: Boolean, val zIndex: Double - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -855,9 +883,20 @@ data class PolygonOptionsDto ( val strokeWidth = list[6] as Double val visible = list[7] as Boolean val zIndex = list[8] as Double - return PolygonOptionsDto(points, holes, clickable, fillColor, geodesic, strokeColor, strokeWidth, visible, zIndex) + return PolygonOptionsDto( + points, + holes, + clickable, + fillColor, + geodesic, + strokeColor, + strokeWidth, + visible, + zIndex + ) } } + fun toList(): List { return listOf( points, @@ -874,10 +913,8 @@ data class PolygonOptionsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class PolygonHoleDto ( - val points: List +data class PolygonHoleDto(val points: List) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): PolygonHoleDto { @@ -885,6 +922,7 @@ data class PolygonHoleDto ( return PolygonHoleDto(points) } } + fun toList(): List { return listOf( points, @@ -893,11 +931,10 @@ data class PolygonHoleDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class StyleSpanStrokeStyleDto ( +data class StyleSpanStrokeStyleDto( val solidColor: Long? = null, val fromColor: Long? = null, val toColor: Long? = null - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -908,6 +945,7 @@ data class StyleSpanStrokeStyleDto ( return StyleSpanStrokeStyleDto(solidColor, fromColor, toColor) } } + fun toList(): List { return listOf( solidColor, @@ -918,11 +956,8 @@ data class StyleSpanStrokeStyleDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class StyleSpanDto ( - val length: Double, - val style: StyleSpanStrokeStyleDto +data class StyleSpanDto(val length: Double, val style: StyleSpanStrokeStyleDto) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): StyleSpanDto { @@ -931,6 +966,7 @@ data class StyleSpanDto ( return StyleSpanDto(length, style) } } + fun toList(): List { return listOf( length, @@ -940,11 +976,8 @@ data class StyleSpanDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class PolylineDto ( - val polylineId: String, - val options: PolylineOptionsDto +data class PolylineDto(val polylineId: String, val options: PolylineOptionsDto) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): PolylineDto { @@ -953,6 +986,7 @@ data class PolylineDto ( return PolylineDto(polylineId, options) } } + fun toList(): List { return listOf( polylineId, @@ -962,11 +996,8 @@ data class PolylineDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class PatternItemDto ( - val type: PatternTypeDto, - val length: Double? = null +data class PatternItemDto(val type: PatternTypeDto, val length: Double? = null) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): PatternItemDto { @@ -975,6 +1006,7 @@ data class PatternItemDto ( return PatternItemDto(type, length) } } + fun toList(): List { return listOf( type.raw, @@ -984,7 +1016,7 @@ data class PatternItemDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class PolylineOptionsDto ( +data class PolylineOptionsDto( val points: List? = null, val clickable: Boolean? = null, val geodesic: Boolean? = null, @@ -995,7 +1027,6 @@ data class PolylineOptionsDto ( val visible: Boolean? = null, val zIndex: Double? = null, val spans: List - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1004,17 +1035,28 @@ data class PolylineOptionsDto ( val clickable = list[1] as Boolean? val geodesic = list[2] as Boolean? val strokeColor = list[3].let { if (it is Int) it.toLong() else it as Long? } - val strokeJointType: StrokeJointTypeDto? = (list[4] as Int?)?.let { - StrokeJointTypeDto.ofRaw(it) - } + val strokeJointType: StrokeJointTypeDto? = + (list[4] as Int?)?.let { StrokeJointTypeDto.ofRaw(it) } val strokePattern = list[5] as List? val strokeWidth = list[6] as Double? val visible = list[7] as Boolean? val zIndex = list[8] as Double? val spans = list[9] as List - return PolylineOptionsDto(points, clickable, geodesic, strokeColor, strokeJointType, strokePattern, strokeWidth, visible, zIndex, spans) + return PolylineOptionsDto( + points, + clickable, + geodesic, + strokeColor, + strokeJointType, + strokePattern, + strokeWidth, + visible, + zIndex, + spans + ) } } + fun toList(): List { return listOf( points, @@ -1032,12 +1074,11 @@ data class PolylineOptionsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class CircleDto ( +data class CircleDto( /** Identifies circle. */ val circleId: String, /** Options for circle. */ val options: CircleOptionsDto - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1047,6 +1088,7 @@ data class CircleDto ( return CircleDto(circleId, options) } } + fun toList(): List { return listOf( circleId, @@ -1056,7 +1098,7 @@ data class CircleDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class CircleOptionsDto ( +data class CircleOptionsDto( val position: LatLngDto, val radius: Double, val strokeWidth: Double, @@ -1066,7 +1108,6 @@ data class CircleOptionsDto ( val zIndex: Double, val visible: Boolean, val clickable: Boolean - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1080,9 +1121,20 @@ data class CircleOptionsDto ( val zIndex = list[6] as Double val visible = list[7] as Boolean val clickable = list[8] as Boolean - return CircleOptionsDto(position, radius, strokeWidth, strokeColor, strokePattern, fillColor, zIndex, visible, clickable) + return CircleOptionsDto( + position, + radius, + strokeWidth, + strokeColor, + strokePattern, + fillColor, + zIndex, + visible, + clickable + ) } } + fun toList(): List { return listOf( position.toList(), @@ -1099,21 +1151,17 @@ data class CircleOptionsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class RouteTokenOptionsDto ( - val routeToken: String, - val travelMode: TravelModeDto? = null +data class RouteTokenOptionsDto(val routeToken: String, val travelMode: TravelModeDto? = null) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): RouteTokenOptionsDto { val routeToken = list[0] as String - val travelMode: TravelModeDto? = (list[1] as Int?)?.let { - TravelModeDto.ofRaw(it) - } + val travelMode: TravelModeDto? = (list[1] as Int?)?.let { TravelModeDto.ofRaw(it) } return RouteTokenOptionsDto(routeToken, travelMode) } } + fun toList(): List { return listOf( routeToken, @@ -1123,27 +1171,25 @@ data class RouteTokenOptionsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class DestinationsDto ( +data class DestinationsDto( val waypoints: List, val displayOptions: NavigationDisplayOptionsDto, val routingOptions: RoutingOptionsDto? = null, val routeTokenOptions: RouteTokenOptionsDto? = null - ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): DestinationsDto { val waypoints = list[0] as List val displayOptions = NavigationDisplayOptionsDto.fromList(list[1] as List) - val routingOptions: RoutingOptionsDto? = (list[2] as List?)?.let { - RoutingOptionsDto.fromList(it) - } - val routeTokenOptions: RouteTokenOptionsDto? = (list[3] as List?)?.let { - RouteTokenOptionsDto.fromList(it) - } + val routingOptions: RoutingOptionsDto? = + (list[2] as List?)?.let { RoutingOptionsDto.fromList(it) } + val routeTokenOptions: RouteTokenOptionsDto? = + (list[3] as List?)?.let { RouteTokenOptionsDto.fromList(it) } return DestinationsDto(waypoints, displayOptions, routingOptions, routeTokenOptions) } } + fun toList(): List { return listOf( waypoints, @@ -1155,7 +1201,7 @@ data class DestinationsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class RoutingOptionsDto ( +data class RoutingOptionsDto( val alternateRoutesStrategy: AlternateRoutesStrategyDto? = null, val routingStrategy: RoutingStrategyDto? = null, val targetDistanceMeters: List? = null, @@ -1164,28 +1210,33 @@ data class RoutingOptionsDto ( val avoidFerries: Boolean? = null, val avoidHighways: Boolean? = null, val locationTimeoutMs: Long? = null - ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): RoutingOptionsDto { - val alternateRoutesStrategy: AlternateRoutesStrategyDto? = (list[0] as Int?)?.let { - AlternateRoutesStrategyDto.ofRaw(it) - } - val routingStrategy: RoutingStrategyDto? = (list[1] as Int?)?.let { - RoutingStrategyDto.ofRaw(it) - } + val alternateRoutesStrategy: AlternateRoutesStrategyDto? = + (list[0] as Int?)?.let { AlternateRoutesStrategyDto.ofRaw(it) } + val routingStrategy: RoutingStrategyDto? = + (list[1] as Int?)?.let { RoutingStrategyDto.ofRaw(it) } val targetDistanceMeters = list[2] as List? - val travelMode: TravelModeDto? = (list[3] as Int?)?.let { - TravelModeDto.ofRaw(it) - } + val travelMode: TravelModeDto? = (list[3] as Int?)?.let { TravelModeDto.ofRaw(it) } val avoidTolls = list[4] as Boolean? val avoidFerries = list[5] as Boolean? val avoidHighways = list[6] as Boolean? val locationTimeoutMs = list[7].let { if (it is Int) it.toLong() else it as Long? } - return RoutingOptionsDto(alternateRoutesStrategy, routingStrategy, targetDistanceMeters, travelMode, avoidTolls, avoidFerries, avoidHighways, locationTimeoutMs) + return RoutingOptionsDto( + alternateRoutesStrategy, + routingStrategy, + targetDistanceMeters, + travelMode, + avoidTolls, + avoidFerries, + avoidHighways, + locationTimeoutMs + ) } } + fun toList(): List { return listOf( alternateRoutesStrategy?.raw, @@ -1201,11 +1252,10 @@ data class RoutingOptionsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class NavigationDisplayOptionsDto ( +data class NavigationDisplayOptionsDto( val showDestinationMarkers: Boolean? = null, val showStopSigns: Boolean? = null, val showTrafficLights: Boolean? = null - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1216,6 +1266,7 @@ data class NavigationDisplayOptionsDto ( return NavigationDisplayOptionsDto(showDestinationMarkers, showStopSigns, showTrafficLights) } } + fun toList(): List { return listOf( showDestinationMarkers, @@ -1226,27 +1277,31 @@ data class NavigationDisplayOptionsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class NavigationWaypointDto ( +data class NavigationWaypointDto( val title: String, val target: LatLngDto? = null, val placeID: String? = null, val preferSameSideOfRoad: Boolean? = null, val preferredSegmentHeading: Long? = null - ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): NavigationWaypointDto { val title = list[0] as String - val target: LatLngDto? = (list[1] as List?)?.let { - LatLngDto.fromList(it) - } + val target: LatLngDto? = (list[1] as List?)?.let { LatLngDto.fromList(it) } val placeID = list[2] as String? val preferSameSideOfRoad = list[3] as Boolean? val preferredSegmentHeading = list[4].let { if (it is Int) it.toLong() else it as Long? } - return NavigationWaypointDto(title, target, placeID, preferSameSideOfRoad, preferredSegmentHeading) + return NavigationWaypointDto( + title, + target, + placeID, + preferSameSideOfRoad, + preferredSegmentHeading + ) } } + fun toList(): List { return listOf( title, @@ -1259,11 +1314,8 @@ data class NavigationWaypointDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class NavigationTimeAndDistanceDto ( - val time: Double, - val distance: Double +data class NavigationTimeAndDistanceDto(val time: Double, val distance: Double) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): NavigationTimeAndDistanceDto { @@ -1272,6 +1324,7 @@ data class NavigationTimeAndDistanceDto ( return NavigationTimeAndDistanceDto(time, distance) } } + fun toList(): List { return listOf( time, @@ -1281,23 +1334,26 @@ data class NavigationTimeAndDistanceDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class NavigationAudioGuidanceSettingsDto ( +data class NavigationAudioGuidanceSettingsDto( val isBluetoothAudioEnabled: Boolean? = null, val isVibrationEnabled: Boolean? = null, val guidanceType: AudioGuidanceTypeDto? = null - ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): NavigationAudioGuidanceSettingsDto { val isBluetoothAudioEnabled = list[0] as Boolean? val isVibrationEnabled = list[1] as Boolean? - val guidanceType: AudioGuidanceTypeDto? = (list[2] as Int?)?.let { - AudioGuidanceTypeDto.ofRaw(it) - } - return NavigationAudioGuidanceSettingsDto(isBluetoothAudioEnabled, isVibrationEnabled, guidanceType) + val guidanceType: AudioGuidanceTypeDto? = + (list[2] as Int?)?.let { AudioGuidanceTypeDto.ofRaw(it) } + return NavigationAudioGuidanceSettingsDto( + isBluetoothAudioEnabled, + isVibrationEnabled, + guidanceType + ) } } + fun toList(): List { return listOf( isBluetoothAudioEnabled, @@ -1308,10 +1364,8 @@ data class NavigationAudioGuidanceSettingsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class SimulationOptionsDto ( - val speedMultiplier: Double +data class SimulationOptionsDto(val speedMultiplier: Double) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): SimulationOptionsDto { @@ -1319,6 +1373,7 @@ data class SimulationOptionsDto ( return SimulationOptionsDto(speedMultiplier) } } + fun toList(): List { return listOf( speedMultiplier, @@ -1327,11 +1382,8 @@ data class SimulationOptionsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class LatLngDto ( - val latitude: Double, - val longitude: Double +data class LatLngDto(val latitude: Double, val longitude: Double) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): LatLngDto { @@ -1340,6 +1392,7 @@ data class LatLngDto ( return LatLngDto(latitude, longitude) } } + fun toList(): List { return listOf( latitude, @@ -1349,11 +1402,8 @@ data class LatLngDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class LatLngBoundsDto ( - val southwest: LatLngDto, - val northeast: LatLngDto +data class LatLngBoundsDto(val southwest: LatLngDto, val northeast: LatLngDto) { -) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): LatLngBoundsDto { @@ -1362,6 +1412,7 @@ data class LatLngBoundsDto ( return LatLngBoundsDto(southwest, northeast) } } + fun toList(): List { return listOf( southwest.toList(), @@ -1371,10 +1422,9 @@ data class LatLngBoundsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class SpeedingUpdatedEventDto ( +data class SpeedingUpdatedEventDto( val percentageAboveLimit: Double, val severity: SpeedAlertSeverityDto - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1384,6 +1434,7 @@ data class SpeedingUpdatedEventDto ( return SpeedingUpdatedEventDto(percentageAboveLimit, severity) } } + fun toList(): List { return listOf( percentageAboveLimit, @@ -1393,11 +1444,10 @@ data class SpeedingUpdatedEventDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class SpeedAlertOptionsDto ( +data class SpeedAlertOptionsDto( val severityUpgradeDurationSeconds: Double, val minorSpeedAlertThresholdPercentage: Double, val majorSpeedAlertThresholdPercentage: Double - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1405,9 +1455,14 @@ data class SpeedAlertOptionsDto ( val severityUpgradeDurationSeconds = list[0] as Double val minorSpeedAlertThresholdPercentage = list[1] as Double val majorSpeedAlertThresholdPercentage = list[2] as Double - return SpeedAlertOptionsDto(severityUpgradeDurationSeconds, minorSpeedAlertThresholdPercentage, majorSpeedAlertThresholdPercentage) + return SpeedAlertOptionsDto( + severityUpgradeDurationSeconds, + minorSpeedAlertThresholdPercentage, + majorSpeedAlertThresholdPercentage + ) } } + fun toList(): List { return listOf( severityUpgradeDurationSeconds, @@ -1418,11 +1473,10 @@ data class SpeedAlertOptionsDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class RouteSegmentTrafficDataRoadStretchRenderingDataDto ( +data class RouteSegmentTrafficDataRoadStretchRenderingDataDto( val style: RouteSegmentTrafficDataRoadStretchRenderingDataStyleDto, val lengthMeters: Long, val offsetMeters: Long - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1433,6 +1487,7 @@ data class RouteSegmentTrafficDataRoadStretchRenderingDataDto ( return RouteSegmentTrafficDataRoadStretchRenderingDataDto(style, lengthMeters, offsetMeters) } } + fun toList(): List { return listOf( style.raw, @@ -1443,19 +1498,20 @@ data class RouteSegmentTrafficDataRoadStretchRenderingDataDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class RouteSegmentTrafficDataDto ( +data class RouteSegmentTrafficDataDto( val status: RouteSegmentTrafficDataStatusDto, val roadStretchRenderingDataList: List - ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): RouteSegmentTrafficDataDto { val status = RouteSegmentTrafficDataStatusDto.ofRaw(list[0] as Int)!! - val roadStretchRenderingDataList = list[1] as List + val roadStretchRenderingDataList = + list[1] as List return RouteSegmentTrafficDataDto(status, roadStretchRenderingDataList) } } + fun toList(): List { return listOf( status.raw, @@ -1465,27 +1521,25 @@ data class RouteSegmentTrafficDataDto ( } /** Generated class from Pigeon that represents data sent in messages. */ -data class RouteSegmentDto ( +data class RouteSegmentDto( val trafficData: RouteSegmentTrafficDataDto? = null, val destinationLatLng: LatLngDto, val latLngs: List? = null, val destinationWaypoint: NavigationWaypointDto? = null - ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): RouteSegmentDto { - val trafficData: RouteSegmentTrafficDataDto? = (list[0] as List?)?.let { - RouteSegmentTrafficDataDto.fromList(it) - } + val trafficData: RouteSegmentTrafficDataDto? = + (list[0] as List?)?.let { RouteSegmentTrafficDataDto.fromList(it) } val destinationLatLng = LatLngDto.fromList(list[1] as List) val latLngs = list[2] as List? - val destinationWaypoint: NavigationWaypointDto? = (list[3] as List?)?.let { - NavigationWaypointDto.fromList(it) - } + val destinationWaypoint: NavigationWaypointDto? = + (list[3] as List?)?.let { NavigationWaypointDto.fromList(it) } return RouteSegmentDto(trafficData, destinationLatLng, latLngs, destinationWaypoint) } } + fun toList(): List { return listOf( trafficData?.toList(), @@ -1497,16 +1551,16 @@ data class RouteSegmentDto ( } /** - * One of the possible directions from a lane at the end of a route step, and whether it is on the recommended route. + * One of the possible directions from a lane at the end of a route step, and whether it is on the + * recommended route. * * Generated class from Pigeon that represents data sent in messages. */ -data class LaneDirectionDto ( +data class LaneDirectionDto( /** Shape for this lane direction. */ val laneShape: LaneShapeDto, /** Whether this lane is recommended. */ val isRecommended: Boolean - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1516,6 +1570,7 @@ data class LaneDirectionDto ( return LaneDirectionDto(laneShape, isRecommended) } } + fun toList(): List { return listOf( laneShape.raw, @@ -1529,10 +1584,12 @@ data class LaneDirectionDto ( * * Generated class from Pigeon that represents data sent in messages. */ -data class LaneDto ( - /** List of possible directions a driver can follow when using this lane at the end of the respective route step */ +data class LaneDto( + /** + * List of possible directions a driver can follow when using this lane at the end of the + * respective route step + */ val laneDirections: List - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1541,6 +1598,7 @@ data class LaneDto ( return LaneDto(laneDirections) } } + fun toList(): List { return listOf( laneDirections, @@ -1553,7 +1611,7 @@ data class LaneDto ( * * Generated class from Pigeon that represents data sent in messages. */ -data class StepInfoDto ( +data class StepInfoDto( /** Distance in meters from the previous step to this step. */ val distanceFromPrevStepMeters: Long, /** Time in seconds from the previous step to this step. */ @@ -1569,8 +1627,8 @@ data class StepInfoDto ( /** The simplified version of the road name. */ val simpleRoadName: String, /** - * The counted number of the exit to take relative to the location where the - * roundabout was entered. + * The counted number of the exit to take relative to the location where the roundabout was + * entered. */ val roundaboutTurnNumber: Long, /** The list of available lanes at the end of this route step. */ @@ -1579,7 +1637,6 @@ data class StepInfoDto ( val maneuver: ManeuverDto, /** The index of the step in the list of all steps in the route. */ val stepNumber: Long - ) { companion object { @Suppress("UNCHECKED_CAST") @@ -1595,9 +1652,22 @@ data class StepInfoDto ( val lanes = list[8] as List val maneuver = ManeuverDto.ofRaw(list[9] as Int)!! val stepNumber = list[10].let { if (it is Int) it.toLong() else it as Long } - return StepInfoDto(distanceFromPrevStepMeters, timeFromPrevStepSeconds, drivingSide, exitNumber, fullInstructions, fullRoadName, simpleRoadName, roundaboutTurnNumber, lanes, maneuver, stepNumber) + return StepInfoDto( + distanceFromPrevStepMeters, + timeFromPrevStepSeconds, + drivingSide, + exitNumber, + fullInstructions, + fullRoadName, + simpleRoadName, + roundaboutTurnNumber, + lanes, + maneuver, + stepNumber + ) } } + fun toList(): List { return listOf( distanceFromPrevStepMeters, @@ -1616,12 +1686,12 @@ data class StepInfoDto ( } /** - * Contains information about the state of navigation, the current nav step if - * available, and remaining steps if available. + * Contains information about the state of navigation, the current nav step if available, and + * remaining steps if available. * * Generated class from Pigeon that represents data sent in messages. */ -data class NavInfoDto ( +data class NavInfoDto( /** The current state of navigation. */ val navState: NavStateDto, /** Information about the upcoming maneuver step. */ @@ -1630,14 +1700,11 @@ data class NavInfoDto ( val remainingSteps: List, /** Whether the route has changed since the last sent message. */ val routeChanged: Boolean, - /** - * Estimated remaining distance in meters along the route to the - * current step. - */ + /** Estimated remaining distance in meters along the route to the current step. */ val distanceToCurrentStepMeters: Long? = null, /** - * The estimated remaining distance in meters to the final destination which - * is the last destination in a multi-destination trip. + * The estimated remaining distance in meters to the final destination which is the last + * destination in a multi-destination trip. */ val distanceToFinalDestinationMeters: Long? = null, /** @@ -1646,14 +1713,11 @@ data class NavInfoDto ( * Android only. */ val distanceToNextDestinationMeters: Long? = null, - /** - * The estimated remaining time in seconds along the route to the - * current step. - */ + /** The estimated remaining time in seconds along the route to the current step. */ val timeToCurrentStepSeconds: Long? = null, /** - * The estimated remaining time in seconds to the final destination which is - * the last destination in a multi-destination trip. + * The estimated remaining time in seconds to the final destination which is the last destination + * in a multi-destination trip. */ val timeToFinalDestinationSeconds: Long? = null, /** @@ -1662,26 +1726,38 @@ data class NavInfoDto ( * Android only. */ val timeToNextDestinationSeconds: Long? = null - ) { companion object { @Suppress("UNCHECKED_CAST") fun fromList(list: List): NavInfoDto { val navState = NavStateDto.ofRaw(list[0] as Int)!! - val currentStep: StepInfoDto? = (list[1] as List?)?.let { - StepInfoDto.fromList(it) - } + val currentStep: StepInfoDto? = (list[1] as List?)?.let { StepInfoDto.fromList(it) } val remainingSteps = list[2] as List val routeChanged = list[3] as Boolean val distanceToCurrentStepMeters = list[4].let { if (it is Int) it.toLong() else it as Long? } - val distanceToFinalDestinationMeters = list[5].let { if (it is Int) it.toLong() else it as Long? } - val distanceToNextDestinationMeters = list[6].let { if (it is Int) it.toLong() else it as Long? } + val distanceToFinalDestinationMeters = + list[5].let { if (it is Int) it.toLong() else it as Long? } + val distanceToNextDestinationMeters = + list[6].let { if (it is Int) it.toLong() else it as Long? } val timeToCurrentStepSeconds = list[7].let { if (it is Int) it.toLong() else it as Long? } - val timeToFinalDestinationSeconds = list[8].let { if (it is Int) it.toLong() else it as Long? } + val timeToFinalDestinationSeconds = + list[8].let { if (it is Int) it.toLong() else it as Long? } val timeToNextDestinationSeconds = list[9].let { if (it is Int) it.toLong() else it as Long? } - return NavInfoDto(navState, currentStep, remainingSteps, routeChanged, distanceToCurrentStepMeters, distanceToFinalDestinationMeters, distanceToNextDestinationMeters, timeToCurrentStepSeconds, timeToFinalDestinationSeconds, timeToNextDestinationSeconds) + return NavInfoDto( + navState, + currentStep, + remainingSteps, + routeChanged, + distanceToCurrentStepMeters, + distanceToFinalDestinationMeters, + distanceToNextDestinationMeters, + timeToCurrentStepSeconds, + timeToFinalDestinationSeconds, + timeToNextDestinationSeconds + ) } } + fun toList(): List { return listOf( navState.raw, @@ -1703,39 +1779,28 @@ private object _NavigationViewCreationApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - CameraPositionDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { CameraPositionDto.fromList(it) } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - LatLngBoundsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LatLngBoundsDto.fromList(it) } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { - LatLngDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } } 131.toByte() -> { - return (readValue(buffer) as? List)?.let { - MapOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { MapOptionsDto.fromList(it) } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { - NavigationViewOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { NavigationViewOptionsDto.fromList(it) } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { - ViewCreationOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { ViewCreationOptionsDto.fromList(it) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is CameraPositionDto -> { stream.write(128) @@ -1767,9 +1832,9 @@ private object _NavigationViewCreationApiCodec : StandardMessageCodec() { } /** - * Pigeon only generates messages if the messages are used in API. - * [MapOptionsDto] is encoded and decoded directly to generate - * a PlatformView creation message. This API should never be used directly. + * Pigeon only generates messages if the messages are used in API. [MapOptionsDto] is encoded and + * decoded directly to generate a PlatformView creation message. This API should never be used + * directly. * * Generated interface from Pigeon that represents a handler of messages from Flutter. */ @@ -1778,14 +1843,20 @@ interface _NavigationViewCreationApi { companion object { /** The codec used by _NavigationViewCreationApi. */ - val codec: MessageCodec by lazy { - _NavigationViewCreationApiCodec - } - /** Sets up an instance of `_NavigationViewCreationApi` to handle messages through the `binaryMessenger`. */ + val codec: MessageCodec by lazy { _NavigationViewCreationApiCodec } + /** + * Sets up an instance of `_NavigationViewCreationApi` to handle messages through the + * `binaryMessenger`. + */ @Suppress("UNCHECKED_CAST") fun setUp(binaryMessenger: BinaryMessenger, api: _NavigationViewCreationApi?) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1806,109 +1877,73 @@ interface _NavigationViewCreationApi { } } } + @Suppress("UNCHECKED_CAST") private object MapViewApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - CameraPositionDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { CameraPositionDto.fromList(it) } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - CircleDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { CircleDto.fromList(it) } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { - CircleOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { CircleOptionsDto.fromList(it) } } 131.toByte() -> { - return (readValue(buffer) as? List)?.let { - ImageDescriptorDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { ImageDescriptorDto.fromList(it) } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { - InfoWindowDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { InfoWindowDto.fromList(it) } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { - LatLngBoundsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LatLngBoundsDto.fromList(it) } } 134.toByte() -> { - return (readValue(buffer) as? List)?.let { - LatLngDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } } 135.toByte() -> { - return (readValue(buffer) as? List)?.let { - LatLngDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } } 136.toByte() -> { - return (readValue(buffer) as? List)?.let { - MarkerAnchorDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { MarkerAnchorDto.fromList(it) } } 137.toByte() -> { - return (readValue(buffer) as? List)?.let { - MarkerDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { MarkerDto.fromList(it) } } 138.toByte() -> { - return (readValue(buffer) as? List)?.let { - MarkerOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { MarkerOptionsDto.fromList(it) } } 139.toByte() -> { - return (readValue(buffer) as? List)?.let { - PatternItemDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { PatternItemDto.fromList(it) } } 140.toByte() -> { - return (readValue(buffer) as? List)?.let { - PolygonDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { PolygonDto.fromList(it) } } 141.toByte() -> { - return (readValue(buffer) as? List)?.let { - PolygonHoleDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { PolygonHoleDto.fromList(it) } } 142.toByte() -> { - return (readValue(buffer) as? List)?.let { - PolygonOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { PolygonOptionsDto.fromList(it) } } 143.toByte() -> { - return (readValue(buffer) as? List)?.let { - PolylineDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { PolylineDto.fromList(it) } } 144.toByte() -> { - return (readValue(buffer) as? List)?.let { - PolylineOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { PolylineOptionsDto.fromList(it) } } 145.toByte() -> { - return (readValue(buffer) as? List)?.let { - StyleSpanDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { StyleSpanDto.fromList(it) } } 146.toByte() -> { - return (readValue(buffer) as? List)?.let { - StyleSpanStrokeStyleDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { StyleSpanStrokeStyleDto.fromList(it) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is CameraPositionDto -> { stream.write(128) @@ -1994,106 +2029,238 @@ private object MapViewApiCodec : StandardMessageCodec() { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface MapViewApi { fun awaitMapReady(viewId: Long, callback: (Result) -> Unit) + fun isMyLocationEnabled(viewId: Long): Boolean + fun setMyLocationEnabled(viewId: Long, enabled: Boolean) + fun getMyLocation(viewId: Long): LatLngDto? + fun getMapType(viewId: Long): MapTypeDto + fun setMapType(viewId: Long, mapType: MapTypeDto) + fun setMapStyle(viewId: Long, styleJson: String) + fun isNavigationTripProgressBarEnabled(viewId: Long): Boolean + fun setNavigationTripProgressBarEnabled(viewId: Long, enabled: Boolean) + fun isNavigationHeaderEnabled(viewId: Long): Boolean + fun setNavigationHeaderEnabled(viewId: Long, enabled: Boolean) + fun isNavigationFooterEnabled(viewId: Long): Boolean + fun setNavigationFooterEnabled(viewId: Long, enabled: Boolean) + fun isRecenterButtonEnabled(viewId: Long): Boolean + fun setRecenterButtonEnabled(viewId: Long, enabled: Boolean) + fun isSpeedLimitIconEnabled(viewId: Long): Boolean + fun setSpeedLimitIconEnabled(viewId: Long, enabled: Boolean) + fun isSpeedometerEnabled(viewId: Long): Boolean + fun setSpeedometerEnabled(viewId: Long, enabled: Boolean) + fun isTrafficIncidentCardsEnabled(viewId: Long): Boolean + fun setTrafficIncidentCardsEnabled(viewId: Long, enabled: Boolean) + fun isNavigationUIEnabled(viewId: Long): Boolean + fun setNavigationUIEnabled(viewId: Long, enabled: Boolean) + fun getCameraPosition(viewId: Long): CameraPositionDto + fun getVisibleRegion(viewId: Long): LatLngBoundsDto + fun followMyLocation(viewId: Long, perspective: CameraPerspectiveDto, zoomLevel: Double?) - fun animateCameraToCameraPosition(viewId: Long, cameraPosition: CameraPositionDto, duration: Long?, callback: (Result) -> Unit) - fun animateCameraToLatLng(viewId: Long, point: LatLngDto, duration: Long?, callback: (Result) -> Unit) - fun animateCameraToLatLngBounds(viewId: Long, bounds: LatLngBoundsDto, padding: Double, duration: Long?, callback: (Result) -> Unit) - fun animateCameraToLatLngZoom(viewId: Long, point: LatLngDto, zoom: Double, duration: Long?, callback: (Result) -> Unit) - fun animateCameraByScroll(viewId: Long, scrollByDx: Double, scrollByDy: Double, duration: Long?, callback: (Result) -> Unit) - fun animateCameraByZoom(viewId: Long, zoomBy: Double, focusDx: Double?, focusDy: Double?, duration: Long?, callback: (Result) -> Unit) - fun animateCameraToZoom(viewId: Long, zoom: Double, duration: Long?, callback: (Result) -> Unit) + + fun animateCameraToCameraPosition( + viewId: Long, + cameraPosition: CameraPositionDto, + duration: Long?, + callback: (Result) -> Unit + ) + + fun animateCameraToLatLng( + viewId: Long, + point: LatLngDto, + duration: Long?, + callback: (Result) -> Unit + ) + + fun animateCameraToLatLngBounds( + viewId: Long, + bounds: LatLngBoundsDto, + padding: Double, + duration: Long?, + callback: (Result) -> Unit + ) + + fun animateCameraToLatLngZoom( + viewId: Long, + point: LatLngDto, + zoom: Double, + duration: Long?, + callback: (Result) -> Unit + ) + + fun animateCameraByScroll( + viewId: Long, + scrollByDx: Double, + scrollByDy: Double, + duration: Long?, + callback: (Result) -> Unit + ) + + fun animateCameraByZoom( + viewId: Long, + zoomBy: Double, + focusDx: Double?, + focusDy: Double?, + duration: Long?, + callback: (Result) -> Unit + ) + + fun animateCameraToZoom( + viewId: Long, + zoom: Double, + duration: Long?, + callback: (Result) -> Unit + ) + fun moveCameraToCameraPosition(viewId: Long, cameraPosition: CameraPositionDto) + fun moveCameraToLatLng(viewId: Long, point: LatLngDto) + fun moveCameraToLatLngBounds(viewId: Long, bounds: LatLngBoundsDto, padding: Double) + fun moveCameraToLatLngZoom(viewId: Long, point: LatLngDto, zoom: Double) + fun moveCameraByScroll(viewId: Long, scrollByDx: Double, scrollByDy: Double) + fun moveCameraByZoom(viewId: Long, zoomBy: Double, focusDx: Double?, focusDy: Double?) + fun moveCameraToZoom(viewId: Long, zoom: Double) + fun showRouteOverview(viewId: Long) + fun getMinZoomPreference(viewId: Long): Double + fun getMaxZoomPreference(viewId: Long): Double + fun resetMinMaxZoomPreference(viewId: Long) + fun setMinZoomPreference(viewId: Long, minZoomPreference: Double) + fun setMaxZoomPreference(viewId: Long, maxZoomPreference: Double) + fun setMyLocationButtonEnabled(viewId: Long, enabled: Boolean) + fun setConsumeMyLocationButtonClickEventsEnabled(viewId: Long, enabled: Boolean) + fun setZoomGesturesEnabled(viewId: Long, enabled: Boolean) + fun setZoomControlsEnabled(viewId: Long, enabled: Boolean) + fun setCompassEnabled(viewId: Long, enabled: Boolean) + fun setRotateGesturesEnabled(viewId: Long, enabled: Boolean) + fun setScrollGesturesEnabled(viewId: Long, enabled: Boolean) + fun setScrollGesturesDuringRotateOrZoomEnabled(viewId: Long, enabled: Boolean) + fun setTiltGesturesEnabled(viewId: Long, enabled: Boolean) + fun setMapToolbarEnabled(viewId: Long, enabled: Boolean) + fun setTrafficEnabled(viewId: Long, enabled: Boolean) + fun isMyLocationButtonEnabled(viewId: Long): Boolean + fun isConsumeMyLocationButtonClickEventsEnabled(viewId: Long): Boolean + fun isZoomGesturesEnabled(viewId: Long): Boolean + fun isZoomControlsEnabled(viewId: Long): Boolean + fun isCompassEnabled(viewId: Long): Boolean + fun isRotateGesturesEnabled(viewId: Long): Boolean + fun isScrollGesturesEnabled(viewId: Long): Boolean + fun isScrollGesturesEnabledDuringRotateOrZoom(viewId: Long): Boolean + fun isTiltGesturesEnabled(viewId: Long): Boolean + fun isMapToolbarEnabled(viewId: Long): Boolean + fun isTrafficEnabled(viewId: Long): Boolean + fun getMarkers(viewId: Long): List + fun addMarkers(viewId: Long, markers: List): List + fun updateMarkers(viewId: Long, markers: List): List + fun removeMarkers(viewId: Long, markers: List) + fun clearMarkers(viewId: Long) + fun clear(viewId: Long) + fun getPolygons(viewId: Long): List + fun addPolygons(viewId: Long, polygons: List): List + fun updatePolygons(viewId: Long, polygons: List): List + fun removePolygons(viewId: Long, polygons: List) + fun clearPolygons(viewId: Long) + fun getPolylines(viewId: Long): List + fun addPolylines(viewId: Long, polylines: List): List + fun updatePolylines(viewId: Long, polylines: List): List + fun removePolylines(viewId: Long, polylines: List) + fun clearPolylines(viewId: Long) + fun getCircles(viewId: Long): List + fun addCircles(viewId: Long, circles: List): List + fun updateCircles(viewId: Long, circles: List): List + fun removeCircles(viewId: Long, circles: List) + fun clearCircles(viewId: Long) + fun registerOnCameraChangedListener(viewId: Long) companion object { /** The codec used by MapViewApi. */ - val codec: MessageCodec by lazy { - MapViewApiCodec - } + val codec: MessageCodec by lazy { MapViewApiCodec } /** Sets up an instance of `MapViewApi` to handle messages through the `binaryMessenger`. */ @Suppress("UNCHECKED_CAST") fun setUp(binaryMessenger: BinaryMessenger, api: MapViewApi?) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2112,7 +2279,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2130,7 +2302,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2150,7 +2327,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2168,7 +2350,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2186,7 +2373,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2206,7 +2398,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2226,7 +2423,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2244,7 +2446,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2264,7 +2471,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2282,7 +2494,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2302,7 +2519,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2320,7 +2542,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2340,7 +2567,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2358,7 +2590,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2378,7 +2615,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2396,7 +2638,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2416,7 +2663,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2434,7 +2686,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2454,7 +2711,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2472,7 +2734,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2492,7 +2759,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2510,7 +2782,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2530,7 +2807,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2548,7 +2830,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2566,7 +2853,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2587,14 +2879,20 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val viewIdArg = args[0].let { if (it is Int) it.toLong() else it as Long } val cameraPositionArg = args[1] as CameraPositionDto val durationArg = args[2].let { if (it is Int) it.toLong() else it as Long? } - api.animateCameraToCameraPosition(viewIdArg, cameraPositionArg, durationArg) { result: Result -> + api.animateCameraToCameraPosition(viewIdArg, cameraPositionArg, durationArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2609,7 +2907,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2631,7 +2934,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2639,7 +2947,8 @@ interface MapViewApi { val boundsArg = args[1] as LatLngBoundsDto val paddingArg = args[2] as Double val durationArg = args[3].let { if (it is Int) it.toLong() else it as Long? } - api.animateCameraToLatLngBounds(viewIdArg, boundsArg, paddingArg, durationArg) { result: Result -> + api.animateCameraToLatLngBounds(viewIdArg, boundsArg, paddingArg, durationArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2654,7 +2963,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2662,7 +2976,8 @@ interface MapViewApi { val pointArg = args[1] as LatLngDto val zoomArg = args[2] as Double val durationArg = args[3].let { if (it is Int) it.toLong() else it as Long? } - api.animateCameraToLatLngZoom(viewIdArg, pointArg, zoomArg, durationArg) { result: Result -> + api.animateCameraToLatLngZoom(viewIdArg, pointArg, zoomArg, durationArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2677,7 +2992,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2685,7 +3005,8 @@ interface MapViewApi { val scrollByDxArg = args[1] as Double val scrollByDyArg = args[2] as Double val durationArg = args[3].let { if (it is Int) it.toLong() else it as Long? } - api.animateCameraByScroll(viewIdArg, scrollByDxArg, scrollByDyArg, durationArg) { result: Result -> + api.animateCameraByScroll(viewIdArg, scrollByDxArg, scrollByDyArg, durationArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2700,7 +3021,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2709,7 +3035,8 @@ interface MapViewApi { val focusDxArg = args[2] as Double? val focusDyArg = args[3] as Double? val durationArg = args[4].let { if (it is Int) it.toLong() else it as Long? } - api.animateCameraByZoom(viewIdArg, zoomByArg, focusDxArg, focusDyArg, durationArg) { result: Result -> + api.animateCameraByZoom(viewIdArg, zoomByArg, focusDxArg, focusDyArg, durationArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2724,7 +3051,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2746,7 +3078,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2766,7 +3103,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2786,7 +3128,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2807,7 +3154,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2828,7 +3180,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2849,7 +3206,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2871,7 +3233,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2891,7 +3258,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2910,7 +3282,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2928,7 +3305,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2946,7 +3328,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2965,7 +3352,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2985,7 +3377,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3005,7 +3402,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3025,7 +3427,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3045,7 +3452,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3065,7 +3477,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3085,7 +3502,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3105,7 +3527,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3125,7 +3552,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3145,7 +3577,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3165,7 +3602,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3185,7 +3627,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3205,7 +3652,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3225,7 +3677,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3243,7 +3700,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3261,7 +3723,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3279,7 +3746,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3297,7 +3769,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3315,7 +3792,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3333,7 +3815,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3351,7 +3838,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3369,7 +3861,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3387,7 +3884,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3405,7 +3907,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3423,7 +3930,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3441,7 +3953,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3460,7 +3977,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3479,7 +4001,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3499,7 +4026,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3518,7 +4050,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3537,7 +4074,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3555,7 +4097,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3574,7 +4121,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3593,7 +4145,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3613,7 +4170,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3632,7 +4194,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3650,7 +4217,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3669,7 +4241,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3688,7 +4265,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3708,7 +4290,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3727,7 +4314,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3745,7 +4337,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3764,7 +4361,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3783,7 +4385,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3803,7 +4410,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3822,7 +4434,12 @@ interface MapViewApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3843,24 +4460,22 @@ interface MapViewApi { } } } + @Suppress("UNCHECKED_CAST") private object ImageRegistryApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - ImageDescriptorDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { ImageDescriptorDto.fromList(it) } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - ImageDescriptorDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { ImageDescriptorDto.fromList(it) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is ImageDescriptorDto -> { stream.write(128) @@ -3877,21 +4492,35 @@ private object ImageRegistryApiCodec : StandardMessageCodec() { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface ImageRegistryApi { - fun registerBitmapImage(imageId: String, bytes: ByteArray, imagePixelRatio: Double, width: Double?, height: Double?): ImageDescriptorDto + fun registerBitmapImage( + imageId: String, + bytes: ByteArray, + imagePixelRatio: Double, + width: Double?, + height: Double? + ): ImageDescriptorDto + fun unregisterImage(imageDescriptor: ImageDescriptorDto) + fun getRegisteredImages(): List + fun clearRegisteredImages() companion object { /** The codec used by ImageRegistryApi. */ - val codec: MessageCodec by lazy { - ImageRegistryApiCodec - } - /** Sets up an instance of `ImageRegistryApi` to handle messages through the `binaryMessenger`. */ + val codec: MessageCodec by lazy { ImageRegistryApiCodec } + /** + * Sets up an instance of `ImageRegistryApi` to handle messages through the `binaryMessenger`. + */ @Suppress("UNCHECKED_CAST") fun setUp(binaryMessenger: BinaryMessenger, api: ImageRegistryApi?) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3902,7 +4531,16 @@ interface ImageRegistryApi { val heightArg = args[4] as Double? var wrapped: List try { - wrapped = listOf(api.registerBitmapImage(imageIdArg, bytesArg, imagePixelRatioArg, widthArg, heightArg)) + wrapped = + listOf( + api.registerBitmapImage( + imageIdArg, + bytesArg, + imagePixelRatioArg, + widthArg, + heightArg + ) + ) } catch (exception: Throwable) { wrapped = wrapError(exception) } @@ -3913,7 +4551,12 @@ interface ImageRegistryApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3932,7 +4575,12 @@ interface ImageRegistryApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -3948,7 +4596,12 @@ interface ImageRegistryApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -3967,24 +4620,22 @@ interface ImageRegistryApi { } } } + @Suppress("UNCHECKED_CAST") private object ViewEventApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - CameraPositionDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { CameraPositionDto.fromList(it) } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - LatLngDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is CameraPositionDto -> { stream.write(128) @@ -4004,10 +4655,9 @@ private object ViewEventApiCodec : StandardMessageCodec() { class ViewEventApi(private val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by ViewEventApi. */ - val codec: MessageCodec by lazy { - ViewEventApiCodec - } + val codec: MessageCodec by lazy { ViewEventApiCodec } } + fun onMapClickEvent(viewIdArg: Long, latLngArg: LatLngDto, callback: (Result) -> Unit) { val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -4020,11 +4670,13 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onMapLongClickEvent(viewIdArg: Long, latLngArg: LatLngDto, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, latLngArg)) { if (it is List<*>) { @@ -4035,11 +4687,13 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onRecenterButtonClicked(viewIdArg: Long, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg)) { if (it is List<*>) { @@ -4050,10 +4704,16 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onMarkerEvent(viewIdArg: Long, markerIdArg: String, eventTypeArg: MarkerEventTypeDto, callback: (Result) -> Unit) { + + fun onMarkerEvent( + viewIdArg: Long, + markerIdArg: String, + eventTypeArg: MarkerEventTypeDto, + callback: (Result) -> Unit + ) { val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, markerIdArg, eventTypeArg.raw)) { @@ -4065,10 +4725,17 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onMarkerDragEvent(viewIdArg: Long, markerIdArg: String, eventTypeArg: MarkerDragEventTypeDto, positionArg: LatLngDto, callback: (Result) -> Unit) { + + fun onMarkerDragEvent( + viewIdArg: Long, + markerIdArg: String, + eventTypeArg: MarkerDragEventTypeDto, + positionArg: LatLngDto, + callback: (Result) -> Unit + ) { val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, markerIdArg, eventTypeArg.raw, positionArg)) { @@ -4080,9 +4747,10 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onPolygonClicked(viewIdArg: Long, polygonIdArg: String, callback: (Result) -> Unit) { val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -4095,9 +4763,10 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onPolylineClicked(viewIdArg: Long, polylineIdArg: String, callback: (Result) -> Unit) { val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -4110,9 +4779,10 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onCircleClicked(viewIdArg: Long, circleIdArg: String, callback: (Result) -> Unit) { val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -4125,11 +4795,17 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onNavigationUIEnabledChanged(viewIdArg: Long, navigationUIEnabledArg: Boolean, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged" + + fun onNavigationUIEnabledChanged( + viewIdArg: Long, + navigationUIEnabledArg: Boolean, + callback: (Result) -> Unit + ) { + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, navigationUIEnabledArg)) { if (it is List<*>) { @@ -4140,11 +4816,13 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onMyLocationClicked(viewIdArg: Long, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg)) { if (it is List<*>) { @@ -4155,11 +4833,13 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onMyLocationButtonClicked(viewIdArg: Long, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg)) { if (it is List<*>) { @@ -4170,10 +4850,16 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onCameraChanged(viewIdArg: Long, eventTypeArg: CameraEventTypeDto, positionArg: CameraPositionDto, callback: (Result) -> Unit) { + + fun onCameraChanged( + viewIdArg: Long, + eventTypeArg: CameraEventTypeDto, + positionArg: CameraPositionDto, + callback: (Result) -> Unit + ) { val channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(viewIdArg, eventTypeArg.raw, positionArg)) { @@ -4185,28 +4871,23 @@ class ViewEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } + @Suppress("UNCHECKED_CAST") private object NavigationSessionApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - DestinationsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { DestinationsDto.fromList(it) } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - LatLngDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { - LatLngDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } } 131.toByte() -> { return (readValue(buffer) as? List)?.let { @@ -4214,39 +4895,25 @@ private object NavigationSessionApiCodec : StandardMessageCodec() { } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { - NavigationDisplayOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { NavigationDisplayOptionsDto.fromList(it) } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { - NavigationTimeAndDistanceDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { NavigationTimeAndDistanceDto.fromList(it) } } 134.toByte() -> { - return (readValue(buffer) as? List)?.let { - NavigationWaypointDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { NavigationWaypointDto.fromList(it) } } 135.toByte() -> { - return (readValue(buffer) as? List)?.let { - NavigationWaypointDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { NavigationWaypointDto.fromList(it) } } 136.toByte() -> { - return (readValue(buffer) as? List)?.let { - RouteSegmentDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { RouteSegmentDto.fromList(it) } } 137.toByte() -> { - return (readValue(buffer) as? List)?.let { - RouteSegmentDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { RouteSegmentDto.fromList(it) } } 138.toByte() -> { - return (readValue(buffer) as? List)?.let { - RouteSegmentTrafficDataDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { RouteSegmentTrafficDataDto.fromList(it) } } 139.toByte() -> { return (readValue(buffer) as? List)?.let { @@ -4254,29 +4921,22 @@ private object NavigationSessionApiCodec : StandardMessageCodec() { } } 140.toByte() -> { - return (readValue(buffer) as? List)?.let { - RouteTokenOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { RouteTokenOptionsDto.fromList(it) } } 141.toByte() -> { - return (readValue(buffer) as? List)?.let { - RoutingOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { RoutingOptionsDto.fromList(it) } } 142.toByte() -> { - return (readValue(buffer) as? List)?.let { - SimulationOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { SimulationOptionsDto.fromList(it) } } 143.toByte() -> { - return (readValue(buffer) as? List)?.let { - SpeedAlertOptionsDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { SpeedAlertOptionsDto.fromList(it) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is DestinationsDto -> { stream.write(128) @@ -4350,61 +5010,119 @@ private object NavigationSessionApiCodec : StandardMessageCodec() { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface NavigationSessionApi { /** General. */ - fun createNavigationSession(abnormalTerminationReportingEnabled: Boolean, callback: (Result) -> Unit) + fun createNavigationSession( + abnormalTerminationReportingEnabled: Boolean, + callback: (Result) -> Unit + ) + fun isInitialized(): Boolean + fun cleanup() - fun showTermsAndConditionsDialog(title: String, companyName: String, shouldOnlyShowDriverAwarenessDisclaimer: Boolean, callback: (Result) -> Unit) + + fun showTermsAndConditionsDialog( + title: String, + companyName: String, + shouldOnlyShowDriverAwarenessDisclaimer: Boolean, + callback: (Result) -> Unit + ) + fun areTermsAccepted(): Boolean + fun resetTermsAccepted() + fun getNavSDKVersion(): String /** Navigation. */ fun isGuidanceRunning(): Boolean + fun startGuidance() + fun stopGuidance() + fun setDestinations(destinations: DestinationsDto, callback: (Result) -> Unit) + fun clearDestinations() + fun continueToNextDestination(): NavigationWaypointDto? + fun getCurrentTimeAndDistance(): NavigationTimeAndDistanceDto + fun setAudioGuidance(settings: NavigationAudioGuidanceSettingsDto) + fun setSpeedAlertOptions(options: SpeedAlertOptionsDto) + fun getRouteSegments(): List + fun getTraveledRoute(): List + fun getCurrentRouteSegment(): RouteSegmentDto? /** Simulation */ fun setUserLocation(location: LatLngDto) + fun removeUserLocation() + fun simulateLocationsAlongExistingRoute() + fun simulateLocationsAlongExistingRouteWithOptions(options: SimulationOptionsDto) - fun simulateLocationsAlongNewRoute(waypoints: List, callback: (Result) -> Unit) - fun simulateLocationsAlongNewRouteWithRoutingOptions(waypoints: List, routingOptions: RoutingOptionsDto, callback: (Result) -> Unit) - fun simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(waypoints: List, routingOptions: RoutingOptionsDto, simulationOptions: SimulationOptionsDto, callback: (Result) -> Unit) + + fun simulateLocationsAlongNewRoute( + waypoints: List, + callback: (Result) -> Unit + ) + + fun simulateLocationsAlongNewRouteWithRoutingOptions( + waypoints: List, + routingOptions: RoutingOptionsDto, + callback: (Result) -> Unit + ) + + fun simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( + waypoints: List, + routingOptions: RoutingOptionsDto, + simulationOptions: SimulationOptionsDto, + callback: (Result) -> Unit + ) + fun pauseSimulation() + fun resumeSimulation() /** Simulation (iOS only) */ fun allowBackgroundLocationUpdates(allow: Boolean) /** Road snapped location updates. */ fun enableRoadSnappedLocationUpdates() + fun disableRoadSnappedLocationUpdates() /** Enable Turn-by-Turn navigation events. */ fun enableTurnByTurnNavigationEvents(numNextStepsToPreview: Long?) + fun disableTurnByTurnNavigationEvents() - fun registerRemainingTimeOrDistanceChangedListener(remainingTimeThresholdSeconds: Long, remainingDistanceThresholdMeters: Long) + + fun registerRemainingTimeOrDistanceChangedListener( + remainingTimeThresholdSeconds: Long, + remainingDistanceThresholdMeters: Long + ) companion object { /** The codec used by NavigationSessionApi. */ - val codec: MessageCodec by lazy { - NavigationSessionApiCodec - } - /** Sets up an instance of `NavigationSessionApi` to handle messages through the `binaryMessenger`. */ + val codec: MessageCodec by lazy { NavigationSessionApiCodec } + /** + * Sets up an instance of `NavigationSessionApi` to handle messages through the + * `binaryMessenger`. + */ @Suppress("UNCHECKED_CAST") fun setUp(binaryMessenger: BinaryMessenger, api: NavigationSessionApi?) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val abnormalTerminationReportingEnabledArg = args[0] as Boolean - api.createNavigationSession(abnormalTerminationReportingEnabledArg) { result: Result -> + api.createNavigationSession(abnormalTerminationReportingEnabledArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -4418,7 +5136,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4434,7 +5157,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4451,14 +5179,23 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val titleArg = args[0] as String val companyNameArg = args[1] as String val shouldOnlyShowDriverAwarenessDisclaimerArg = args[2] as Boolean - api.showTermsAndConditionsDialog(titleArg, companyNameArg, shouldOnlyShowDriverAwarenessDisclaimerArg) { result: Result -> + api.showTermsAndConditionsDialog( + titleArg, + companyNameArg, + shouldOnlyShowDriverAwarenessDisclaimerArg + ) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -4473,7 +5210,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4489,7 +5231,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4506,7 +5253,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4522,7 +5274,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4538,7 +5295,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4555,7 +5317,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4572,7 +5339,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4592,7 +5364,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4609,7 +5386,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4625,7 +5407,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4641,7 +5428,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4660,7 +5452,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4679,7 +5476,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4695,7 +5497,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4711,7 +5518,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4727,7 +5539,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4746,7 +5563,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4763,7 +5585,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4780,7 +5607,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4799,7 +5631,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4819,13 +5656,19 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val waypointsArg = args[0] as List val routingOptionsArg = args[1] as RoutingOptionsDto - api.simulateLocationsAlongNewRouteWithRoutingOptions(waypointsArg, routingOptionsArg) { result: Result -> + api.simulateLocationsAlongNewRouteWithRoutingOptions(waypointsArg, routingOptionsArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -4840,14 +5683,23 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val waypointsArg = args[0] as List val routingOptionsArg = args[1] as RoutingOptionsDto val simulationOptionsArg = args[2] as SimulationOptionsDto - api.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(waypointsArg, routingOptionsArg, simulationOptionsArg) { result: Result -> + api.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( + waypointsArg, + routingOptionsArg, + simulationOptionsArg + ) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -4862,7 +5714,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4879,7 +5736,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4896,7 +5758,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4915,7 +5782,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4932,7 +5804,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4949,11 +5826,17 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val numNextStepsToPreviewArg = args[0].let { if (it is Int) it.toLong() else it as Long? } + val numNextStepsToPreviewArg = + args[0].let { if (it is Int) it.toLong() else it as Long? } var wrapped: List try { api.enableTurnByTurnNavigationEvents(numNextStepsToPreviewArg) @@ -4968,7 +5851,12 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> var wrapped: List @@ -4985,15 +5873,25 @@ interface NavigationSessionApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val remainingTimeThresholdSecondsArg = args[0].let { if (it is Int) it.toLong() else it as Long } - val remainingDistanceThresholdMetersArg = args[1].let { if (it is Int) it.toLong() else it as Long } + val remainingTimeThresholdSecondsArg = + args[0].let { if (it is Int) it.toLong() else it as Long } + val remainingDistanceThresholdMetersArg = + args[1].let { if (it is Int) it.toLong() else it as Long } var wrapped: List try { - api.registerRemainingTimeOrDistanceChangedListener(remainingTimeThresholdSecondsArg, remainingDistanceThresholdMetersArg) + api.registerRemainingTimeOrDistanceChangedListener( + remainingTimeThresholdSecondsArg, + remainingDistanceThresholdMetersArg + ) wrapped = listOf(null) } catch (exception: Throwable) { wrapped = wrapError(exception) @@ -5007,54 +5905,40 @@ interface NavigationSessionApi { } } } + @Suppress("UNCHECKED_CAST") private object NavigationSessionEventApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - LaneDirectionDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LaneDirectionDto.fromList(it) } } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - LaneDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LaneDto.fromList(it) } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { - LatLngDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { LatLngDto.fromList(it) } } 131.toByte() -> { - return (readValue(buffer) as? List)?.let { - NavInfoDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { NavInfoDto.fromList(it) } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { - NavigationWaypointDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { NavigationWaypointDto.fromList(it) } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { - SpeedingUpdatedEventDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { SpeedingUpdatedEventDto.fromList(it) } } 134.toByte() -> { - return (readValue(buffer) as? List)?.let { - StepInfoDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { StepInfoDto.fromList(it) } } 135.toByte() -> { - return (readValue(buffer) as? List)?.let { - StepInfoDto.fromList(it) - } + return (readValue(buffer) as? List)?.let { StepInfoDto.fromList(it) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is LaneDirectionDto -> { stream.write(128) @@ -5098,12 +5982,12 @@ private object NavigationSessionEventApiCodec : StandardMessageCodec() { class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by NavigationSessionEventApi. */ - val codec: MessageCodec by lazy { - NavigationSessionEventApiCodec - } + val codec: MessageCodec by lazy { NavigationSessionEventApiCodec } } + fun onSpeedingUpdated(msgArg: SpeedingUpdatedEventDto, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(msgArg)) { if (it is List<*>) { @@ -5114,11 +5998,13 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onRoadSnappedLocationUpdated(locationArg: LatLngDto, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(locationArg)) { if (it is List<*>) { @@ -5129,11 +6015,13 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onRoadSnappedRawLocationUpdated(locationArg: LatLngDto, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(locationArg)) { if (it is List<*>) { @@ -5144,11 +6032,13 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onArrival(waypointArg: NavigationWaypointDto, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(waypointArg)) { if (it is List<*>) { @@ -5159,11 +6049,13 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + fun onRouteChanged(callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -5174,11 +6066,17 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun onRemainingTimeOrDistanceChanged(remainingTimeArg: Double, remainingDistanceArg: Double, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged" + + fun onRemainingTimeOrDistanceChanged( + remainingTimeArg: Double, + remainingDistanceArg: Double, + callback: (Result) -> Unit + ) { + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(remainingTimeArg, remainingDistanceArg)) { if (it is List<*>) { @@ -5189,12 +6087,13 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Android-only event. */ fun onTrafficUpdated(callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -5205,12 +6104,13 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Android-only event. */ fun onRerouting(callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -5221,12 +6121,13 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Android-only event. */ fun onGpsAvailabilityUpdate(availableArg: Boolean, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(availableArg)) { if (it is List<*>) { @@ -5237,12 +6138,13 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Turn-by-Turn navigation events. */ fun onNavInfo(navInfoArg: NavInfoDto, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo" + val channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(navInfoArg)) { if (it is List<*>) { @@ -5253,7 +6155,7 @@ class NavigationSessionEventApi(private val binaryMessenger: BinaryMessenger) { } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } @@ -5263,14 +6165,20 @@ interface NavigationInspector { companion object { /** The codec used by NavigationInspector. */ - val codec: MessageCodec by lazy { - StandardMessageCodec() - } - /** Sets up an instance of `NavigationInspector` to handle messages through the `binaryMessenger`. */ + val codec: MessageCodec by lazy { StandardMessageCodec() } + /** + * Sets up an instance of `NavigationInspector` to handle messages through the + * `binaryMessenger`. + */ @Suppress("UNCHECKED_CAST") fun setUp(binaryMessenger: BinaryMessenger, api: NavigationInspector?) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession", + codec + ) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List diff --git a/ios/Classes/GoogleMapsNavigationViewFactory.swift b/ios/Classes/GoogleMapsNavigationViewFactory.swift index 19a8615..52cbc57 100644 --- a/ios/Classes/GoogleMapsNavigationViewFactory.swift +++ b/ios/Classes/GoogleMapsNavigationViewFactory.swift @@ -51,7 +51,8 @@ class GoogleMapsNavigationViewFactory: NSObject, FlutterPlatformViewFactory { viewRegistry: viewRegistry, viewEventApi: viewEventApi, navigationUIEnabledPreference: Convert - .convertNavigationUIEnabledPreference(preference: params.navigationViewOptions?.navigationUIEnabledPreference), + .convertNavigationUIEnabledPreference(preference: params.navigationViewOptions? + .navigationUIEnabledPreference), mapConfiguration: mapConfiguration, imageRegistry: imageRegistry ) diff --git a/ios/Classes/messages.g.swift b/ios/Classes/messages.g.swift index 9856d30..2fb20aa 100644 --- a/ios/Classes/messages.g.swift +++ b/ios/Classes/messages.g.swift @@ -1,31 +1,31 @@ // Copyright 2023 Google LLC -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // https://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Autogenerated from Pigeon (v15.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation #if os(iOS) -import Flutter + import Flutter #elseif os(macOS) -import FlutterMacOS + import FlutterMacOS #else -#error("Unsupported platform.") + #error("Unsupported platform.") #endif private func wrapResult(_ result: Any?) -> [Any?] { - return [result] + [result] } private func wrapError(_ error: Any) -> [Any?] { @@ -33,22 +33,26 @@ private func wrapError(_ error: Any) -> [Any?] { return [ flutterError.code, flutterError.message, - flutterError.details + flutterError.details, ] } return [ "\(error)", "\(type(of: error))", - "Stacktrace: \(Thread.callStackSymbols)" + "Stacktrace: \(Thread.callStackSymbols)", ] } private func createConnectionError(withChannelName channelName: String) -> FlutterError { - return FlutterError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") + FlutterError( + code: "channel-error", + message: "Unable to establish connection on channel: '\(channelName)'.", + details: "" + ) } private func isNullish(_ value: Any?) -> Bool { - return value is NSNull || value == nil + value is NSNull || value == nil } private func nilOrValue(_ value: Any?) -> T? { @@ -58,7 +62,8 @@ private func nilOrValue(_ value: Any?) -> T? { /// Describes the type of map to construct. enum MapViewTypeDto: Int { - /// Navigation view supports navigation overlay, and current navigation session is displayed on the map. + /// Navigation view supports navigation overlay, and current navigation session is displayed on + /// the map. case navigation = 0 /// Classic map view, without navigation overlay. case map = 1 @@ -289,9 +294,11 @@ enum ManeuverDto: Int { case roundaboutStraightClockwise = 50 /// Enter a roundabout in the counterclockwise direction and continue straight. case roundaboutStraightCounterclockwise = 51 - /// Enter a roundabout in the clockwise direction and turn clockwise onto the opposite side of the street. + /// Enter a roundabout in the clockwise direction and turn clockwise onto the opposite side of the + /// street. case roundaboutUTurnClockwise = 52 - /// Enter a roundabout in the counterclockwise direction and turn counterclockwise onto the opposite side of the street. + /// Enter a roundabout in the counterclockwise direction and turn counterclockwise onto the + /// opposite side of the street. case roundaboutUTurnCounterclockwise = 53 /// Continue straight. case straight = 54 @@ -388,14 +395,14 @@ struct MapOptionsDto { /// If true, enables the map toolbar. var mapToolbarEnabled: Bool /// The minimum zoom level that can be set for the map. - var minZoomPreference: Double? = nil + var minZoomPreference: Double? /// The maximum zoom level that can be set for the map. - var maxZoomPreference: Double? = nil + var maxZoomPreference: Double? /// If true, enables zoom controls for the map. var zoomControlsEnabled: Bool /// Specifies a bounds to constrain the camera target, so that when users scroll and pan the map, /// the camera target does not move outside these bounds. - var cameraTargetBounds: LatLngBoundsDto? = nil + var cameraTargetBounds: LatLngBoundsDto? static func fromList(_ list: [Any?]) -> MapOptionsDto? { let cameraPosition = CameraPositionDto.fromList(list[0] as! [Any?])! @@ -410,7 +417,7 @@ struct MapOptionsDto { let minZoomPreference: Double? = nilOrValue(list[9]) let maxZoomPreference: Double? = nilOrValue(list[10]) let zoomControlsEnabled = list[11] as! Bool - var cameraTargetBounds: LatLngBoundsDto? = nil + var cameraTargetBounds: LatLngBoundsDto? if let cameraTargetBoundsList: [Any?] = nilOrValue(list[12]) { cameraTargetBounds = LatLngBoundsDto.fromList(cameraTargetBoundsList) } @@ -431,8 +438,9 @@ struct MapOptionsDto { cameraTargetBounds: cameraTargetBounds ) } + func toList() -> [Any?] { - return [ + [ cameraPosition.toList(), mapType.rawValue, compassEnabled, @@ -464,8 +472,9 @@ struct NavigationViewOptionsDto { navigationUIEnabledPreference: navigationUIEnabledPreference ) } + func toList() -> [Any?] { - return [ + [ navigationUIEnabledPreference.rawValue, ] } @@ -480,12 +489,12 @@ struct NavigationViewOptionsDto { struct ViewCreationOptionsDto { var mapViewType: MapViewTypeDto var mapOptions: MapOptionsDto - var navigationViewOptions: NavigationViewOptionsDto? = nil + var navigationViewOptions: NavigationViewOptionsDto? static func fromList(_ list: [Any?]) -> ViewCreationOptionsDto? { let mapViewType = MapViewTypeDto(rawValue: list[0] as! Int)! let mapOptions = MapOptionsDto.fromList(list[1] as! [Any?])! - var navigationViewOptions: NavigationViewOptionsDto? = nil + var navigationViewOptions: NavigationViewOptionsDto? if let navigationViewOptionsList: [Any?] = nilOrValue(list[2]) { navigationViewOptions = NavigationViewOptionsDto.fromList(navigationViewOptionsList) } @@ -496,8 +505,9 @@ struct ViewCreationOptionsDto { navigationViewOptions: navigationViewOptions ) } + func toList() -> [Any?] { - return [ + [ mapViewType.rawValue, mapOptions.toList(), navigationViewOptions?.toList(), @@ -525,8 +535,9 @@ struct CameraPositionDto { zoom: zoom ) } + func toList() -> [Any?] { - return [ + [ bearing, target.toList(), tilt, @@ -551,8 +562,9 @@ struct MarkerDto { options: options ) } + func toList() -> [Any?] { - return [ + [ markerId, options.toList(), ] @@ -600,8 +612,9 @@ struct MarkerOptionsDto { icon: icon ) } + func toList() -> [Any?] { - return [ + [ alpha, anchor.toList(), draggable, @@ -619,10 +632,10 @@ struct MarkerOptionsDto { /// Generated class from Pigeon that represents data sent in messages. struct ImageDescriptorDto { - var registeredImageId: String? = nil - var imagePixelRatio: Double? = nil - var width: Double? = nil - var height: Double? = nil + var registeredImageId: String? + var imagePixelRatio: Double? + var width: Double? + var height: Double? static func fromList(_ list: [Any?]) -> ImageDescriptorDto? { let registeredImageId: String? = nilOrValue(list[0]) @@ -637,8 +650,9 @@ struct ImageDescriptorDto { height: height ) } + func toList() -> [Any?] { - return [ + [ registeredImageId, imagePixelRatio, width, @@ -649,8 +663,8 @@ struct ImageDescriptorDto { /// Generated class from Pigeon that represents data sent in messages. struct InfoWindowDto { - var title: String? = nil - var snippet: String? = nil + var title: String? + var snippet: String? var anchor: MarkerAnchorDto static func fromList(_ list: [Any?]) -> InfoWindowDto? { @@ -664,8 +678,9 @@ struct InfoWindowDto { anchor: anchor ) } + func toList() -> [Any?] { - return [ + [ title, snippet, anchor.toList(), @@ -687,8 +702,9 @@ struct MarkerAnchorDto { v: v ) } + func toList() -> [Any?] { - return [ + [ u, v, ] @@ -709,8 +725,9 @@ struct PolygonDto { options: options ) } + func toList() -> [Any?] { - return [ + [ polygonId, options.toList(), ] @@ -752,8 +769,9 @@ struct PolygonOptionsDto { zIndex: zIndex ) } + func toList() -> [Any?] { - return [ + [ points, holes, clickable, @@ -778,8 +796,9 @@ struct PolygonHoleDto { points: points ) } + func toList() -> [Any?] { - return [ + [ points, ] } @@ -787,14 +806,17 @@ struct PolygonHoleDto { /// Generated class from Pigeon that represents data sent in messages. struct StyleSpanStrokeStyleDto { - var solidColor: Int64? = nil - var fromColor: Int64? = nil - var toColor: Int64? = nil + var solidColor: Int64? + var fromColor: Int64? + var toColor: Int64? static func fromList(_ list: [Any?]) -> StyleSpanStrokeStyleDto? { - let solidColor: Int64? = isNullish(list[0]) ? nil : (list[0] is Int64? ? list[0] as! Int64? : Int64(list[0] as! Int32)) - let fromColor: Int64? = isNullish(list[1]) ? nil : (list[1] is Int64? ? list[1] as! Int64? : Int64(list[1] as! Int32)) - let toColor: Int64? = isNullish(list[2]) ? nil : (list[2] is Int64? ? list[2] as! Int64? : Int64(list[2] as! Int32)) + let solidColor: Int64? = isNullish(list[0]) ? nil : + (list[0] is Int64? ? list[0] as! Int64? : Int64(list[0] as! Int32)) + let fromColor: Int64? = isNullish(list[1]) ? nil : + (list[1] is Int64? ? list[1] as! Int64? : Int64(list[1] as! Int32)) + let toColor: Int64? = isNullish(list[2]) ? nil : + (list[2] is Int64? ? list[2] as! Int64? : Int64(list[2] as! Int32)) return StyleSpanStrokeStyleDto( solidColor: solidColor, @@ -802,8 +824,9 @@ struct StyleSpanStrokeStyleDto { toColor: toColor ) } + func toList() -> [Any?] { - return [ + [ solidColor, fromColor, toColor, @@ -825,8 +848,9 @@ struct StyleSpanDto { style: style ) } + func toList() -> [Any?] { - return [ + [ length, style.toList(), ] @@ -847,8 +871,9 @@ struct PolylineDto { options: options ) } + func toList() -> [Any?] { - return [ + [ polylineId, options.toList(), ] @@ -858,7 +883,7 @@ struct PolylineDto { /// Generated class from Pigeon that represents data sent in messages. struct PatternItemDto { var type: PatternTypeDto - var length: Double? = nil + var length: Double? static func fromList(_ list: [Any?]) -> PatternItemDto? { let type = PatternTypeDto(rawValue: list[0] as! Int)! @@ -869,8 +894,9 @@ struct PatternItemDto { length: length ) } + func toList() -> [Any?] { - return [ + [ type.rawValue, length, ] @@ -879,23 +905,24 @@ struct PatternItemDto { /// Generated class from Pigeon that represents data sent in messages. struct PolylineOptionsDto { - var points: [LatLngDto?]? = nil - var clickable: Bool? = nil - var geodesic: Bool? = nil - var strokeColor: Int64? = nil - var strokeJointType: StrokeJointTypeDto? = nil - var strokePattern: [PatternItemDto?]? = nil - var strokeWidth: Double? = nil - var visible: Bool? = nil - var zIndex: Double? = nil + var points: [LatLngDto?]? + var clickable: Bool? + var geodesic: Bool? + var strokeColor: Int64? + var strokeJointType: StrokeJointTypeDto? + var strokePattern: [PatternItemDto?]? + var strokeWidth: Double? + var visible: Bool? + var zIndex: Double? var spans: [StyleSpanDto?] static func fromList(_ list: [Any?]) -> PolylineOptionsDto? { let points: [LatLngDto?]? = nilOrValue(list[0]) let clickable: Bool? = nilOrValue(list[1]) let geodesic: Bool? = nilOrValue(list[2]) - let strokeColor: Int64? = isNullish(list[3]) ? nil : (list[3] is Int64? ? list[3] as! Int64? : Int64(list[3] as! Int32)) - var strokeJointType: StrokeJointTypeDto? = nil + let strokeColor: Int64? = isNullish(list[3]) ? nil : + (list[3] is Int64? ? list[3] as! Int64? : Int64(list[3] as! Int32)) + var strokeJointType: StrokeJointTypeDto? let strokeJointTypeEnumVal: Int? = nilOrValue(list[4]) if let strokeJointTypeRawValue = strokeJointTypeEnumVal { strokeJointType = StrokeJointTypeDto(rawValue: strokeJointTypeRawValue)! @@ -919,8 +946,9 @@ struct PolylineOptionsDto { spans: spans ) } + func toList() -> [Any?] { - return [ + [ points, clickable, geodesic, @@ -951,8 +979,9 @@ struct CircleDto { options: options ) } + func toList() -> [Any?] { - return [ + [ circleId, options.toList(), ] @@ -994,8 +1023,9 @@ struct CircleOptionsDto { clickable: clickable ) } + func toList() -> [Any?] { - return [ + [ position.toList(), radius, strokeWidth, @@ -1012,11 +1042,11 @@ struct CircleOptionsDto { /// Generated class from Pigeon that represents data sent in messages. struct RouteTokenOptionsDto { var routeToken: String - var travelMode: TravelModeDto? = nil + var travelMode: TravelModeDto? static func fromList(_ list: [Any?]) -> RouteTokenOptionsDto? { let routeToken = list[0] as! String - var travelMode: TravelModeDto? = nil + var travelMode: TravelModeDto? let travelModeEnumVal: Int? = nilOrValue(list[1]) if let travelModeRawValue = travelModeEnumVal { travelMode = TravelModeDto(rawValue: travelModeRawValue)! @@ -1027,8 +1057,9 @@ struct RouteTokenOptionsDto { travelMode: travelMode ) } + func toList() -> [Any?] { - return [ + [ routeToken, travelMode?.rawValue, ] @@ -1039,17 +1070,17 @@ struct RouteTokenOptionsDto { struct DestinationsDto { var waypoints: [NavigationWaypointDto?] var displayOptions: NavigationDisplayOptionsDto - var routingOptions: RoutingOptionsDto? = nil - var routeTokenOptions: RouteTokenOptionsDto? = nil + var routingOptions: RoutingOptionsDto? + var routeTokenOptions: RouteTokenOptionsDto? static func fromList(_ list: [Any?]) -> DestinationsDto? { let waypoints = list[0] as! [NavigationWaypointDto?] let displayOptions = NavigationDisplayOptionsDto.fromList(list[1] as! [Any?])! - var routingOptions: RoutingOptionsDto? = nil + var routingOptions: RoutingOptionsDto? if let routingOptionsList: [Any?] = nilOrValue(list[2]) { routingOptions = RoutingOptionsDto.fromList(routingOptionsList) } - var routeTokenOptions: RouteTokenOptionsDto? = nil + var routeTokenOptions: RouteTokenOptionsDto? if let routeTokenOptionsList: [Any?] = nilOrValue(list[3]) { routeTokenOptions = RouteTokenOptionsDto.fromList(routeTokenOptionsList) } @@ -1061,8 +1092,9 @@ struct DestinationsDto { routeTokenOptions: routeTokenOptions ) } + func toList() -> [Any?] { - return [ + [ waypoints, displayOptions.toList(), routingOptions?.toList(), @@ -1073,28 +1105,29 @@ struct DestinationsDto { /// Generated class from Pigeon that represents data sent in messages. struct RoutingOptionsDto { - var alternateRoutesStrategy: AlternateRoutesStrategyDto? = nil - var routingStrategy: RoutingStrategyDto? = nil - var targetDistanceMeters: [Int64?]? = nil - var travelMode: TravelModeDto? = nil - var avoidTolls: Bool? = nil - var avoidFerries: Bool? = nil - var avoidHighways: Bool? = nil - var locationTimeoutMs: Int64? = nil + var alternateRoutesStrategy: AlternateRoutesStrategyDto? + var routingStrategy: RoutingStrategyDto? + var targetDistanceMeters: [Int64?]? + var travelMode: TravelModeDto? + var avoidTolls: Bool? + var avoidFerries: Bool? + var avoidHighways: Bool? + var locationTimeoutMs: Int64? static func fromList(_ list: [Any?]) -> RoutingOptionsDto? { - var alternateRoutesStrategy: AlternateRoutesStrategyDto? = nil + var alternateRoutesStrategy: AlternateRoutesStrategyDto? let alternateRoutesStrategyEnumVal: Int? = nilOrValue(list[0]) if let alternateRoutesStrategyRawValue = alternateRoutesStrategyEnumVal { - alternateRoutesStrategy = AlternateRoutesStrategyDto(rawValue: alternateRoutesStrategyRawValue)! + alternateRoutesStrategy = + AlternateRoutesStrategyDto(rawValue: alternateRoutesStrategyRawValue)! } - var routingStrategy: RoutingStrategyDto? = nil + var routingStrategy: RoutingStrategyDto? let routingStrategyEnumVal: Int? = nilOrValue(list[1]) if let routingStrategyRawValue = routingStrategyEnumVal { routingStrategy = RoutingStrategyDto(rawValue: routingStrategyRawValue)! } let targetDistanceMeters: [Int64?]? = nilOrValue(list[2]) - var travelMode: TravelModeDto? = nil + var travelMode: TravelModeDto? let travelModeEnumVal: Int? = nilOrValue(list[3]) if let travelModeRawValue = travelModeEnumVal { travelMode = TravelModeDto(rawValue: travelModeRawValue)! @@ -1102,7 +1135,8 @@ struct RoutingOptionsDto { let avoidTolls: Bool? = nilOrValue(list[4]) let avoidFerries: Bool? = nilOrValue(list[5]) let avoidHighways: Bool? = nilOrValue(list[6]) - let locationTimeoutMs: Int64? = isNullish(list[7]) ? nil : (list[7] is Int64? ? list[7] as! Int64? : Int64(list[7] as! Int32)) + let locationTimeoutMs: Int64? = isNullish(list[7]) ? nil : + (list[7] is Int64? ? list[7] as! Int64? : Int64(list[7] as! Int32)) return RoutingOptionsDto( alternateRoutesStrategy: alternateRoutesStrategy, @@ -1115,8 +1149,9 @@ struct RoutingOptionsDto { locationTimeoutMs: locationTimeoutMs ) } + func toList() -> [Any?] { - return [ + [ alternateRoutesStrategy?.rawValue, routingStrategy?.rawValue, targetDistanceMeters, @@ -1131,9 +1166,9 @@ struct RoutingOptionsDto { /// Generated class from Pigeon that represents data sent in messages. struct NavigationDisplayOptionsDto { - var showDestinationMarkers: Bool? = nil - var showStopSigns: Bool? = nil - var showTrafficLights: Bool? = nil + var showDestinationMarkers: Bool? + var showStopSigns: Bool? + var showTrafficLights: Bool? static func fromList(_ list: [Any?]) -> NavigationDisplayOptionsDto? { let showDestinationMarkers: Bool? = nilOrValue(list[0]) @@ -1146,8 +1181,9 @@ struct NavigationDisplayOptionsDto { showTrafficLights: showTrafficLights ) } + func toList() -> [Any?] { - return [ + [ showDestinationMarkers, showStopSigns, showTrafficLights, @@ -1158,20 +1194,21 @@ struct NavigationDisplayOptionsDto { /// Generated class from Pigeon that represents data sent in messages. struct NavigationWaypointDto { var title: String - var target: LatLngDto? = nil - var placeID: String? = nil - var preferSameSideOfRoad: Bool? = nil - var preferredSegmentHeading: Int64? = nil + var target: LatLngDto? + var placeID: String? + var preferSameSideOfRoad: Bool? + var preferredSegmentHeading: Int64? static func fromList(_ list: [Any?]) -> NavigationWaypointDto? { let title = list[0] as! String - var target: LatLngDto? = nil + var target: LatLngDto? if let targetList: [Any?] = nilOrValue(list[1]) { target = LatLngDto.fromList(targetList) } let placeID: String? = nilOrValue(list[2]) let preferSameSideOfRoad: Bool? = nilOrValue(list[3]) - let preferredSegmentHeading: Int64? = isNullish(list[4]) ? nil : (list[4] is Int64? ? list[4] as! Int64? : Int64(list[4] as! Int32)) + let preferredSegmentHeading: Int64? = isNullish(list[4]) ? nil : + (list[4] is Int64? ? list[4] as! Int64? : Int64(list[4] as! Int32)) return NavigationWaypointDto( title: title, @@ -1181,8 +1218,9 @@ struct NavigationWaypointDto { preferredSegmentHeading: preferredSegmentHeading ) } + func toList() -> [Any?] { - return [ + [ title, target?.toList(), placeID, @@ -1206,8 +1244,9 @@ struct NavigationTimeAndDistanceDto { distance: distance ) } + func toList() -> [Any?] { - return [ + [ time, distance, ] @@ -1216,14 +1255,14 @@ struct NavigationTimeAndDistanceDto { /// Generated class from Pigeon that represents data sent in messages. struct NavigationAudioGuidanceSettingsDto { - var isBluetoothAudioEnabled: Bool? = nil - var isVibrationEnabled: Bool? = nil - var guidanceType: AudioGuidanceTypeDto? = nil + var isBluetoothAudioEnabled: Bool? + var isVibrationEnabled: Bool? + var guidanceType: AudioGuidanceTypeDto? static func fromList(_ list: [Any?]) -> NavigationAudioGuidanceSettingsDto? { let isBluetoothAudioEnabled: Bool? = nilOrValue(list[0]) let isVibrationEnabled: Bool? = nilOrValue(list[1]) - var guidanceType: AudioGuidanceTypeDto? = nil + var guidanceType: AudioGuidanceTypeDto? let guidanceTypeEnumVal: Int? = nilOrValue(list[2]) if let guidanceTypeRawValue = guidanceTypeEnumVal { guidanceType = AudioGuidanceTypeDto(rawValue: guidanceTypeRawValue)! @@ -1235,8 +1274,9 @@ struct NavigationAudioGuidanceSettingsDto { guidanceType: guidanceType ) } + func toList() -> [Any?] { - return [ + [ isBluetoothAudioEnabled, isVibrationEnabled, guidanceType?.rawValue, @@ -1255,8 +1295,9 @@ struct SimulationOptionsDto { speedMultiplier: speedMultiplier ) } + func toList() -> [Any?] { - return [ + [ speedMultiplier, ] } @@ -1276,8 +1317,9 @@ struct LatLngDto { longitude: longitude ) } + func toList() -> [Any?] { - return [ + [ latitude, longitude, ] @@ -1298,8 +1340,9 @@ struct LatLngBoundsDto { northeast: northeast ) } + func toList() -> [Any?] { - return [ + [ southwest.toList(), northeast.toList(), ] @@ -1320,8 +1363,9 @@ struct SpeedingUpdatedEventDto { severity: severity ) } + func toList() -> [Any?] { - return [ + [ percentageAboveLimit, severity.rawValue, ] @@ -1345,8 +1389,9 @@ struct SpeedAlertOptionsDto { majorSpeedAlertThresholdPercentage: majorSpeedAlertThresholdPercentage ) } + func toList() -> [Any?] { - return [ + [ severityUpgradeDurationSeconds, minorSpeedAlertThresholdPercentage, majorSpeedAlertThresholdPercentage, @@ -1371,8 +1416,9 @@ struct RouteSegmentTrafficDataRoadStretchRenderingDataDto { offsetMeters: offsetMeters ) } + func toList() -> [Any?] { - return [ + [ style.rawValue, lengthMeters, offsetMeters, @@ -1387,15 +1433,17 @@ struct RouteSegmentTrafficDataDto { static func fromList(_ list: [Any?]) -> RouteSegmentTrafficDataDto? { let status = RouteSegmentTrafficDataStatusDto(rawValue: list[0] as! Int)! - let roadStretchRenderingDataList = list[1] as! [RouteSegmentTrafficDataRoadStretchRenderingDataDto?] + let roadStretchRenderingDataList = + list[1] as! [RouteSegmentTrafficDataRoadStretchRenderingDataDto?] return RouteSegmentTrafficDataDto( status: status, roadStretchRenderingDataList: roadStretchRenderingDataList ) } + func toList() -> [Any?] { - return [ + [ status.rawValue, roadStretchRenderingDataList, ] @@ -1404,19 +1452,19 @@ struct RouteSegmentTrafficDataDto { /// Generated class from Pigeon that represents data sent in messages. struct RouteSegmentDto { - var trafficData: RouteSegmentTrafficDataDto? = nil + var trafficData: RouteSegmentTrafficDataDto? var destinationLatLng: LatLngDto - var latLngs: [LatLngDto?]? = nil - var destinationWaypoint: NavigationWaypointDto? = nil + var latLngs: [LatLngDto?]? + var destinationWaypoint: NavigationWaypointDto? static func fromList(_ list: [Any?]) -> RouteSegmentDto? { - var trafficData: RouteSegmentTrafficDataDto? = nil + var trafficData: RouteSegmentTrafficDataDto? if let trafficDataList: [Any?] = nilOrValue(list[0]) { trafficData = RouteSegmentTrafficDataDto.fromList(trafficDataList) } let destinationLatLng = LatLngDto.fromList(list[1] as! [Any?])! let latLngs: [LatLngDto?]? = nilOrValue(list[2]) - var destinationWaypoint: NavigationWaypointDto? = nil + var destinationWaypoint: NavigationWaypointDto? if let destinationWaypointList: [Any?] = nilOrValue(list[3]) { destinationWaypoint = NavigationWaypointDto.fromList(destinationWaypointList) } @@ -1428,8 +1476,9 @@ struct RouteSegmentDto { destinationWaypoint: destinationWaypoint ) } + func toList() -> [Any?] { - return [ + [ trafficData?.toList(), destinationLatLng.toList(), latLngs, @@ -1438,7 +1487,8 @@ struct RouteSegmentDto { } } -/// One of the possible directions from a lane at the end of a route step, and whether it is on the recommended route. +/// One of the possible directions from a lane at the end of a route step, and whether it is on the +/// recommended route. /// /// Generated class from Pigeon that represents data sent in messages. struct LaneDirectionDto { @@ -1456,8 +1506,9 @@ struct LaneDirectionDto { isRecommended: isRecommended ) } + func toList() -> [Any?] { - return [ + [ laneShape.rawValue, isRecommended, ] @@ -1468,7 +1519,8 @@ struct LaneDirectionDto { /// /// Generated class from Pigeon that represents data sent in messages. struct LaneDto { - /// List of possible directions a driver can follow when using this lane at the end of the respective route step + /// List of possible directions a driver can follow when using this lane at the end of the + /// respective route step var laneDirections: [LaneDirectionDto?] static func fromList(_ list: [Any?]) -> LaneDto? { @@ -1478,8 +1530,9 @@ struct LaneDto { laneDirections: laneDirections ) } + func toList() -> [Any?] { - return [ + [ laneDirections, ] } @@ -1496,7 +1549,7 @@ struct StepInfoDto { /// Whether this step is on a drive-on-right or drive-on-left route. var drivingSide: DrivingSideDto /// The exit number if it exists. - var exitNumber: String? = nil + var exitNumber: String? /// The full text of the instruction for this step. var fullInstructions: String /// The full road name for this step. @@ -1540,8 +1593,9 @@ struct StepInfoDto { stepNumber: stepNumber ) } + func toList() -> [Any?] { - return [ + [ distanceFromPrevStepMeters, timeFromPrevStepSeconds, drivingSide.rawValue, @@ -1565,46 +1619,52 @@ struct NavInfoDto { /// The current state of navigation. var navState: NavStateDto /// Information about the upcoming maneuver step. - var currentStep: StepInfoDto? = nil + var currentStep: StepInfoDto? /// The remaining steps after the current step. var remainingSteps: [StepInfoDto?] /// Whether the route has changed since the last sent message. var routeChanged: Bool /// Estimated remaining distance in meters along the route to the /// current step. - var distanceToCurrentStepMeters: Int64? = nil + var distanceToCurrentStepMeters: Int64? /// The estimated remaining distance in meters to the final destination which /// is the last destination in a multi-destination trip. - var distanceToFinalDestinationMeters: Int64? = nil + var distanceToFinalDestinationMeters: Int64? /// The estimated remaining distance in meters to the next destination. /// /// Android only. - var distanceToNextDestinationMeters: Int64? = nil + var distanceToNextDestinationMeters: Int64? /// The estimated remaining time in seconds along the route to the /// current step. - var timeToCurrentStepSeconds: Int64? = nil + var timeToCurrentStepSeconds: Int64? /// The estimated remaining time in seconds to the final destination which is /// the last destination in a multi-destination trip. - var timeToFinalDestinationSeconds: Int64? = nil + var timeToFinalDestinationSeconds: Int64? /// The estimated remaining time in seconds to the next destination. /// /// Android only. - var timeToNextDestinationSeconds: Int64? = nil + var timeToNextDestinationSeconds: Int64? static func fromList(_ list: [Any?]) -> NavInfoDto? { let navState = NavStateDto(rawValue: list[0] as! Int)! - var currentStep: StepInfoDto? = nil + var currentStep: StepInfoDto? if let currentStepList: [Any?] = nilOrValue(list[1]) { currentStep = StepInfoDto.fromList(currentStepList) } let remainingSteps = list[2] as! [StepInfoDto?] let routeChanged = list[3] as! Bool - let distanceToCurrentStepMeters: Int64? = isNullish(list[4]) ? nil : (list[4] is Int64? ? list[4] as! Int64? : Int64(list[4] as! Int32)) - let distanceToFinalDestinationMeters: Int64? = isNullish(list[5]) ? nil : (list[5] is Int64? ? list[5] as! Int64? : Int64(list[5] as! Int32)) - let distanceToNextDestinationMeters: Int64? = isNullish(list[6]) ? nil : (list[6] is Int64? ? list[6] as! Int64? : Int64(list[6] as! Int32)) - let timeToCurrentStepSeconds: Int64? = isNullish(list[7]) ? nil : (list[7] is Int64? ? list[7] as! Int64? : Int64(list[7] as! Int32)) - let timeToFinalDestinationSeconds: Int64? = isNullish(list[8]) ? nil : (list[8] is Int64? ? list[8] as! Int64? : Int64(list[8] as! Int32)) - let timeToNextDestinationSeconds: Int64? = isNullish(list[9]) ? nil : (list[9] is Int64? ? list[9] as! Int64? : Int64(list[9] as! Int32)) + let distanceToCurrentStepMeters: Int64? = isNullish(list[4]) ? nil : + (list[4] is Int64? ? list[4] as! Int64? : Int64(list[4] as! Int32)) + let distanceToFinalDestinationMeters: Int64? = isNullish(list[5]) ? nil : + (list[5] is Int64? ? list[5] as! Int64? : Int64(list[5] as! Int32)) + let distanceToNextDestinationMeters: Int64? = isNullish(list[6]) ? nil : + (list[6] is Int64? ? list[6] as! Int64? : Int64(list[6] as! Int32)) + let timeToCurrentStepSeconds: Int64? = isNullish(list[7]) ? nil : + (list[7] is Int64? ? list[7] as! Int64? : Int64(list[7] as! Int32)) + let timeToFinalDestinationSeconds: Int64? = isNullish(list[8]) ? nil : + (list[8] is Int64? ? list[8] as! Int64? : Int64(list[8] as! Int32)) + let timeToNextDestinationSeconds: Int64? = isNullish(list[9]) ? nil : + (list[9] is Int64? ? list[9] as! Int64? : Int64(list[9] as! Int32)) return NavInfoDto( navState: navState, @@ -1619,8 +1679,9 @@ struct NavInfoDto { timeToNextDestinationSeconds: timeToNextDestinationSeconds ) } + func toList() -> [Any?] { - return [ + [ navState.rawValue, currentStep?.toList(), remainingSteps, @@ -1638,20 +1699,20 @@ struct NavInfoDto { private class _NavigationViewCreationApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return CameraPositionDto.fromList(self.readValue() as! [Any?]) - case 129: - return LatLngBoundsDto.fromList(self.readValue() as! [Any?]) - case 130: - return LatLngDto.fromList(self.readValue() as! [Any?]) - case 131: - return MapOptionsDto.fromList(self.readValue() as! [Any?]) - case 132: - return NavigationViewOptionsDto.fromList(self.readValue() as! [Any?]) - case 133: - return ViewCreationOptionsDto.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return CameraPositionDto.fromList(readValue() as! [Any?]) + case 129: + return LatLngBoundsDto.fromList(readValue() as! [Any?]) + case 130: + return LatLngDto.fromList(readValue() as! [Any?]) + case 131: + return MapOptionsDto.fromList(readValue() as! [Any?]) + case 132: + return NavigationViewOptionsDto.fromList(readValue() as! [Any?]) + case 133: + return ViewCreationOptionsDto.fromList(readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } @@ -1684,16 +1745,17 @@ private class _NavigationViewCreationApiCodecWriter: FlutterStandardWriter { private class _NavigationViewCreationApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - return _NavigationViewCreationApiCodecReader(data: data) + _NavigationViewCreationApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return _NavigationViewCreationApiCodecWriter(data: data) + _NavigationViewCreationApiCodecWriter(data: data) } } class _NavigationViewCreationApiCodec: FlutterStandardMessageCodec { - static let shared = _NavigationViewCreationApiCodec(readerWriter: _NavigationViewCreationApiCodecReaderWriter()) + static let shared = + _NavigationViewCreationApiCodec(readerWriter: _NavigationViewCreationApiCodecReaderWriter()) } /// Pigeon only generates messages if the messages are used in API. @@ -1706,13 +1768,18 @@ protocol _NavigationViewCreationApi { } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -class _NavigationViewCreationApiSetup { +enum _NavigationViewCreationApiSetup { /// The codec used by _NavigationViewCreationApi. static var codec: FlutterStandardMessageCodec { _NavigationViewCreationApiCodec.shared } - /// Sets up an instance of `_NavigationViewCreationApi` to handle messages through the `binaryMessenger`. + /// Sets up an instance of `_NavigationViewCreationApi` to handle messages through the + /// `binaryMessenger`. static func setUp(binaryMessenger: FlutterBinaryMessenger, api: _NavigationViewCreationApi?) { - let _createChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let _createChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { _createChannel.setMessageHandler { message, reply in let args = message as! [Any?] let msgArg = args[0] as! ViewCreationOptionsDto @@ -1728,49 +1795,50 @@ class _NavigationViewCreationApiSetup { } } } + private class MapViewApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return CameraPositionDto.fromList(self.readValue() as! [Any?]) - case 129: - return CircleDto.fromList(self.readValue() as! [Any?]) - case 130: - return CircleOptionsDto.fromList(self.readValue() as! [Any?]) - case 131: - return ImageDescriptorDto.fromList(self.readValue() as! [Any?]) - case 132: - return InfoWindowDto.fromList(self.readValue() as! [Any?]) - case 133: - return LatLngBoundsDto.fromList(self.readValue() as! [Any?]) - case 134: - return LatLngDto.fromList(self.readValue() as! [Any?]) - case 135: - return LatLngDto.fromList(self.readValue() as! [Any?]) - case 136: - return MarkerAnchorDto.fromList(self.readValue() as! [Any?]) - case 137: - return MarkerDto.fromList(self.readValue() as! [Any?]) - case 138: - return MarkerOptionsDto.fromList(self.readValue() as! [Any?]) - case 139: - return PatternItemDto.fromList(self.readValue() as! [Any?]) - case 140: - return PolygonDto.fromList(self.readValue() as! [Any?]) - case 141: - return PolygonHoleDto.fromList(self.readValue() as! [Any?]) - case 142: - return PolygonOptionsDto.fromList(self.readValue() as! [Any?]) - case 143: - return PolylineDto.fromList(self.readValue() as! [Any?]) - case 144: - return PolylineOptionsDto.fromList(self.readValue() as! [Any?]) - case 145: - return StyleSpanDto.fromList(self.readValue() as! [Any?]) - case 146: - return StyleSpanStrokeStyleDto.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return CameraPositionDto.fromList(readValue() as! [Any?]) + case 129: + return CircleDto.fromList(readValue() as! [Any?]) + case 130: + return CircleOptionsDto.fromList(readValue() as! [Any?]) + case 131: + return ImageDescriptorDto.fromList(readValue() as! [Any?]) + case 132: + return InfoWindowDto.fromList(readValue() as! [Any?]) + case 133: + return LatLngBoundsDto.fromList(readValue() as! [Any?]) + case 134: + return LatLngDto.fromList(readValue() as! [Any?]) + case 135: + return LatLngDto.fromList(readValue() as! [Any?]) + case 136: + return MarkerAnchorDto.fromList(readValue() as! [Any?]) + case 137: + return MarkerDto.fromList(readValue() as! [Any?]) + case 138: + return MarkerOptionsDto.fromList(readValue() as! [Any?]) + case 139: + return PatternItemDto.fromList(readValue() as! [Any?]) + case 140: + return PolygonDto.fromList(readValue() as! [Any?]) + case 141: + return PolygonHoleDto.fromList(readValue() as! [Any?]) + case 142: + return PolygonOptionsDto.fromList(readValue() as! [Any?]) + case 143: + return PolylineDto.fromList(readValue() as! [Any?]) + case 144: + return PolylineOptionsDto.fromList(readValue() as! [Any?]) + case 145: + return StyleSpanDto.fromList(readValue() as! [Any?]) + case 146: + return StyleSpanStrokeStyleDto.fromList(readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } @@ -1842,11 +1910,11 @@ private class MapViewApiCodecWriter: FlutterStandardWriter { private class MapViewApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - return MapViewApiCodecReader(data: data) + MapViewApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return MapViewApiCodecWriter(data: data) + MapViewApiCodecWriter(data: data) } } @@ -1882,13 +1950,22 @@ protocol MapViewApi { func getCameraPosition(viewId: Int64) throws -> CameraPositionDto func getVisibleRegion(viewId: Int64) throws -> LatLngBoundsDto func followMyLocation(viewId: Int64, perspective: CameraPerspectiveDto, zoomLevel: Double?) throws - func animateCameraToCameraPosition(viewId: Int64, cameraPosition: CameraPositionDto, duration: Int64?, completion: @escaping (Result) -> Void) - func animateCameraToLatLng(viewId: Int64, point: LatLngDto, duration: Int64?, completion: @escaping (Result) -> Void) - func animateCameraToLatLngBounds(viewId: Int64, bounds: LatLngBoundsDto, padding: Double, duration: Int64?, completion: @escaping (Result) -> Void) - func animateCameraToLatLngZoom(viewId: Int64, point: LatLngDto, zoom: Double, duration: Int64?, completion: @escaping (Result) -> Void) - func animateCameraByScroll(viewId: Int64, scrollByDx: Double, scrollByDy: Double, duration: Int64?, completion: @escaping (Result) -> Void) - func animateCameraByZoom(viewId: Int64, zoomBy: Double, focusDx: Double?, focusDy: Double?, duration: Int64?, completion: @escaping (Result) -> Void) - func animateCameraToZoom(viewId: Int64, zoom: Double, duration: Int64?, completion: @escaping (Result) -> Void) + func animateCameraToCameraPosition(viewId: Int64, cameraPosition: CameraPositionDto, + duration: Int64?, + completion: @escaping (Result) -> Void) + func animateCameraToLatLng(viewId: Int64, point: LatLngDto, duration: Int64?, + completion: @escaping (Result) -> Void) + func animateCameraToLatLngBounds(viewId: Int64, bounds: LatLngBoundsDto, padding: Double, + duration: Int64?, + completion: @escaping (Result) -> Void) + func animateCameraToLatLngZoom(viewId: Int64, point: LatLngDto, zoom: Double, duration: Int64?, + completion: @escaping (Result) -> Void) + func animateCameraByScroll(viewId: Int64, scrollByDx: Double, scrollByDy: Double, + duration: Int64?, completion: @escaping (Result) -> Void) + func animateCameraByZoom(viewId: Int64, zoomBy: Double, focusDx: Double?, focusDy: Double?, + duration: Int64?, completion: @escaping (Result) -> Void) + func animateCameraToZoom(viewId: Int64, zoom: Double, duration: Int64?, + completion: @escaping (Result) -> Void) func moveCameraToCameraPosition(viewId: Int64, cameraPosition: CameraPositionDto) throws func moveCameraToLatLng(viewId: Int64, point: LatLngDto) throws func moveCameraToLatLngBounds(viewId: Int64, bounds: LatLngBoundsDto, padding: Double) throws @@ -1949,30 +2026,38 @@ protocol MapViewApi { } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -class MapViewApiSetup { +enum MapViewApiSetup { /// The codec used by MapViewApi. static var codec: FlutterStandardMessageCodec { MapViewApiCodec.shared } /// Sets up an instance of `MapViewApi` to handle messages through the `binaryMessenger`. static func setUp(binaryMessenger: FlutterBinaryMessenger, api: MapViewApi?) { - let awaitMapReadyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let awaitMapReadyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { awaitMapReadyChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) api.awaitMapReady(viewId: viewIdArg) { result in switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) + case .success: + reply(wrapResult(nil)) + case let .failure(error): + reply(wrapError(error)) } } } } else { awaitMapReadyChannel.setMessageHandler(nil) } - let isMyLocationEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isMyLocationEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isMyLocationEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -1986,8 +2071,12 @@ class MapViewApiSetup { } else { isMyLocationEnabledChannel.setMessageHandler(nil) } - let setMyLocationEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setMyLocationEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setMyLocationEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2002,8 +2091,12 @@ class MapViewApiSetup { } else { setMyLocationEnabledChannel.setMessageHandler(nil) } - let getMyLocationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getMyLocationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getMyLocationChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2017,8 +2110,12 @@ class MapViewApiSetup { } else { getMyLocationChannel.setMessageHandler(nil) } - let getMapTypeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getMapTypeChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getMapTypeChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2032,8 +2129,12 @@ class MapViewApiSetup { } else { getMapTypeChannel.setMessageHandler(nil) } - let setMapTypeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setMapTypeChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setMapTypeChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2048,8 +2149,12 @@ class MapViewApiSetup { } else { setMapTypeChannel.setMessageHandler(nil) } - let setMapStyleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setMapStyleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setMapStyleChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2064,8 +2169,12 @@ class MapViewApiSetup { } else { setMapStyleChannel.setMessageHandler(nil) } - let isNavigationTripProgressBarEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isNavigationTripProgressBarEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isNavigationTripProgressBarEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2079,8 +2188,12 @@ class MapViewApiSetup { } else { isNavigationTripProgressBarEnabledChannel.setMessageHandler(nil) } - let setNavigationTripProgressBarEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setNavigationTripProgressBarEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setNavigationTripProgressBarEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2095,8 +2208,12 @@ class MapViewApiSetup { } else { setNavigationTripProgressBarEnabledChannel.setMessageHandler(nil) } - let isNavigationHeaderEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isNavigationHeaderEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isNavigationHeaderEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2110,8 +2227,12 @@ class MapViewApiSetup { } else { isNavigationHeaderEnabledChannel.setMessageHandler(nil) } - let setNavigationHeaderEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setNavigationHeaderEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setNavigationHeaderEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2126,8 +2247,12 @@ class MapViewApiSetup { } else { setNavigationHeaderEnabledChannel.setMessageHandler(nil) } - let isNavigationFooterEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isNavigationFooterEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isNavigationFooterEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2141,8 +2266,12 @@ class MapViewApiSetup { } else { isNavigationFooterEnabledChannel.setMessageHandler(nil) } - let setNavigationFooterEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setNavigationFooterEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setNavigationFooterEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2157,8 +2286,12 @@ class MapViewApiSetup { } else { setNavigationFooterEnabledChannel.setMessageHandler(nil) } - let isRecenterButtonEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isRecenterButtonEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isRecenterButtonEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2172,8 +2305,12 @@ class MapViewApiSetup { } else { isRecenterButtonEnabledChannel.setMessageHandler(nil) } - let setRecenterButtonEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setRecenterButtonEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setRecenterButtonEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2188,8 +2325,12 @@ class MapViewApiSetup { } else { setRecenterButtonEnabledChannel.setMessageHandler(nil) } - let isSpeedLimitIconEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isSpeedLimitIconEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isSpeedLimitIconEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2203,8 +2344,12 @@ class MapViewApiSetup { } else { isSpeedLimitIconEnabledChannel.setMessageHandler(nil) } - let setSpeedLimitIconEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setSpeedLimitIconEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setSpeedLimitIconEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2219,8 +2364,12 @@ class MapViewApiSetup { } else { setSpeedLimitIconEnabledChannel.setMessageHandler(nil) } - let isSpeedometerEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isSpeedometerEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isSpeedometerEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2234,8 +2383,12 @@ class MapViewApiSetup { } else { isSpeedometerEnabledChannel.setMessageHandler(nil) } - let setSpeedometerEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setSpeedometerEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setSpeedometerEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2250,8 +2403,12 @@ class MapViewApiSetup { } else { setSpeedometerEnabledChannel.setMessageHandler(nil) } - let isTrafficIncidentCardsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isTrafficIncidentCardsEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isTrafficIncidentCardsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2265,8 +2422,12 @@ class MapViewApiSetup { } else { isTrafficIncidentCardsEnabledChannel.setMessageHandler(nil) } - let setTrafficIncidentCardsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setTrafficIncidentCardsEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setTrafficIncidentCardsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2281,8 +2442,12 @@ class MapViewApiSetup { } else { setTrafficIncidentCardsEnabledChannel.setMessageHandler(nil) } - let isNavigationUIEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isNavigationUIEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isNavigationUIEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2296,8 +2461,12 @@ class MapViewApiSetup { } else { isNavigationUIEnabledChannel.setMessageHandler(nil) } - let setNavigationUIEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setNavigationUIEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setNavigationUIEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2312,8 +2481,12 @@ class MapViewApiSetup { } else { setNavigationUIEnabledChannel.setMessageHandler(nil) } - let getCameraPositionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getCameraPositionChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getCameraPositionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2327,8 +2500,12 @@ class MapViewApiSetup { } else { getCameraPositionChannel.setMessageHandler(nil) } - let getVisibleRegionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getVisibleRegionChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getVisibleRegionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2342,15 +2519,23 @@ class MapViewApiSetup { } else { getVisibleRegionChannel.setMessageHandler(nil) } - let followMyLocationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let followMyLocationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { followMyLocationChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let perspectiveArg = CameraPerspectiveDto(rawValue: args[1] as! Int)! let zoomLevelArg: Double? = nilOrValue(args[2]) do { - try api.followMyLocation(viewId: viewIdArg, perspective: perspectiveArg, zoomLevel: zoomLevelArg) + try api.followMyLocation( + viewId: viewIdArg, + perspective: perspectiveArg, + zoomLevel: zoomLevelArg + ) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2359,146 +2544,212 @@ class MapViewApiSetup { } else { followMyLocationChannel.setMessageHandler(nil) } - let animateCameraToCameraPositionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let animateCameraToCameraPositionChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { animateCameraToCameraPositionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let cameraPositionArg = args[1] as! CameraPositionDto - let durationArg: Int64? = isNullish(args[2]) ? nil : (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) - api.animateCameraToCameraPosition(viewId: viewIdArg, cameraPosition: cameraPositionArg, duration: durationArg) { result in + let durationArg: Int64? = isNullish(args[2]) ? nil : + (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) + api.animateCameraToCameraPosition( + viewId: viewIdArg, + cameraPosition: cameraPositionArg, + duration: durationArg + ) { result in switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) + case let .success(res): + reply(wrapResult(res)) + case let .failure(error): + reply(wrapError(error)) } } } } else { animateCameraToCameraPositionChannel.setMessageHandler(nil) } - let animateCameraToLatLngChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let animateCameraToLatLngChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { animateCameraToLatLngChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let pointArg = args[1] as! LatLngDto - let durationArg: Int64? = isNullish(args[2]) ? nil : (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) - api.animateCameraToLatLng(viewId: viewIdArg, point: pointArg, duration: durationArg) { result in - switch result { - case .success(let res): + let durationArg: Int64? = isNullish(args[2]) ? nil : + (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) + api + .animateCameraToLatLng(viewId: viewIdArg, point: pointArg, + duration: durationArg) { result in + switch result { + case let .success(res): reply(wrapResult(res)) - case .failure(let error): + case let .failure(error): reply(wrapError(error)) + } } - } } } else { animateCameraToLatLngChannel.setMessageHandler(nil) } - let animateCameraToLatLngBoundsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let animateCameraToLatLngBoundsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { animateCameraToLatLngBoundsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let boundsArg = args[1] as! LatLngBoundsDto let paddingArg = args[2] as! Double - let durationArg: Int64? = isNullish(args[3]) ? nil : (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) - api.animateCameraToLatLngBounds(viewId: viewIdArg, bounds: boundsArg, padding: paddingArg, duration: durationArg) { result in + let durationArg: Int64? = isNullish(args[3]) ? nil : + (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) + api.animateCameraToLatLngBounds( + viewId: viewIdArg, + bounds: boundsArg, + padding: paddingArg, + duration: durationArg + ) { result in switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) + case let .success(res): + reply(wrapResult(res)) + case let .failure(error): + reply(wrapError(error)) } } } } else { animateCameraToLatLngBoundsChannel.setMessageHandler(nil) } - let animateCameraToLatLngZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let animateCameraToLatLngZoomChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { animateCameraToLatLngZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let pointArg = args[1] as! LatLngDto let zoomArg = args[2] as! Double - let durationArg: Int64? = isNullish(args[3]) ? nil : (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) - api.animateCameraToLatLngZoom(viewId: viewIdArg, point: pointArg, zoom: zoomArg, duration: durationArg) { result in + let durationArg: Int64? = isNullish(args[3]) ? nil : + (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) + api.animateCameraToLatLngZoom( + viewId: viewIdArg, + point: pointArg, + zoom: zoomArg, + duration: durationArg + ) { result in switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) + case let .success(res): + reply(wrapResult(res)) + case let .failure(error): + reply(wrapError(error)) } } } } else { animateCameraToLatLngZoomChannel.setMessageHandler(nil) } - let animateCameraByScrollChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let animateCameraByScrollChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { animateCameraByScrollChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let scrollByDxArg = args[1] as! Double let scrollByDyArg = args[2] as! Double - let durationArg: Int64? = isNullish(args[3]) ? nil : (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) - api.animateCameraByScroll(viewId: viewIdArg, scrollByDx: scrollByDxArg, scrollByDy: scrollByDyArg, duration: durationArg) { result in + let durationArg: Int64? = isNullish(args[3]) ? nil : + (args[3] is Int64? ? args[3] as! Int64? : Int64(args[3] as! Int32)) + api.animateCameraByScroll( + viewId: viewIdArg, + scrollByDx: scrollByDxArg, + scrollByDy: scrollByDyArg, + duration: durationArg + ) { result in switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) + case let .success(res): + reply(wrapResult(res)) + case let .failure(error): + reply(wrapError(error)) } } } } else { animateCameraByScrollChannel.setMessageHandler(nil) } - let animateCameraByZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let animateCameraByZoomChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { animateCameraByZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let zoomByArg = args[1] as! Double let focusDxArg: Double? = nilOrValue(args[2]) let focusDyArg: Double? = nilOrValue(args[3]) - let durationArg: Int64? = isNullish(args[4]) ? nil : (args[4] is Int64? ? args[4] as! Int64? : Int64(args[4] as! Int32)) - api.animateCameraByZoom(viewId: viewIdArg, zoomBy: zoomByArg, focusDx: focusDxArg, focusDy: focusDyArg, duration: durationArg) { result in + let durationArg: Int64? = isNullish(args[4]) ? nil : + (args[4] is Int64? ? args[4] as! Int64? : Int64(args[4] as! Int32)) + api.animateCameraByZoom( + viewId: viewIdArg, + zoomBy: zoomByArg, + focusDx: focusDxArg, + focusDy: focusDyArg, + duration: durationArg + ) { result in switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) + case let .success(res): + reply(wrapResult(res)) + case let .failure(error): + reply(wrapError(error)) } } } } else { animateCameraByZoomChannel.setMessageHandler(nil) } - let animateCameraToZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let animateCameraToZoomChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { animateCameraToZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let zoomArg = args[1] as! Double - let durationArg: Int64? = isNullish(args[2]) ? nil : (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) + let durationArg: Int64? = isNullish(args[2]) ? nil : + (args[2] is Int64? ? args[2] as! Int64? : Int64(args[2] as! Int32)) api.animateCameraToZoom(viewId: viewIdArg, zoom: zoomArg, duration: durationArg) { result in switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) + case let .success(res): + reply(wrapResult(res)) + case let .failure(error): + reply(wrapError(error)) } } } } else { animateCameraToZoomChannel.setMessageHandler(nil) } - let moveCameraToCameraPositionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let moveCameraToCameraPositionChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { moveCameraToCameraPositionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2513,8 +2764,12 @@ class MapViewApiSetup { } else { moveCameraToCameraPositionChannel.setMessageHandler(nil) } - let moveCameraToLatLngChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let moveCameraToLatLngChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { moveCameraToLatLngChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2529,15 +2784,23 @@ class MapViewApiSetup { } else { moveCameraToLatLngChannel.setMessageHandler(nil) } - let moveCameraToLatLngBoundsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let moveCameraToLatLngBoundsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { moveCameraToLatLngBoundsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let boundsArg = args[1] as! LatLngBoundsDto let paddingArg = args[2] as! Double do { - try api.moveCameraToLatLngBounds(viewId: viewIdArg, bounds: boundsArg, padding: paddingArg) + try api.moveCameraToLatLngBounds( + viewId: viewIdArg, + bounds: boundsArg, + padding: paddingArg + ) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2546,8 +2809,12 @@ class MapViewApiSetup { } else { moveCameraToLatLngBoundsChannel.setMessageHandler(nil) } - let moveCameraToLatLngZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let moveCameraToLatLngZoomChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { moveCameraToLatLngZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2563,15 +2830,23 @@ class MapViewApiSetup { } else { moveCameraToLatLngZoomChannel.setMessageHandler(nil) } - let moveCameraByScrollChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let moveCameraByScrollChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { moveCameraByScrollChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let scrollByDxArg = args[1] as! Double let scrollByDyArg = args[2] as! Double do { - try api.moveCameraByScroll(viewId: viewIdArg, scrollByDx: scrollByDxArg, scrollByDy: scrollByDyArg) + try api.moveCameraByScroll( + viewId: viewIdArg, + scrollByDx: scrollByDxArg, + scrollByDy: scrollByDyArg + ) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2580,8 +2855,12 @@ class MapViewApiSetup { } else { moveCameraByScrollChannel.setMessageHandler(nil) } - let moveCameraByZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let moveCameraByZoomChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { moveCameraByZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2589,7 +2868,12 @@ class MapViewApiSetup { let focusDxArg: Double? = nilOrValue(args[2]) let focusDyArg: Double? = nilOrValue(args[3]) do { - try api.moveCameraByZoom(viewId: viewIdArg, zoomBy: zoomByArg, focusDx: focusDxArg, focusDy: focusDyArg) + try api.moveCameraByZoom( + viewId: viewIdArg, + zoomBy: zoomByArg, + focusDx: focusDxArg, + focusDy: focusDyArg + ) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2598,8 +2882,12 @@ class MapViewApiSetup { } else { moveCameraByZoomChannel.setMessageHandler(nil) } - let moveCameraToZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let moveCameraToZoomChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { moveCameraToZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2614,8 +2902,12 @@ class MapViewApiSetup { } else { moveCameraToZoomChannel.setMessageHandler(nil) } - let showRouteOverviewChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let showRouteOverviewChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { showRouteOverviewChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2629,8 +2921,12 @@ class MapViewApiSetup { } else { showRouteOverviewChannel.setMessageHandler(nil) } - let getMinZoomPreferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getMinZoomPreferenceChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getMinZoomPreferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2644,8 +2940,12 @@ class MapViewApiSetup { } else { getMinZoomPreferenceChannel.setMessageHandler(nil) } - let getMaxZoomPreferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getMaxZoomPreferenceChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getMaxZoomPreferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2659,8 +2959,12 @@ class MapViewApiSetup { } else { getMaxZoomPreferenceChannel.setMessageHandler(nil) } - let resetMinMaxZoomPreferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let resetMinMaxZoomPreferenceChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { resetMinMaxZoomPreferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2674,8 +2978,12 @@ class MapViewApiSetup { } else { resetMinMaxZoomPreferenceChannel.setMessageHandler(nil) } - let setMinZoomPreferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setMinZoomPreferenceChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setMinZoomPreferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2690,8 +2998,12 @@ class MapViewApiSetup { } else { setMinZoomPreferenceChannel.setMessageHandler(nil) } - let setMaxZoomPreferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setMaxZoomPreferenceChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setMaxZoomPreferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2706,8 +3018,12 @@ class MapViewApiSetup { } else { setMaxZoomPreferenceChannel.setMessageHandler(nil) } - let setMyLocationButtonEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setMyLocationButtonEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setMyLocationButtonEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2722,14 +3038,21 @@ class MapViewApiSetup { } else { setMyLocationButtonEnabledChannel.setMessageHandler(nil) } - let setConsumeMyLocationButtonClickEventsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setConsumeMyLocationButtonClickEventsEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setConsumeMyLocationButtonClickEventsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) let enabledArg = args[1] as! Bool do { - try api.setConsumeMyLocationButtonClickEventsEnabled(viewId: viewIdArg, enabled: enabledArg) + try api.setConsumeMyLocationButtonClickEventsEnabled( + viewId: viewIdArg, + enabled: enabledArg + ) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2738,8 +3061,12 @@ class MapViewApiSetup { } else { setConsumeMyLocationButtonClickEventsEnabledChannel.setMessageHandler(nil) } - let setZoomGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setZoomGesturesEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setZoomGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2754,8 +3081,12 @@ class MapViewApiSetup { } else { setZoomGesturesEnabledChannel.setMessageHandler(nil) } - let setZoomControlsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setZoomControlsEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setZoomControlsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2770,8 +3101,12 @@ class MapViewApiSetup { } else { setZoomControlsEnabledChannel.setMessageHandler(nil) } - let setCompassEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setCompassEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setCompassEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2786,8 +3121,12 @@ class MapViewApiSetup { } else { setCompassEnabledChannel.setMessageHandler(nil) } - let setRotateGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setRotateGesturesEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setRotateGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2802,8 +3141,12 @@ class MapViewApiSetup { } else { setRotateGesturesEnabledChannel.setMessageHandler(nil) } - let setScrollGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setScrollGesturesEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setScrollGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2818,8 +3161,12 @@ class MapViewApiSetup { } else { setScrollGesturesEnabledChannel.setMessageHandler(nil) } - let setScrollGesturesDuringRotateOrZoomEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setScrollGesturesDuringRotateOrZoomEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setScrollGesturesDuringRotateOrZoomEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2834,8 +3181,12 @@ class MapViewApiSetup { } else { setScrollGesturesDuringRotateOrZoomEnabledChannel.setMessageHandler(nil) } - let setTiltGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setTiltGesturesEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setTiltGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2850,8 +3201,12 @@ class MapViewApiSetup { } else { setTiltGesturesEnabledChannel.setMessageHandler(nil) } - let setMapToolbarEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setMapToolbarEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setMapToolbarEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2866,8 +3221,12 @@ class MapViewApiSetup { } else { setMapToolbarEnabledChannel.setMessageHandler(nil) } - let setTrafficEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setTrafficEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setTrafficEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2882,8 +3241,12 @@ class MapViewApiSetup { } else { setTrafficEnabledChannel.setMessageHandler(nil) } - let isMyLocationButtonEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isMyLocationButtonEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isMyLocationButtonEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2897,8 +3260,12 @@ class MapViewApiSetup { } else { isMyLocationButtonEnabledChannel.setMessageHandler(nil) } - let isConsumeMyLocationButtonClickEventsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isConsumeMyLocationButtonClickEventsEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isConsumeMyLocationButtonClickEventsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2912,8 +3279,12 @@ class MapViewApiSetup { } else { isConsumeMyLocationButtonClickEventsEnabledChannel.setMessageHandler(nil) } - let isZoomGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isZoomGesturesEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isZoomGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2927,8 +3298,12 @@ class MapViewApiSetup { } else { isZoomGesturesEnabledChannel.setMessageHandler(nil) } - let isZoomControlsEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isZoomControlsEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isZoomControlsEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2942,8 +3317,12 @@ class MapViewApiSetup { } else { isZoomControlsEnabledChannel.setMessageHandler(nil) } - let isCompassEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isCompassEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isCompassEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2957,8 +3336,12 @@ class MapViewApiSetup { } else { isCompassEnabledChannel.setMessageHandler(nil) } - let isRotateGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isRotateGesturesEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isRotateGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2972,8 +3355,12 @@ class MapViewApiSetup { } else { isRotateGesturesEnabledChannel.setMessageHandler(nil) } - let isScrollGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isScrollGesturesEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isScrollGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -2987,8 +3374,12 @@ class MapViewApiSetup { } else { isScrollGesturesEnabledChannel.setMessageHandler(nil) } - let isScrollGesturesEnabledDuringRotateOrZoomChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isScrollGesturesEnabledDuringRotateOrZoomChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isScrollGesturesEnabledDuringRotateOrZoomChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3002,8 +3393,12 @@ class MapViewApiSetup { } else { isScrollGesturesEnabledDuringRotateOrZoomChannel.setMessageHandler(nil) } - let isTiltGesturesEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isTiltGesturesEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isTiltGesturesEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3017,8 +3412,12 @@ class MapViewApiSetup { } else { isTiltGesturesEnabledChannel.setMessageHandler(nil) } - let isMapToolbarEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isMapToolbarEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isMapToolbarEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3032,8 +3431,12 @@ class MapViewApiSetup { } else { isMapToolbarEnabledChannel.setMessageHandler(nil) } - let isTrafficEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isTrafficEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isTrafficEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3047,8 +3450,12 @@ class MapViewApiSetup { } else { isTrafficEnabledChannel.setMessageHandler(nil) } - let getMarkersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getMarkersChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getMarkersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3062,8 +3469,12 @@ class MapViewApiSetup { } else { getMarkersChannel.setMessageHandler(nil) } - let addMarkersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let addMarkersChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { addMarkersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3078,8 +3489,12 @@ class MapViewApiSetup { } else { addMarkersChannel.setMessageHandler(nil) } - let updateMarkersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let updateMarkersChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { updateMarkersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3094,8 +3509,12 @@ class MapViewApiSetup { } else { updateMarkersChannel.setMessageHandler(nil) } - let removeMarkersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let removeMarkersChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { removeMarkersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3110,8 +3529,12 @@ class MapViewApiSetup { } else { removeMarkersChannel.setMessageHandler(nil) } - let clearMarkersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let clearMarkersChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { clearMarkersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3125,8 +3548,12 @@ class MapViewApiSetup { } else { clearMarkersChannel.setMessageHandler(nil) } - let clearChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let clearChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { clearChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3140,8 +3567,12 @@ class MapViewApiSetup { } else { clearChannel.setMessageHandler(nil) } - let getPolygonsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getPolygonsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getPolygonsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3155,8 +3586,12 @@ class MapViewApiSetup { } else { getPolygonsChannel.setMessageHandler(nil) } - let addPolygonsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let addPolygonsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { addPolygonsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3171,8 +3606,12 @@ class MapViewApiSetup { } else { addPolygonsChannel.setMessageHandler(nil) } - let updatePolygonsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let updatePolygonsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { updatePolygonsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3187,8 +3626,12 @@ class MapViewApiSetup { } else { updatePolygonsChannel.setMessageHandler(nil) } - let removePolygonsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let removePolygonsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { removePolygonsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3203,8 +3646,12 @@ class MapViewApiSetup { } else { removePolygonsChannel.setMessageHandler(nil) } - let clearPolygonsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let clearPolygonsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { clearPolygonsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3218,8 +3665,12 @@ class MapViewApiSetup { } else { clearPolygonsChannel.setMessageHandler(nil) } - let getPolylinesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getPolylinesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getPolylinesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3233,8 +3684,12 @@ class MapViewApiSetup { } else { getPolylinesChannel.setMessageHandler(nil) } - let addPolylinesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let addPolylinesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { addPolylinesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3249,8 +3704,12 @@ class MapViewApiSetup { } else { addPolylinesChannel.setMessageHandler(nil) } - let updatePolylinesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let updatePolylinesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { updatePolylinesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3265,8 +3724,12 @@ class MapViewApiSetup { } else { updatePolylinesChannel.setMessageHandler(nil) } - let removePolylinesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let removePolylinesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { removePolylinesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3281,8 +3744,12 @@ class MapViewApiSetup { } else { removePolylinesChannel.setMessageHandler(nil) } - let clearPolylinesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let clearPolylinesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { clearPolylinesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3296,8 +3763,12 @@ class MapViewApiSetup { } else { clearPolylinesChannel.setMessageHandler(nil) } - let getCirclesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getCirclesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getCirclesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3311,8 +3782,12 @@ class MapViewApiSetup { } else { getCirclesChannel.setMessageHandler(nil) } - let addCirclesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let addCirclesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { addCirclesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3327,8 +3802,12 @@ class MapViewApiSetup { } else { addCirclesChannel.setMessageHandler(nil) } - let updateCirclesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let updateCirclesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { updateCirclesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3343,8 +3822,12 @@ class MapViewApiSetup { } else { updateCirclesChannel.setMessageHandler(nil) } - let removeCirclesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let removeCirclesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { removeCirclesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3359,8 +3842,12 @@ class MapViewApiSetup { } else { removeCirclesChannel.setMessageHandler(nil) } - let clearCirclesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let clearCirclesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { clearCirclesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3374,8 +3861,12 @@ class MapViewApiSetup { } else { clearCirclesChannel.setMessageHandler(nil) } - let registerOnCameraChangedListenerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let registerOnCameraChangedListenerChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { registerOnCameraChangedListenerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) @@ -3391,15 +3882,16 @@ class MapViewApiSetup { } } } + private class ImageRegistryApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return ImageDescriptorDto.fromList(self.readValue() as! [Any?]) - case 129: - return ImageDescriptorDto.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return ImageDescriptorDto.fromList(readValue() as! [Any?]) + case 129: + return ImageDescriptorDto.fromList(readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } @@ -3420,11 +3912,11 @@ private class ImageRegistryApiCodecWriter: FlutterStandardWriter { private class ImageRegistryApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - return ImageRegistryApiCodecReader(data: data) + ImageRegistryApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return ImageRegistryApiCodecWriter(data: data) + ImageRegistryApiCodecWriter(data: data) } } @@ -3434,20 +3926,26 @@ class ImageRegistryApiCodec: FlutterStandardMessageCodec { /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol ImageRegistryApi { - func registerBitmapImage(imageId: String, bytes: FlutterStandardTypedData, imagePixelRatio: Double, width: Double?, height: Double?) throws -> ImageDescriptorDto + func registerBitmapImage(imageId: String, bytes: FlutterStandardTypedData, + imagePixelRatio: Double, width: Double?, + height: Double?) throws -> ImageDescriptorDto func unregisterImage(imageDescriptor: ImageDescriptorDto) throws func getRegisteredImages() throws -> [ImageDescriptorDto] func clearRegisteredImages() throws } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -class ImageRegistryApiSetup { +enum ImageRegistryApiSetup { /// The codec used by ImageRegistryApi. static var codec: FlutterStandardMessageCodec { ImageRegistryApiCodec.shared } /// Sets up an instance of `ImageRegistryApi` to handle messages through the `binaryMessenger`. static func setUp(binaryMessenger: FlutterBinaryMessenger, api: ImageRegistryApi?) { - let registerBitmapImageChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let registerBitmapImageChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { registerBitmapImageChannel.setMessageHandler { message, reply in let args = message as! [Any?] let imageIdArg = args[0] as! String @@ -3456,7 +3954,13 @@ class ImageRegistryApiSetup { let widthArg: Double? = nilOrValue(args[3]) let heightArg: Double? = nilOrValue(args[4]) do { - let result = try api.registerBitmapImage(imageId: imageIdArg, bytes: bytesArg, imagePixelRatio: imagePixelRatioArg, width: widthArg, height: heightArg) + let result = try api.registerBitmapImage( + imageId: imageIdArg, + bytes: bytesArg, + imagePixelRatio: imagePixelRatioArg, + width: widthArg, + height: heightArg + ) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3465,8 +3969,12 @@ class ImageRegistryApiSetup { } else { registerBitmapImageChannel.setMessageHandler(nil) } - let unregisterImageChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let unregisterImageChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { unregisterImageChannel.setMessageHandler { message, reply in let args = message as! [Any?] let imageDescriptorArg = args[0] as! ImageDescriptorDto @@ -3480,8 +3988,12 @@ class ImageRegistryApiSetup { } else { unregisterImageChannel.setMessageHandler(nil) } - let getRegisteredImagesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getRegisteredImagesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getRegisteredImagesChannel.setMessageHandler { _, reply in do { let result = try api.getRegisteredImages() @@ -3493,8 +4005,12 @@ class ImageRegistryApiSetup { } else { getRegisteredImagesChannel.setMessageHandler(nil) } - let clearRegisteredImagesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let clearRegisteredImagesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { clearRegisteredImagesChannel.setMessageHandler { _, reply in do { try api.clearRegisteredImages() @@ -3508,15 +4024,16 @@ class ImageRegistryApiSetup { } } } + private class ViewEventApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return CameraPositionDto.fromList(self.readValue() as! [Any?]) - case 129: - return LatLngDto.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return CameraPositionDto.fromList(readValue() as! [Any?]) + case 129: + return LatLngDto.fromList(readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } @@ -3537,11 +4054,11 @@ private class ViewEventApiCodecWriter: FlutterStandardWriter { private class ViewEventApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - return ViewEventApiCodecReader(data: data) + ViewEventApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return ViewEventApiCodecWriter(data: data) + ViewEventApiCodecWriter(data: data) } } @@ -3551,281 +4068,385 @@ class ViewEventApiCodec: FlutterStandardMessageCodec { /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. protocol ViewEventApiProtocol { - func onMapClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, completion: @escaping (Result) -> Void) - func onMapLongClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, completion: @escaping (Result) -> Void) - func onRecenterButtonClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) - func onMarkerEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, eventType eventTypeArg: MarkerEventTypeDto, completion: @escaping (Result) -> Void) - func onMarkerDragEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, eventType eventTypeArg: MarkerDragEventTypeDto, position positionArg: LatLngDto, completion: @escaping (Result) -> Void) - func onPolygonClicked(viewId viewIdArg: Int64, polygonId polygonIdArg: String, completion: @escaping (Result) -> Void) - func onPolylineClicked(viewId viewIdArg: Int64, polylineId polylineIdArg: String, completion: @escaping (Result) -> Void) - func onCircleClicked(viewId viewIdArg: Int64, circleId circleIdArg: String, completion: @escaping (Result) -> Void) - func onNavigationUIEnabledChanged(viewId viewIdArg: Int64, navigationUIEnabled navigationUIEnabledArg: Bool, completion: @escaping (Result) -> Void) - func onMyLocationClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) - func onMyLocationButtonClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) - func onCameraChanged(viewId viewIdArg: Int64, eventType eventTypeArg: CameraEventTypeDto, position positionArg: CameraPositionDto, completion: @escaping (Result) -> Void) + func onMapClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, + completion: @escaping (Result) -> Void) + func onMapLongClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, + completion: @escaping (Result) -> Void) + func onRecenterButtonClicked(viewId viewIdArg: Int64, + completion: @escaping (Result) -> Void) + func onMarkerEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, + eventType eventTypeArg: MarkerEventTypeDto, + completion: @escaping (Result) -> Void) + func onMarkerDragEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, + eventType eventTypeArg: MarkerDragEventTypeDto, + position positionArg: LatLngDto, + completion: @escaping (Result) -> Void) + func onPolygonClicked(viewId viewIdArg: Int64, polygonId polygonIdArg: String, + completion: @escaping (Result) -> Void) + func onPolylineClicked(viewId viewIdArg: Int64, polylineId polylineIdArg: String, + completion: @escaping (Result) -> Void) + func onCircleClicked(viewId viewIdArg: Int64, circleId circleIdArg: String, + completion: @escaping (Result) -> Void) + func onNavigationUIEnabledChanged(viewId viewIdArg: Int64, + navigationUIEnabled navigationUIEnabledArg: Bool, + completion: @escaping (Result) -> Void) + func onMyLocationClicked(viewId viewIdArg: Int64, + completion: @escaping (Result) -> Void) + func onMyLocationButtonClicked(viewId viewIdArg: Int64, + completion: @escaping (Result) -> Void) + func onCameraChanged(viewId viewIdArg: Int64, eventType eventTypeArg: CameraEventTypeDto, + position positionArg: CameraPositionDto, + completion: @escaping (Result) -> Void) } + class ViewEventApi: ViewEventApiProtocol { private let binaryMessenger: FlutterBinaryMessenger - init(binaryMessenger: FlutterBinaryMessenger){ + init(binaryMessenger: FlutterBinaryMessenger) { self.binaryMessenger = binaryMessenger } + var codec: FlutterStandardMessageCodec { - return ViewEventApiCodec.shared + ViewEventApiCodec.shared } - func onMapClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onMapClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, + completion: @escaping (Result) -> Void) { + let channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg, latLngArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onMapLongClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onMapLongClickEvent(viewId viewIdArg: Int64, latLng latLngArg: LatLngDto, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg, latLngArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onRecenterButtonClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onRecenterButtonClicked(viewId viewIdArg: Int64, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onMarkerEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, eventType eventTypeArg: MarkerEventTypeDto, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onMarkerEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, + eventType eventTypeArg: MarkerEventTypeDto, + completion: @escaping (Result) -> Void) { + let channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg, markerIdArg, eventTypeArg.rawValue] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onMarkerDragEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, eventType eventTypeArg: MarkerDragEventTypeDto, position positionArg: LatLngDto, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([viewIdArg, markerIdArg, eventTypeArg.rawValue, positionArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) - return - } - if (listResponse.count > 1) { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); - } else { - completion(.success(Void())) - } - } - } - func onPolygonClicked(viewId viewIdArg: Int64, polygonId polygonIdArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onMarkerDragEvent(viewId viewIdArg: Int64, markerId markerIdArg: String, + eventType eventTypeArg: MarkerDragEventTypeDto, + position positionArg: LatLngDto, + completion: @escaping (Result) -> Void) { + let channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) + channel + .sendMessage([viewIdArg, markerIdArg, eventTypeArg.rawValue, + positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(FlutterError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + + func onPolygonClicked(viewId viewIdArg: Int64, polygonId polygonIdArg: String, + completion: @escaping (Result) -> Void) { + let channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg, polygonIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onPolylineClicked(viewId viewIdArg: Int64, polylineId polylineIdArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onPolylineClicked(viewId viewIdArg: Int64, polylineId polylineIdArg: String, + completion: @escaping (Result) -> Void) { + let channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg, polylineIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onCircleClicked(viewId viewIdArg: Int64, circleId circleIdArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onCircleClicked(viewId viewIdArg: Int64, circleId circleIdArg: String, + completion: @escaping (Result) -> Void) { + let channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg, circleIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onNavigationUIEnabledChanged(viewId viewIdArg: Int64, navigationUIEnabled navigationUIEnabledArg: Bool, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onNavigationUIEnabledChanged(viewId viewIdArg: Int64, + navigationUIEnabled navigationUIEnabledArg: Bool, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg, navigationUIEnabledArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onMyLocationClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onMyLocationClicked(viewId viewIdArg: Int64, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onMyLocationButtonClicked(viewId viewIdArg: Int64, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onMyLocationButtonClicked(viewId viewIdArg: Int64, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onCameraChanged(viewId viewIdArg: Int64, eventType eventTypeArg: CameraEventTypeDto, position positionArg: CameraPositionDto, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onCameraChanged(viewId viewIdArg: Int64, eventType eventTypeArg: CameraEventTypeDto, + position positionArg: CameraPositionDto, + completion: @escaping (Result) -> Void) { + let channelName = "dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([viewIdArg, eventTypeArg.rawValue, positionArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } } + private class NavigationSessionApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return DestinationsDto.fromList(self.readValue() as! [Any?]) - case 129: - return LatLngDto.fromList(self.readValue() as! [Any?]) - case 130: - return LatLngDto.fromList(self.readValue() as! [Any?]) - case 131: - return NavigationAudioGuidanceSettingsDto.fromList(self.readValue() as! [Any?]) - case 132: - return NavigationDisplayOptionsDto.fromList(self.readValue() as! [Any?]) - case 133: - return NavigationTimeAndDistanceDto.fromList(self.readValue() as! [Any?]) - case 134: - return NavigationWaypointDto.fromList(self.readValue() as! [Any?]) - case 135: - return NavigationWaypointDto.fromList(self.readValue() as! [Any?]) - case 136: - return RouteSegmentDto.fromList(self.readValue() as! [Any?]) - case 137: - return RouteSegmentDto.fromList(self.readValue() as! [Any?]) - case 138: - return RouteSegmentTrafficDataDto.fromList(self.readValue() as! [Any?]) - case 139: - return RouteSegmentTrafficDataRoadStretchRenderingDataDto.fromList(self.readValue() as! [Any?]) - case 140: - return RouteTokenOptionsDto.fromList(self.readValue() as! [Any?]) - case 141: - return RoutingOptionsDto.fromList(self.readValue() as! [Any?]) - case 142: - return SimulationOptionsDto.fromList(self.readValue() as! [Any?]) - case 143: - return SpeedAlertOptionsDto.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return DestinationsDto.fromList(readValue() as! [Any?]) + case 129: + return LatLngDto.fromList(readValue() as! [Any?]) + case 130: + return LatLngDto.fromList(readValue() as! [Any?]) + case 131: + return NavigationAudioGuidanceSettingsDto.fromList(readValue() as! [Any?]) + case 132: + return NavigationDisplayOptionsDto.fromList(readValue() as! [Any?]) + case 133: + return NavigationTimeAndDistanceDto.fromList(readValue() as! [Any?]) + case 134: + return NavigationWaypointDto.fromList(readValue() as! [Any?]) + case 135: + return NavigationWaypointDto.fromList(readValue() as! [Any?]) + case 136: + return RouteSegmentDto.fromList(readValue() as! [Any?]) + case 137: + return RouteSegmentDto.fromList(readValue() as! [Any?]) + case 138: + return RouteSegmentTrafficDataDto.fromList(readValue() as! [Any?]) + case 139: + return RouteSegmentTrafficDataRoadStretchRenderingDataDto.fromList(readValue() as! [Any?]) + case 140: + return RouteTokenOptionsDto.fromList(readValue() as! [Any?]) + case 141: + return RoutingOptionsDto.fromList(readValue() as! [Any?]) + case 142: + return SimulationOptionsDto.fromList(readValue() as! [Any?]) + case 143: + return SpeedAlertOptionsDto.fromList(readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } @@ -3888,25 +4509,29 @@ private class NavigationSessionApiCodecWriter: FlutterStandardWriter { private class NavigationSessionApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - return NavigationSessionApiCodecReader(data: data) + NavigationSessionApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return NavigationSessionApiCodecWriter(data: data) + NavigationSessionApiCodecWriter(data: data) } } class NavigationSessionApiCodec: FlutterStandardMessageCodec { - static let shared = NavigationSessionApiCodec(readerWriter: NavigationSessionApiCodecReaderWriter()) + static let shared = + NavigationSessionApiCodec(readerWriter: NavigationSessionApiCodecReaderWriter()) } /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol NavigationSessionApi { /// General. - func createNavigationSession(abnormalTerminationReportingEnabled: Bool, completion: @escaping (Result) -> Void) + func createNavigationSession(abnormalTerminationReportingEnabled: Bool, + completion: @escaping (Result) -> Void) func isInitialized() throws -> Bool func cleanup() throws - func showTermsAndConditionsDialog(title: String, companyName: String, shouldOnlyShowDriverAwarenessDisclaimer: Bool, completion: @escaping (Result) -> Void) + func showTermsAndConditionsDialog(title: String, companyName: String, + shouldOnlyShowDriverAwarenessDisclaimer: Bool, + completion: @escaping (Result) -> Void) func areTermsAccepted() throws -> Bool func resetTermsAccepted() throws func getNavSDKVersion() throws -> String @@ -3914,7 +4539,8 @@ protocol NavigationSessionApi { func isGuidanceRunning() throws -> Bool func startGuidance() throws func stopGuidance() throws - func setDestinations(destinations: DestinationsDto, completion: @escaping (Result) -> Void) + func setDestinations(destinations: DestinationsDto, + completion: @escaping (Result) -> Void) func clearDestinations() throws func continueToNextDestination() throws -> NavigationWaypointDto? func getCurrentTimeAndDistance() throws -> NavigationTimeAndDistanceDto @@ -3928,9 +4554,23 @@ protocol NavigationSessionApi { func removeUserLocation() throws func simulateLocationsAlongExistingRoute() throws func simulateLocationsAlongExistingRouteWithOptions(options: SimulationOptionsDto) throws - func simulateLocationsAlongNewRoute(waypoints: [NavigationWaypointDto], completion: @escaping (Result) -> Void) - func simulateLocationsAlongNewRouteWithRoutingOptions(waypoints: [NavigationWaypointDto], routingOptions: RoutingOptionsDto, completion: @escaping (Result) -> Void) - func simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(waypoints: [NavigationWaypointDto], routingOptions: RoutingOptionsDto, simulationOptions: SimulationOptionsDto, completion: @escaping (Result) -> Void) + func simulateLocationsAlongNewRoute(waypoints: [NavigationWaypointDto], + completion: @escaping (Result) -> Void) + func simulateLocationsAlongNewRouteWithRoutingOptions(waypoints: [NavigationWaypointDto], + routingOptions: RoutingOptionsDto, + completion: @escaping (Result< + RouteStatusDto, + Error + >) -> Void) + func simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(waypoints: [ + NavigationWaypointDto + ], + routingOptions: RoutingOptionsDto, + simulationOptions: SimulationOptionsDto, + completion: @escaping (Result< + RouteStatusDto, + Error + >) -> Void) func pauseSimulation() throws func resumeSimulation() throws /// Simulation (iOS only) @@ -3941,35 +4581,48 @@ protocol NavigationSessionApi { /// Enable Turn-by-Turn navigation events. func enableTurnByTurnNavigationEvents(numNextStepsToPreview: Int64?) throws func disableTurnByTurnNavigationEvents() throws - func registerRemainingTimeOrDistanceChangedListener(remainingTimeThresholdSeconds: Int64, remainingDistanceThresholdMeters: Int64) throws + func registerRemainingTimeOrDistanceChangedListener(remainingTimeThresholdSeconds: Int64, + remainingDistanceThresholdMeters: Int64) throws } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -class NavigationSessionApiSetup { +enum NavigationSessionApiSetup { /// The codec used by NavigationSessionApi. static var codec: FlutterStandardMessageCodec { NavigationSessionApiCodec.shared } - /// Sets up an instance of `NavigationSessionApi` to handle messages through the `binaryMessenger`. + /// Sets up an instance of `NavigationSessionApi` to handle messages through the + /// `binaryMessenger`. static func setUp(binaryMessenger: FlutterBinaryMessenger, api: NavigationSessionApi?) { /// General. - let createNavigationSessionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let createNavigationSessionChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { createNavigationSessionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let abnormalTerminationReportingEnabledArg = args[0] as! Bool - api.createNavigationSession(abnormalTerminationReportingEnabled: abnormalTerminationReportingEnabledArg) { result in - switch result { + api + .createNavigationSession( + abnormalTerminationReportingEnabled: abnormalTerminationReportingEnabledArg + ) { result in + switch result { case .success: reply(wrapResult(nil)) - case .failure(let error): + case let .failure(error): reply(wrapError(error)) + } } - } } } else { createNavigationSessionChannel.setMessageHandler(nil) } - let isInitializedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isInitializedChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isInitializedChannel.setMessageHandler { _, reply in do { let result = try api.isInitialized() @@ -3981,8 +4634,12 @@ class NavigationSessionApiSetup { } else { isInitializedChannel.setMessageHandler(nil) } - let cleanupChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let cleanupChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { cleanupChannel.setMessageHandler { _, reply in do { try api.cleanup() @@ -3994,27 +4651,39 @@ class NavigationSessionApiSetup { } else { cleanupChannel.setMessageHandler(nil) } - let showTermsAndConditionsDialogChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let showTermsAndConditionsDialogChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { showTermsAndConditionsDialogChannel.setMessageHandler { message, reply in let args = message as! [Any?] let titleArg = args[0] as! String let companyNameArg = args[1] as! String let shouldOnlyShowDriverAwarenessDisclaimerArg = args[2] as! Bool - api.showTermsAndConditionsDialog(title: titleArg, companyName: companyNameArg, shouldOnlyShowDriverAwarenessDisclaimer: shouldOnlyShowDriverAwarenessDisclaimerArg) { result in + api.showTermsAndConditionsDialog( + title: titleArg, + companyName: companyNameArg, + shouldOnlyShowDriverAwarenessDisclaimer: shouldOnlyShowDriverAwarenessDisclaimerArg + ) { result in switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) + case let .success(res): + reply(wrapResult(res)) + case let .failure(error): + reply(wrapError(error)) } } } } else { showTermsAndConditionsDialogChannel.setMessageHandler(nil) } - let areTermsAcceptedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let areTermsAcceptedChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { areTermsAcceptedChannel.setMessageHandler { _, reply in do { let result = try api.areTermsAccepted() @@ -4026,8 +4695,12 @@ class NavigationSessionApiSetup { } else { areTermsAcceptedChannel.setMessageHandler(nil) } - let resetTermsAcceptedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let resetTermsAcceptedChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { resetTermsAcceptedChannel.setMessageHandler { _, reply in do { try api.resetTermsAccepted() @@ -4039,8 +4712,12 @@ class NavigationSessionApiSetup { } else { resetTermsAcceptedChannel.setMessageHandler(nil) } - let getNavSDKVersionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getNavSDKVersionChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getNavSDKVersionChannel.setMessageHandler { _, reply in do { let result = try api.getNavSDKVersion() @@ -4053,8 +4730,12 @@ class NavigationSessionApiSetup { getNavSDKVersionChannel.setMessageHandler(nil) } /// Navigation. - let isGuidanceRunningChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let isGuidanceRunningChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { isGuidanceRunningChannel.setMessageHandler { _, reply in do { let result = try api.isGuidanceRunning() @@ -4066,8 +4747,12 @@ class NavigationSessionApiSetup { } else { isGuidanceRunningChannel.setMessageHandler(nil) } - let startGuidanceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let startGuidanceChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { startGuidanceChannel.setMessageHandler { _, reply in do { try api.startGuidance() @@ -4079,8 +4764,12 @@ class NavigationSessionApiSetup { } else { startGuidanceChannel.setMessageHandler(nil) } - let stopGuidanceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let stopGuidanceChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { stopGuidanceChannel.setMessageHandler { _, reply in do { try api.stopGuidance() @@ -4092,25 +4781,33 @@ class NavigationSessionApiSetup { } else { stopGuidanceChannel.setMessageHandler(nil) } - let setDestinationsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setDestinationsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setDestinationsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let destinationsArg = args[0] as! DestinationsDto api.setDestinations(destinations: destinationsArg) { result in switch result { - case .success(let res): - reply(wrapResult(res.rawValue)) - case .failure(let error): - reply(wrapError(error)) + case let .success(res): + reply(wrapResult(res.rawValue)) + case let .failure(error): + reply(wrapError(error)) } } } } else { setDestinationsChannel.setMessageHandler(nil) } - let clearDestinationsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let clearDestinationsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { clearDestinationsChannel.setMessageHandler { _, reply in do { try api.clearDestinations() @@ -4122,8 +4819,12 @@ class NavigationSessionApiSetup { } else { clearDestinationsChannel.setMessageHandler(nil) } - let continueToNextDestinationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let continueToNextDestinationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { continueToNextDestinationChannel.setMessageHandler { _, reply in do { let result = try api.continueToNextDestination() @@ -4135,8 +4836,12 @@ class NavigationSessionApiSetup { } else { continueToNextDestinationChannel.setMessageHandler(nil) } - let getCurrentTimeAndDistanceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getCurrentTimeAndDistanceChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getCurrentTimeAndDistanceChannel.setMessageHandler { _, reply in do { let result = try api.getCurrentTimeAndDistance() @@ -4148,8 +4853,12 @@ class NavigationSessionApiSetup { } else { getCurrentTimeAndDistanceChannel.setMessageHandler(nil) } - let setAudioGuidanceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setAudioGuidanceChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setAudioGuidanceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let settingsArg = args[0] as! NavigationAudioGuidanceSettingsDto @@ -4163,8 +4872,12 @@ class NavigationSessionApiSetup { } else { setAudioGuidanceChannel.setMessageHandler(nil) } - let setSpeedAlertOptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setSpeedAlertOptionsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setSpeedAlertOptionsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let optionsArg = args[0] as! SpeedAlertOptionsDto @@ -4178,8 +4891,12 @@ class NavigationSessionApiSetup { } else { setSpeedAlertOptionsChannel.setMessageHandler(nil) } - let getRouteSegmentsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getRouteSegmentsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getRouteSegmentsChannel.setMessageHandler { _, reply in do { let result = try api.getRouteSegments() @@ -4191,8 +4908,12 @@ class NavigationSessionApiSetup { } else { getRouteSegmentsChannel.setMessageHandler(nil) } - let getTraveledRouteChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getTraveledRouteChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getTraveledRouteChannel.setMessageHandler { _, reply in do { let result = try api.getTraveledRoute() @@ -4204,8 +4925,12 @@ class NavigationSessionApiSetup { } else { getTraveledRouteChannel.setMessageHandler(nil) } - let getCurrentRouteSegmentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let getCurrentRouteSegmentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { getCurrentRouteSegmentChannel.setMessageHandler { _, reply in do { let result = try api.getCurrentRouteSegment() @@ -4218,8 +4943,12 @@ class NavigationSessionApiSetup { getCurrentRouteSegmentChannel.setMessageHandler(nil) } /// Simulation - let setUserLocationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let setUserLocationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { setUserLocationChannel.setMessageHandler { message, reply in let args = message as! [Any?] let locationArg = args[0] as! LatLngDto @@ -4233,8 +4962,12 @@ class NavigationSessionApiSetup { } else { setUserLocationChannel.setMessageHandler(nil) } - let removeUserLocationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let removeUserLocationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { removeUserLocationChannel.setMessageHandler { _, reply in do { try api.removeUserLocation() @@ -4246,8 +4979,12 @@ class NavigationSessionApiSetup { } else { removeUserLocationChannel.setMessageHandler(nil) } - let simulateLocationsAlongExistingRouteChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let simulateLocationsAlongExistingRouteChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { simulateLocationsAlongExistingRouteChannel.setMessageHandler { _, reply in do { try api.simulateLocationsAlongExistingRoute() @@ -4259,8 +4996,12 @@ class NavigationSessionApiSetup { } else { simulateLocationsAlongExistingRouteChannel.setMessageHandler(nil) } - let simulateLocationsAlongExistingRouteWithOptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let simulateLocationsAlongExistingRouteWithOptionsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { simulateLocationsAlongExistingRouteWithOptionsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let optionsArg = args[0] as! SimulationOptionsDto @@ -4274,62 +5015,87 @@ class NavigationSessionApiSetup { } else { simulateLocationsAlongExistingRouteWithOptionsChannel.setMessageHandler(nil) } - let simulateLocationsAlongNewRouteChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let simulateLocationsAlongNewRouteChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { simulateLocationsAlongNewRouteChannel.setMessageHandler { message, reply in let args = message as! [Any?] let waypointsArg = args[0] as! [NavigationWaypointDto] api.simulateLocationsAlongNewRoute(waypoints: waypointsArg) { result in switch result { - case .success(let res): - reply(wrapResult(res.rawValue)) - case .failure(let error): - reply(wrapError(error)) + case let .success(res): + reply(wrapResult(res.rawValue)) + case let .failure(error): + reply(wrapError(error)) } } } } else { simulateLocationsAlongNewRouteChannel.setMessageHandler(nil) } - let simulateLocationsAlongNewRouteWithRoutingOptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let simulateLocationsAlongNewRouteWithRoutingOptionsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { simulateLocationsAlongNewRouteWithRoutingOptionsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let waypointsArg = args[0] as! [NavigationWaypointDto] let routingOptionsArg = args[1] as! RoutingOptionsDto - api.simulateLocationsAlongNewRouteWithRoutingOptions(waypoints: waypointsArg, routingOptions: routingOptionsArg) { result in + api.simulateLocationsAlongNewRouteWithRoutingOptions( + waypoints: waypointsArg, + routingOptions: routingOptionsArg + ) { result in switch result { - case .success(let res): - reply(wrapResult(res.rawValue)) - case .failure(let error): - reply(wrapError(error)) + case let .success(res): + reply(wrapResult(res.rawValue)) + case let .failure(error): + reply(wrapError(error)) } } } } else { simulateLocationsAlongNewRouteWithRoutingOptionsChannel.setMessageHandler(nil) } - let simulateLocationsAlongNewRouteWithRoutingAndSimulationOptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - simulateLocationsAlongNewRouteWithRoutingAndSimulationOptionsChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let waypointsArg = args[0] as! [NavigationWaypointDto] - let routingOptionsArg = args[1] as! RoutingOptionsDto - let simulationOptionsArg = args[2] as! SimulationOptionsDto - api.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(waypoints: waypointsArg, routingOptions: routingOptionsArg, simulationOptions: simulationOptionsArg) { result in - switch result { - case .success(let res): + let simulateLocationsAlongNewRouteWithRoutingAndSimulationOptionsChannel = + FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { + simulateLocationsAlongNewRouteWithRoutingAndSimulationOptionsChannel + .setMessageHandler { message, reply in + let args = message as! [Any?] + let waypointsArg = args[0] as! [NavigationWaypointDto] + let routingOptionsArg = args[1] as! RoutingOptionsDto + let simulationOptionsArg = args[2] as! SimulationOptionsDto + api.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( + waypoints: waypointsArg, + routingOptions: routingOptionsArg, + simulationOptions: simulationOptionsArg + ) { result in + switch result { + case let .success(res): reply(wrapResult(res.rawValue)) - case .failure(let error): + case let .failure(error): reply(wrapError(error)) + } } } - } } else { simulateLocationsAlongNewRouteWithRoutingAndSimulationOptionsChannel.setMessageHandler(nil) } - let pauseSimulationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let pauseSimulationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { pauseSimulationChannel.setMessageHandler { _, reply in do { try api.pauseSimulation() @@ -4341,8 +5107,12 @@ class NavigationSessionApiSetup { } else { pauseSimulationChannel.setMessageHandler(nil) } - let resumeSimulationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let resumeSimulationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { resumeSimulationChannel.setMessageHandler { _, reply in do { try api.resumeSimulation() @@ -4355,8 +5125,12 @@ class NavigationSessionApiSetup { resumeSimulationChannel.setMessageHandler(nil) } /// Simulation (iOS only) - let allowBackgroundLocationUpdatesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let allowBackgroundLocationUpdatesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { allowBackgroundLocationUpdatesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let allowArg = args[0] as! Bool @@ -4371,8 +5145,12 @@ class NavigationSessionApiSetup { allowBackgroundLocationUpdatesChannel.setMessageHandler(nil) } /// Road snapped location updates. - let enableRoadSnappedLocationUpdatesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let enableRoadSnappedLocationUpdatesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { enableRoadSnappedLocationUpdatesChannel.setMessageHandler { _, reply in do { try api.enableRoadSnappedLocationUpdates() @@ -4384,8 +5162,12 @@ class NavigationSessionApiSetup { } else { enableRoadSnappedLocationUpdatesChannel.setMessageHandler(nil) } - let disableRoadSnappedLocationUpdatesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let disableRoadSnappedLocationUpdatesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { disableRoadSnappedLocationUpdatesChannel.setMessageHandler { _, reply in do { try api.disableRoadSnappedLocationUpdates() @@ -4398,11 +5180,16 @@ class NavigationSessionApiSetup { disableRoadSnappedLocationUpdatesChannel.setMessageHandler(nil) } /// Enable Turn-by-Turn navigation events. - let enableTurnByTurnNavigationEventsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let enableTurnByTurnNavigationEventsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { enableTurnByTurnNavigationEventsChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let numNextStepsToPreviewArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let numNextStepsToPreviewArg: Int64? = isNullish(args[0]) ? nil : + (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) do { try api.enableTurnByTurnNavigationEvents(numNextStepsToPreview: numNextStepsToPreviewArg) reply(wrapResult(nil)) @@ -4413,8 +5200,12 @@ class NavigationSessionApiSetup { } else { enableTurnByTurnNavigationEventsChannel.setMessageHandler(nil) } - let disableTurnByTurnNavigationEventsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let disableTurnByTurnNavigationEventsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { disableTurnByTurnNavigationEventsChannel.setMessageHandler { _, reply in do { try api.disableTurnByTurnNavigationEvents() @@ -4426,14 +5217,23 @@ class NavigationSessionApiSetup { } else { disableTurnByTurnNavigationEventsChannel.setMessageHandler(nil) } - let registerRemainingTimeOrDistanceChangedListenerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { + let registerRemainingTimeOrDistanceChangedListenerChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener", + binaryMessenger: binaryMessenger, + codec: codec + ) + if let api { registerRemainingTimeOrDistanceChangedListenerChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let remainingTimeThresholdSecondsArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) - let remainingDistanceThresholdMetersArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) + let remainingTimeThresholdSecondsArg = args[0] is Int64 ? args[0] as! Int64 : + Int64(args[0] as! Int32) + let remainingDistanceThresholdMetersArg = args[1] is Int64 ? args[1] as! Int64 : + Int64(args[1] as! Int32) do { - try api.registerRemainingTimeOrDistanceChangedListener(remainingTimeThresholdSeconds: remainingTimeThresholdSecondsArg, remainingDistanceThresholdMeters: remainingDistanceThresholdMetersArg) + try api.registerRemainingTimeOrDistanceChangedListener( + remainingTimeThresholdSeconds: remainingTimeThresholdSecondsArg, + remainingDistanceThresholdMeters: remainingDistanceThresholdMetersArg + ) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -4444,27 +5244,28 @@ class NavigationSessionApiSetup { } } } + private class NavigationSessionEventApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return LaneDirectionDto.fromList(self.readValue() as! [Any?]) - case 129: - return LaneDto.fromList(self.readValue() as! [Any?]) - case 130: - return LatLngDto.fromList(self.readValue() as! [Any?]) - case 131: - return NavInfoDto.fromList(self.readValue() as! [Any?]) - case 132: - return NavigationWaypointDto.fromList(self.readValue() as! [Any?]) - case 133: - return SpeedingUpdatedEventDto.fromList(self.readValue() as! [Any?]) - case 134: - return StepInfoDto.fromList(self.readValue() as! [Any?]) - case 135: - return StepInfoDto.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) + case 128: + return LaneDirectionDto.fromList(readValue() as! [Any?]) + case 129: + return LaneDto.fromList(readValue() as! [Any?]) + case 130: + return LatLngDto.fromList(readValue() as! [Any?]) + case 131: + return NavInfoDto.fromList(readValue() as! [Any?]) + case 132: + return NavigationWaypointDto.fromList(readValue() as! [Any?]) + case 133: + return SpeedingUpdatedEventDto.fromList(readValue() as! [Any?]) + case 134: + return StepInfoDto.fromList(readValue() as! [Any?]) + case 135: + return StepInfoDto.fromList(readValue() as! [Any?]) + default: + return super.readValue(ofType: type) } } } @@ -4503,240 +5304,324 @@ private class NavigationSessionEventApiCodecWriter: FlutterStandardWriter { private class NavigationSessionEventApiCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - return NavigationSessionEventApiCodecReader(data: data) + NavigationSessionEventApiCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return NavigationSessionEventApiCodecWriter(data: data) + NavigationSessionEventApiCodecWriter(data: data) } } class NavigationSessionEventApiCodec: FlutterStandardMessageCodec { - static let shared = NavigationSessionEventApiCodec(readerWriter: NavigationSessionEventApiCodecReaderWriter()) + static let shared = + NavigationSessionEventApiCodec(readerWriter: NavigationSessionEventApiCodecReaderWriter()) } /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. protocol NavigationSessionEventApiProtocol { - func onSpeedingUpdated(msg msgArg: SpeedingUpdatedEventDto, completion: @escaping (Result) -> Void) - func onRoadSnappedLocationUpdated(location locationArg: LatLngDto, completion: @escaping (Result) -> Void) - func onRoadSnappedRawLocationUpdated(location locationArg: LatLngDto, completion: @escaping (Result) -> Void) - func onArrival(waypoint waypointArg: NavigationWaypointDto, completion: @escaping (Result) -> Void) + func onSpeedingUpdated(msg msgArg: SpeedingUpdatedEventDto, + completion: @escaping (Result) -> Void) + func onRoadSnappedLocationUpdated(location locationArg: LatLngDto, + completion: @escaping (Result) -> Void) + func onRoadSnappedRawLocationUpdated(location locationArg: LatLngDto, + completion: @escaping (Result) -> Void) + func onArrival(waypoint waypointArg: NavigationWaypointDto, + completion: @escaping (Result) -> Void) func onRouteChanged(completion: @escaping (Result) -> Void) - func onRemainingTimeOrDistanceChanged(remainingTime remainingTimeArg: Double, remainingDistance remainingDistanceArg: Double, completion: @escaping (Result) -> Void) + func onRemainingTimeOrDistanceChanged(remainingTime remainingTimeArg: Double, + remainingDistance remainingDistanceArg: Double, + completion: @escaping (Result) -> Void) /// Android-only event. func onTrafficUpdated(completion: @escaping (Result) -> Void) /// Android-only event. func onRerouting(completion: @escaping (Result) -> Void) /// Android-only event. - func onGpsAvailabilityUpdate(available availableArg: Bool, completion: @escaping (Result) -> Void) + func onGpsAvailabilityUpdate(available availableArg: Bool, + completion: @escaping (Result) -> Void) /// Turn-by-Turn navigation events. - func onNavInfo(navInfo navInfoArg: NavInfoDto, completion: @escaping (Result) -> Void) + func onNavInfo(navInfo navInfoArg: NavInfoDto, + completion: @escaping (Result) -> Void) } + class NavigationSessionEventApi: NavigationSessionEventApiProtocol { private let binaryMessenger: FlutterBinaryMessenger - init(binaryMessenger: FlutterBinaryMessenger){ + init(binaryMessenger: FlutterBinaryMessenger) { self.binaryMessenger = binaryMessenger } + var codec: FlutterStandardMessageCodec { - return NavigationSessionEventApiCodec.shared + NavigationSessionEventApiCodec.shared } - func onSpeedingUpdated(msg msgArg: SpeedingUpdatedEventDto, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onSpeedingUpdated(msg msgArg: SpeedingUpdatedEventDto, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([msgArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onRoadSnappedLocationUpdated(location locationArg: LatLngDto, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onRoadSnappedLocationUpdated(location locationArg: LatLngDto, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([locationArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onRoadSnappedRawLocationUpdated(location locationArg: LatLngDto, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onRoadSnappedRawLocationUpdated(location locationArg: LatLngDto, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([locationArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onArrival(waypoint waypointArg: NavigationWaypointDto, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onArrival(waypoint waypointArg: NavigationWaypointDto, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([waypointArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } + func onRouteChanged(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } - func onRemainingTimeOrDistanceChanged(remainingTime remainingTimeArg: Double, remainingDistance remainingDistanceArg: Double, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + + func onRemainingTimeOrDistanceChanged(remainingTime remainingTimeArg: Double, + remainingDistance remainingDistanceArg: Double, + completion: @escaping (Result) + -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([remainingTimeArg, remainingDistanceArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } + /// Android-only event. func onTrafficUpdated(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } + /// Android-only event. func onRerouting(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } + /// Android-only event. - func onGpsAvailabilityUpdate(available availableArg: Bool, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func onGpsAvailabilityUpdate(available availableArg: Bool, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([availableArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } + /// Turn-by-Turn navigation events. - func onNavInfo(navInfo navInfoArg: NavInfoDto, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func onNavInfo(navInfo navInfoArg: NavInfoDto, + completion: @escaping (Result) -> Void) { + let channelName = + "dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo" + let channel = FlutterBasicMessageChannel( + name: channelName, + binaryMessenger: binaryMessenger, + codec: codec + ) channel.sendMessage([navInfoArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName:channelName))) + completion(.failure(createConnectionError(withChannelName: channelName))) return } - if (listResponse.count > 1) { + if listResponse.count > 1 { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))); + completion(.failure(FlutterError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } } + /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol NavigationInspector { func isViewAttachedToSession(viewId: Int64) throws -> Bool } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -class NavigationInspectorSetup { +enum NavigationInspectorSetup { /// The codec used by NavigationInspector. /// Sets up an instance of `NavigationInspector` to handle messages through the `binaryMessenger`. static func setUp(binaryMessenger: FlutterBinaryMessenger, api: NavigationInspector?) { - let isViewAttachedToSessionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession", binaryMessenger: binaryMessenger) - if let api = api { + let isViewAttachedToSessionChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession", + binaryMessenger: binaryMessenger + ) + if let api { isViewAttachedToSessionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) diff --git a/lib/src/google_maps_map_view.dart b/lib/src/google_maps_map_view.dart index 9d4ea61..34da352 100644 --- a/lib/src/google_maps_map_view.dart +++ b/lib/src/google_maps_map_view.dart @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; diff --git a/lib/src/google_maps_map_view_controller.dart b/lib/src/google_maps_map_view_controller.dart index 1cf714f..9089823 100644 --- a/lib/src/google_maps_map_view_controller.dart +++ b/lib/src/google_maps_map_view_controller.dart @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import '../google_navigation_flutter.dart'; import 'google_navigation_flutter_platform_interface.dart'; diff --git a/lib/src/google_maps_navigation_view.dart b/lib/src/google_maps_navigation_view.dart index e20a614..dec63a9 100644 --- a/lib/src/google_maps_navigation_view.dart +++ b/lib/src/google_maps_navigation_view.dart @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; diff --git a/lib/src/google_maps_navigation_view_controller.dart b/lib/src/google_maps_navigation_view_controller.dart index bcc2115..1958b94 100644 --- a/lib/src/google_maps_navigation_view_controller.dart +++ b/lib/src/google_maps_navigation_view_controller.dart @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import '../google_navigation_flutter.dart'; import 'google_navigation_flutter_platform_interface.dart'; diff --git a/lib/src/method_channel/common_view_api.dart b/lib/src/method_channel/common_view_api.dart index d9347df..c42c330 100644 --- a/lib/src/method_channel/common_view_api.dart +++ b/lib/src/method_channel/common_view_api.dart @@ -66,8 +66,7 @@ mixin CommonNavigationViewAPI on NavigationViewAPIInterface { void ensureViewAPISetUp() { if (!_viewApiHasBeenSetUp) { ViewEventApi.setup( - ViewEventApiImpl( - viewEventStreamController: _viewEventStreamController), + ViewEventApiImpl(viewEventStreamController: _viewEventStreamController), ); _viewApiHasBeenSetUp = true; } diff --git a/lib/src/method_channel/messages.g.dart b/lib/src/method_channel/messages.g.dart index 8e068fd..932f8eb 100644 --- a/lib/src/method_channel/messages.g.dart +++ b/lib/src/method_channel/messages.g.dart @@ -1,17 +1,17 @@ // Copyright 2023 Google LLC -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // https://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Autogenerated from Pigeon (v15.0.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 @@ -29,7 +29,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 []; } @@ -43,6 +44,7 @@ List wrapResponse({Object? result, PlatformException? error, bool empty enum MapViewTypeDto { /// Navigation view supports navigation overlay, and current navigation session is displayed on the map. navigation, + /// Classic map view, without navigation overlay. map, } @@ -52,6 +54,7 @@ enum NavigationUIEnabledPreferenceDto { /// Navigation UI gets enabled if the navigation /// session has already been successfully started. automatic, + /// Navigation UI is disabled. disabled, } @@ -170,134 +173,199 @@ enum RouteSegmentTrafficDataRoadStretchRenderingDataStyleDto { enum ManeuverDto { /// Arrival at a destination. destination, + /// Starting point of the maneuver. depart, + /// Arrival at a destination located on the left side of the road. destinationLeft, + /// Arrival at a destination located on the right side of the road. destinationRight, + /// Take the boat ferry. ferryBoat, + /// Take the train ferry. ferryTrain, + /// Current road joins another road slightly on the left. forkLeft, + /// Current road joins another road slightly on the right. forkRight, + /// Current road joins another on the left. mergeLeft, + /// Current road joins another on the right. mergeRight, + /// Current road joins another. mergeUnspecified, + /// The street name changes. nameChange, + /// Keep to the left side of the road when exiting a turnpike or freeway as the road diverges. offRampKeepLeft, + /// Keep to the right side of the road when exiting a turnpike or freeway as the road diverges. offRampKeepRight, + /// Regular left turn to exit a turnpike or freeway. offRampLeft, + /// Regular right turn to exit a turnpike or freeway. offRampRight, + /// Sharp left turn to exit a turnpike or freeway. offRampSharpLeft, + /// Sharp right turn to exit a turnpike or freeway. offRampSharpRight, + /// Slight left turn to exit a turnpike or freeway. offRampSlightLeft, + /// Slight right turn to exit a turnpike or freeway. offRampSlightRight, + /// Exit a turnpike or freeway. offRampUnspecified, + /// Clockwise turn onto the opposite side of the street to exit a turnpike or freeway. offRampUTurnClockwise, + /// Counterclockwise turn onto the opposite side of the street to exit a turnpike or freeway. offRampUTurnCounterclockwise, + /// Keep to the left side of the road when entering a turnpike or freeway as the road diverges. onRampKeepLeft, + /// Keep to the right side of the road when entering a turnpike or freeway as the road diverges. onRampKeepRight, + /// Regular left turn to enter a turnpike or freeway. onRampLeft, + /// Regular right turn to enter a turnpike or freeway. onRampRight, + /// Sharp left turn to enter a turnpike or freeway. onRampSharpLeft, + /// Sharp right turn to enter a turnpike or freeway. onRampSharpRight, + /// Slight left turn to enter a turnpike or freeway. onRampSlightLeft, + /// Slight right turn to enter a turnpike or freeway. onRampSlightRight, + /// Enter a turnpike or freeway. onRampUnspecified, + /// Clockwise turn onto the opposite side of the street to enter a turnpike or freeway. onRampUTurnClockwise, + /// Counterclockwise turn onto the opposite side of the street to enter a turnpike or freeway. onRampUTurnCounterclockwise, + /// Enter a roundabout in the clockwise direction. roundaboutClockwise, + /// Enter a roundabout in the counterclockwise direction. roundaboutCounterclockwise, + /// Exit a roundabout in the clockwise direction. roundaboutExitClockwise, + /// Exit a roundabout in the counterclockwise direction. roundaboutExitCounterclockwise, + /// Enter a roundabout in the clockwise direction and turn left. roundaboutLeftClockwise, + /// Enter a roundabout in the counterclockwise direction and turn left. roundaboutLeftCounterclockwise, + /// Enter a roundabout in the clockwise direction and turn right. roundaboutRightClockwise, + /// Enter a roundabout in the counterclockwise direction and turn right. roundaboutRightCounterclockwise, + /// Enter a roundabout in the clockwise direction and turn sharply to the left. roundaboutSharpLeftClockwise, + /// Enter a roundabout in the counterclockwise direction and turn sharply to the left. roundaboutSharpLeftCounterclockwise, + /// Enter a roundabout in the clockwise direction and turn sharply to the right. roundaboutSharpRightClockwise, + /// Enter a roundabout in the counterclockwise direction and turn sharply to the right. roundaboutSharpRightCounterclockwise, + /// Enter a roundabout in the clockwise direction and turn slightly left. roundaboutSlightLeftClockwise, + /// Enter a roundabout in the counterclockwise direction and turn slightly to the left. roundaboutSlightLeftCounterclockwise, + /// Enter a roundabout in the clockwise direction and turn slightly to the right. roundaboutSlightRightClockwise, + /// Enter a roundabout in the counterclockwise direction and turn slightly to the right. roundaboutSlightRightCounterclockwise, + /// Enter a roundabout in the clockwise direction and continue straight. roundaboutStraightClockwise, + /// Enter a roundabout in the counterclockwise direction and continue straight. roundaboutStraightCounterclockwise, + /// Enter a roundabout in the clockwise direction and turn clockwise onto the opposite side of the street. roundaboutUTurnClockwise, + /// Enter a roundabout in the counterclockwise direction and turn counterclockwise onto the opposite side of the street. roundaboutUTurnCounterclockwise, + /// Continue straight. straight, + /// Keep left as the road diverges. turnKeepLeft, + /// Keep right as the road diverges. turnKeepRight, + /// Regular left turn at an intersection. turnLeft, + /// Regular right turn at an intersection. turnRight, + /// Sharp left turn at an intersection. turnSharpLeft, + /// Sharp right turn at an intersection. turnSharpRight, + /// Slight left turn at an intersection. turnSlightLeft, + /// Slight right turn at an intersection. turnSlightRight, + /// Clockwise turn onto the opposite side of the street. turnUTurnClockwise, + /// Counterclockwise turn onto the opposite side of the street. turnUTurnCounterclockwise, + /// Unknown maneuver. unknown, } @@ -306,8 +374,10 @@ enum ManeuverDto { enum DrivingSideDto { /// Drive-on-left side. left, + /// Unspecified side. none, + /// Drive-on-right side. right, } @@ -316,10 +386,13 @@ enum DrivingSideDto { enum NavStateDto { /// Actively navigating. enroute, + /// Actively navigating but searching for a new route. rerouting, + /// Navigation has ended. stopped, + /// Error or unspecified state. unknown, } @@ -328,22 +401,31 @@ enum NavStateDto { enum LaneShapeDto { /// Normal left turn (45-135 degrees). normalLeft, + /// Normal right turn (45-135 degrees). normalRight, + /// Sharp left turn (135-175 degrees). sharpLeft, + /// Sharp right turn (135-175 degrees). sharpRight, + /// Slight left turn (10-45 degrees). slightLeft, + /// Slight right turn (10-45 degrees). slightRight, + /// No turn. straight, + /// Shape is unknown. unknown, + /// A left turn onto the opposite side of the same street (175-180 degrees). uTurnLeft, + /// A right turn onto the opposite side of the same street (175-180 degrees). uTurnRight, } @@ -464,7 +546,8 @@ class NavigationViewOptionsDto { static NavigationViewOptionsDto decode(Object result) { result as List; return NavigationViewOptionsDto( - navigationUIEnabledPreference: NavigationUIEnabledPreferenceDto.values[result[0]! as int], + navigationUIEnabledPreference: + NavigationUIEnabledPreferenceDto.values[result[0]! as int], ); } } @@ -1129,9 +1212,8 @@ class RouteTokenOptionsDto { result as List; return RouteTokenOptionsDto( routeToken: result[0]! as String, - travelMode: result[1] != null - ? TravelModeDto.values[result[1]! as int] - : null, + travelMode: + result[1] != null ? TravelModeDto.values[result[1]! as int] : null, ); } } @@ -1165,7 +1247,8 @@ class DestinationsDto { result as List; return DestinationsDto( waypoints: (result[0] as List?)!.cast(), - displayOptions: NavigationDisplayOptionsDto.decode(result[1]! as List), + displayOptions: + NavigationDisplayOptionsDto.decode(result[1]! as List), routingOptions: result[2] != null ? RoutingOptionsDto.decode(result[2]! as List) : null, @@ -1227,9 +1310,8 @@ class RoutingOptionsDto { ? RoutingStrategyDto.values[result[1]! as int] : null, targetDistanceMeters: (result[2] as List?)?.cast(), - travelMode: result[3] != null - ? TravelModeDto.values[result[3]! as int] - : null, + travelMode: + result[3] != null ? TravelModeDto.values[result[3]! as int] : null, avoidTolls: result[4] as bool?, avoidFerries: result[5] as bool?, avoidHighways: result[6] as bool?, @@ -1522,10 +1604,12 @@ class RouteSegmentTrafficDataRoadStretchRenderingDataDto { ]; } - static RouteSegmentTrafficDataRoadStretchRenderingDataDto decode(Object result) { + static RouteSegmentTrafficDataRoadStretchRenderingDataDto decode( + Object result) { result as List; return RouteSegmentTrafficDataRoadStretchRenderingDataDto( - style: RouteSegmentTrafficDataRoadStretchRenderingDataStyleDto.values[result[0]! as int], + style: RouteSegmentTrafficDataRoadStretchRenderingDataStyleDto + .values[result[0]! as int], lengthMeters: result[1]! as int, offsetMeters: result[2]! as int, ); @@ -1540,7 +1624,8 @@ class RouteSegmentTrafficDataDto { RouteSegmentTrafficDataStatusDto status; - List roadStretchRenderingDataList; + List + roadStretchRenderingDataList; Object encode() { return [ @@ -1553,7 +1638,8 @@ class RouteSegmentTrafficDataDto { result as List; return RouteSegmentTrafficDataDto( status: RouteSegmentTrafficDataStatusDto.values[result[0]! as int], - roadStretchRenderingDataList: (result[1] as List?)!.cast(), + roadStretchRenderingDataList: (result[1] as List?)! + .cast(), ); } } @@ -1852,17 +1938,17 @@ class __NavigationViewCreationApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPositionDto.decode(readValue(buffer)!); - case 129: + case 129: return LatLngBoundsDto.decode(readValue(buffer)!); - case 130: + case 130: return LatLngDto.decode(readValue(buffer)!); - case 131: + case 131: return MapOptionsDto.decode(readValue(buffer)!); - case 132: + case 132: return NavigationViewOptionsDto.decode(readValue(buffer)!); - case 133: + case 133: return ViewCreationOptionsDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1881,11 +1967,14 @@ class _NavigationViewCreationApi { : __pigeon_binaryMessenger = binaryMessenger; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = __NavigationViewCreationApiCodec(); + static const MessageCodec pigeonChannelCodec = + __NavigationViewCreationApiCodec(); Future _create(ViewCreationOptionsDto msg) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1975,43 +2064,43 @@ class _MapViewApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPositionDto.decode(readValue(buffer)!); - case 129: + case 129: return CircleDto.decode(readValue(buffer)!); - case 130: + case 130: return CircleOptionsDto.decode(readValue(buffer)!); - case 131: + case 131: return ImageDescriptorDto.decode(readValue(buffer)!); - case 132: + case 132: return InfoWindowDto.decode(readValue(buffer)!); - case 133: + case 133: return LatLngBoundsDto.decode(readValue(buffer)!); - case 134: + case 134: return LatLngDto.decode(readValue(buffer)!); - case 135: + case 135: return LatLngDto.decode(readValue(buffer)!); - case 136: + case 136: return MarkerAnchorDto.decode(readValue(buffer)!); - case 137: + case 137: return MarkerDto.decode(readValue(buffer)!); - case 138: + case 138: return MarkerOptionsDto.decode(readValue(buffer)!); - case 139: + case 139: return PatternItemDto.decode(readValue(buffer)!); - case 140: + case 140: return PolygonDto.decode(readValue(buffer)!); - case 141: + case 141: return PolygonHoleDto.decode(readValue(buffer)!); - case 142: + case 142: return PolygonOptionsDto.decode(readValue(buffer)!); - case 143: + case 143: return PolylineDto.decode(readValue(buffer)!); - case 144: + case 144: return PolylineOptionsDto.decode(readValue(buffer)!); - case 145: + case 145: return StyleSpanDto.decode(readValue(buffer)!); - case 146: + case 146: return StyleSpanStrokeStyleDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2030,8 +2119,10 @@ class MapViewApi { static const MessageCodec pigeonChannelCodec = _MapViewApiCodec(); Future awaitMapReady(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2052,8 +2143,10 @@ class MapViewApi { } Future isMyLocationEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2079,14 +2172,16 @@ class MapViewApi { } Future setMyLocationEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2101,8 +2196,10 @@ class MapViewApi { } Future getMyLocation(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2123,8 +2220,10 @@ class MapViewApi { } Future getMapType(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2150,14 +2249,16 @@ class MapViewApi { } Future setMapType(int viewId, MapTypeDto mapType) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, mapType.index]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, mapType.index]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2172,14 +2273,16 @@ class MapViewApi { } Future setMapStyle(int viewId, String styleJson) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, styleJson]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, styleJson]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2194,8 +2297,10 @@ class MapViewApi { } Future isNavigationTripProgressBarEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2220,15 +2325,18 @@ class MapViewApi { } } - Future setNavigationTripProgressBarEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future setNavigationTripProgressBarEnabled( + int viewId, bool enabled) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2243,8 +2351,10 @@ class MapViewApi { } Future isNavigationHeaderEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2270,14 +2380,16 @@ class MapViewApi { } Future setNavigationHeaderEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2292,8 +2404,10 @@ class MapViewApi { } Future isNavigationFooterEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2319,14 +2433,16 @@ class MapViewApi { } Future setNavigationFooterEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2341,8 +2457,10 @@ class MapViewApi { } Future isRecenterButtonEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2368,14 +2486,16 @@ class MapViewApi { } Future setRecenterButtonEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2390,8 +2510,10 @@ class MapViewApi { } Future isSpeedLimitIconEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2417,14 +2539,16 @@ class MapViewApi { } Future setSpeedLimitIconEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2439,8 +2563,10 @@ class MapViewApi { } Future isSpeedometerEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2466,14 +2592,16 @@ class MapViewApi { } Future setSpeedometerEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2488,8 +2616,10 @@ class MapViewApi { } Future isTrafficIncidentCardsEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2515,14 +2645,16 @@ class MapViewApi { } Future setTrafficIncidentCardsEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2537,8 +2669,10 @@ class MapViewApi { } Future isNavigationUIEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2564,14 +2698,16 @@ class MapViewApi { } Future setNavigationUIEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2586,8 +2722,10 @@ class MapViewApi { } Future getCameraPosition(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2613,8 +2751,10 @@ class MapViewApi { } Future getVisibleRegion(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2639,15 +2779,19 @@ class MapViewApi { } } - Future followMyLocation(int viewId, CameraPerspectiveDto perspective, double? zoomLevel) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future followMyLocation( + int viewId, CameraPerspectiveDto perspective, double? zoomLevel) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, perspective.index, zoomLevel]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, perspective.index, zoomLevel]) + as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2661,15 +2805,18 @@ class MapViewApi { } } - Future animateCameraToCameraPosition(int viewId, CameraPositionDto cameraPosition, int? duration) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future animateCameraToCameraPosition( + int viewId, CameraPositionDto cameraPosition, int? duration) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, cameraPosition, duration]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, cameraPosition, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2688,15 +2835,18 @@ class MapViewApi { } } - Future animateCameraToLatLng(int viewId, LatLngDto point, int? duration) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future animateCameraToLatLng( + int viewId, LatLngDto point, int? duration) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, point, duration]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, point, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2715,15 +2865,18 @@ class MapViewApi { } } - Future animateCameraToLatLngBounds(int viewId, LatLngBoundsDto bounds, double padding, int? duration) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future animateCameraToLatLngBounds( + int viewId, LatLngBoundsDto bounds, double padding, int? duration) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, bounds, padding, duration]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, bounds, padding, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2742,15 +2895,18 @@ class MapViewApi { } } - Future animateCameraToLatLngZoom(int viewId, LatLngDto point, double zoom, int? duration) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future animateCameraToLatLngZoom( + int viewId, LatLngDto point, double zoom, int? duration) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, point, zoom, duration]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, point, zoom, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2769,15 +2925,19 @@ class MapViewApi { } } - Future animateCameraByScroll(int viewId, double scrollByDx, double scrollByDy, int? duration) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future animateCameraByScroll( + int viewId, double scrollByDx, double scrollByDy, int? duration) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, scrollByDx, scrollByDy, duration]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, scrollByDx, scrollByDy, duration]) + as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2796,15 +2956,19 @@ class MapViewApi { } } - Future animateCameraByZoom(int viewId, double zoomBy, double? focusDx, double? focusDy, int? duration) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future animateCameraByZoom(int viewId, double zoomBy, double? focusDx, + double? focusDy, int? duration) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, zoomBy, focusDx, focusDy, duration]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, zoomBy, focusDx, focusDy, duration]) + as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2823,15 +2987,18 @@ class MapViewApi { } } - Future animateCameraToZoom(int viewId, double zoom, int? duration) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future animateCameraToZoom( + int viewId, double zoom, int? duration) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, zoom, duration]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, zoom, duration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2850,15 +3017,18 @@ class MapViewApi { } } - Future moveCameraToCameraPosition(int viewId, CameraPositionDto cameraPosition) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future moveCameraToCameraPosition( + int viewId, CameraPositionDto cameraPosition) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, cameraPosition]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, cameraPosition]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2873,8 +3043,10 @@ class MapViewApi { } Future moveCameraToLatLng(int viewId, LatLngDto point) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2894,15 +3066,18 @@ class MapViewApi { } } - Future moveCameraToLatLngBounds(int viewId, LatLngBoundsDto bounds, double padding) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future moveCameraToLatLngBounds( + int viewId, LatLngBoundsDto bounds, double padding) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, bounds, padding]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, bounds, padding]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2916,15 +3091,18 @@ class MapViewApi { } } - Future moveCameraToLatLngZoom(int viewId, LatLngDto point, double zoom) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future moveCameraToLatLngZoom( + int viewId, LatLngDto point, double zoom) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, point, zoom]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, point, zoom]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2938,15 +3116,18 @@ class MapViewApi { } } - Future moveCameraByScroll(int viewId, double scrollByDx, double scrollByDy) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future moveCameraByScroll( + int viewId, double scrollByDx, double scrollByDy) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, scrollByDx, scrollByDy]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, scrollByDx, scrollByDy]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2960,15 +3141,18 @@ class MapViewApi { } } - Future moveCameraByZoom(int viewId, double zoomBy, double? focusDx, double? focusDy) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future moveCameraByZoom( + int viewId, double zoomBy, double? focusDx, double? focusDy) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, zoomBy, focusDx, focusDy]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, zoomBy, focusDx, focusDy]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2983,8 +3167,10 @@ class MapViewApi { } Future moveCameraToZoom(int viewId, double zoom) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3005,8 +3191,10 @@ class MapViewApi { } Future showRouteOverview(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3027,8 +3215,10 @@ class MapViewApi { } Future getMinZoomPreference(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3054,8 +3244,10 @@ class MapViewApi { } Future getMaxZoomPreference(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3081,8 +3273,10 @@ class MapViewApi { } Future resetMinMaxZoomPreference(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3102,15 +3296,18 @@ class MapViewApi { } } - Future setMinZoomPreference(int viewId, double minZoomPreference) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future setMinZoomPreference( + int viewId, double minZoomPreference) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, minZoomPreference]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, minZoomPreference]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3124,15 +3321,18 @@ class MapViewApi { } } - Future setMaxZoomPreference(int viewId, double maxZoomPreference) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future setMaxZoomPreference( + int viewId, double maxZoomPreference) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, maxZoomPreference]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, maxZoomPreference]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3147,14 +3347,16 @@ class MapViewApi { } Future setMyLocationButtonEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3168,15 +3370,18 @@ class MapViewApi { } } - Future setConsumeMyLocationButtonClickEventsEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future setConsumeMyLocationButtonClickEventsEnabled( + int viewId, bool enabled) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3191,14 +3396,16 @@ class MapViewApi { } Future setZoomGesturesEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3213,14 +3420,16 @@ class MapViewApi { } Future setZoomControlsEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3235,14 +3444,16 @@ class MapViewApi { } Future setCompassEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3257,14 +3468,16 @@ class MapViewApi { } Future setRotateGesturesEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3279,14 +3492,16 @@ class MapViewApi { } Future setScrollGesturesEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3300,15 +3515,18 @@ class MapViewApi { } } - Future setScrollGesturesDuringRotateOrZoomEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future setScrollGesturesDuringRotateOrZoomEnabled( + int viewId, bool enabled) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3323,14 +3541,16 @@ class MapViewApi { } Future setTiltGesturesEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3345,14 +3565,16 @@ class MapViewApi { } Future setMapToolbarEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3367,14 +3589,16 @@ class MapViewApi { } Future setTrafficEnabled(int viewId, bool enabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, enabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, enabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3389,8 +3613,10 @@ class MapViewApi { } Future isMyLocationButtonEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3416,8 +3642,10 @@ class MapViewApi { } Future isConsumeMyLocationButtonClickEventsEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3443,8 +3671,10 @@ class MapViewApi { } Future isZoomGesturesEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3470,8 +3700,10 @@ class MapViewApi { } Future isZoomControlsEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3497,8 +3729,10 @@ class MapViewApi { } Future isCompassEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3524,8 +3758,10 @@ class MapViewApi { } Future isRotateGesturesEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3551,8 +3787,10 @@ class MapViewApi { } Future isScrollGesturesEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3578,8 +3816,10 @@ class MapViewApi { } Future isScrollGesturesEnabledDuringRotateOrZoom(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3605,8 +3845,10 @@ class MapViewApi { } Future isTiltGesturesEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3632,8 +3874,10 @@ class MapViewApi { } Future isMapToolbarEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3659,8 +3903,10 @@ class MapViewApi { } Future isTrafficEnabled(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3686,8 +3932,10 @@ class MapViewApi { } Future> getMarkers(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3712,15 +3960,18 @@ class MapViewApi { } } - Future> addMarkers(int viewId, List markers) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future> addMarkers( + int viewId, List markers) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, markers]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, markers]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3739,15 +3990,18 @@ class MapViewApi { } } - Future> updateMarkers(int viewId, List markers) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future> updateMarkers( + int viewId, List markers) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, markers]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, markers]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3767,14 +4021,16 @@ class MapViewApi { } Future removeMarkers(int viewId, List markers) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, markers]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, markers]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3789,8 +4045,10 @@ class MapViewApi { } Future clearMarkers(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3811,8 +4069,10 @@ class MapViewApi { } Future clear(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3833,8 +4093,10 @@ class MapViewApi { } Future> getPolygons(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3859,15 +4121,18 @@ class MapViewApi { } } - Future> addPolygons(int viewId, List polygons) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future> addPolygons( + int viewId, List polygons) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, polygons]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, polygons]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3886,15 +4151,18 @@ class MapViewApi { } } - Future> updatePolygons(int viewId, List polygons) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future> updatePolygons( + int viewId, List polygons) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, polygons]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, polygons]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3914,14 +4182,16 @@ class MapViewApi { } Future removePolygons(int viewId, List polygons) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, polygons]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, polygons]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -3936,8 +4206,10 @@ class MapViewApi { } Future clearPolygons(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3958,8 +4230,10 @@ class MapViewApi { } Future> getPolylines(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3984,15 +4258,18 @@ class MapViewApi { } } - Future> addPolylines(int viewId, List polylines) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future> addPolylines( + int viewId, List polylines) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, polylines]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, polylines]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4011,15 +4288,18 @@ class MapViewApi { } } - Future> updatePolylines(int viewId, List polylines) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future> updatePolylines( + int viewId, List polylines) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, polylines]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, polylines]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4039,14 +4319,16 @@ class MapViewApi { } Future removePolylines(int viewId, List polylines) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, polylines]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, polylines]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4061,8 +4343,10 @@ class MapViewApi { } Future clearPolylines(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4083,8 +4367,10 @@ class MapViewApi { } Future> getCircles(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4109,15 +4395,18 @@ class MapViewApi { } } - Future> addCircles(int viewId, List circles) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future> addCircles( + int viewId, List circles) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, circles]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, circles]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4136,15 +4425,18 @@ class MapViewApi { } } - Future> updateCircles(int viewId, List circles) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future> updateCircles( + int viewId, List circles) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, circles]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, circles]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4164,14 +4456,16 @@ class MapViewApi { } Future removeCircles(int viewId, List circles) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([viewId, circles]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([viewId, circles]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4186,8 +4480,10 @@ class MapViewApi { } Future clearCircles(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4208,8 +4504,10 @@ class MapViewApi { } Future registerOnCameraChangedListener(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4248,9 +4546,9 @@ class _ImageRegistryApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ImageDescriptorDto.decode(readValue(buffer)!); - case 129: + case 129: return ImageDescriptorDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -4266,17 +4564,26 @@ class ImageRegistryApi { : __pigeon_binaryMessenger = binaryMessenger; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = _ImageRegistryApiCodec(); + static const MessageCodec pigeonChannelCodec = + _ImageRegistryApiCodec(); - Future registerBitmapImage(String imageId, Uint8List bytes, double imagePixelRatio, double? width, double? height) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future registerBitmapImage( + String imageId, + Uint8List bytes, + double imagePixelRatio, + double? width, + double? height) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([imageId, bytes, imagePixelRatio, width, height]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([imageId, bytes, imagePixelRatio, width, height]) + as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4296,14 +4603,16 @@ class ImageRegistryApi { } Future unregisterImage(ImageDescriptorDto imageDescriptor) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([imageDescriptor]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([imageDescriptor]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4318,8 +4627,10 @@ class ImageRegistryApi { } Future> getRegisteredImages() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4340,13 +4651,16 @@ class ImageRegistryApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (__pigeon_replyList[0] as List?)! + .cast(); } } Future clearRegisteredImages() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4385,9 +4699,9 @@ class _ViewEventApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPositionDto.decode(readValue(buffer)!); - case 129: + case 129: return LatLngDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -4406,7 +4720,8 @@ abstract class ViewEventApi { void onMarkerEvent(int viewId, String markerId, MarkerEventTypeDto eventType); - void onMarkerDragEvent(int viewId, String markerId, MarkerDragEventTypeDto eventType, LatLngDto position); + void onMarkerDragEvent(int viewId, String markerId, + MarkerDragEventTypeDto eventType, LatLngDto position); void onPolygonClicked(int viewId, String polygonId); @@ -4420,19 +4735,22 @@ abstract class ViewEventApi { void onMyLocationButtonClicked(int viewId); - void onCameraChanged(int viewId, CameraEventTypeDto eventType, CameraPositionDto position); + void onCameraChanged( + int viewId, CameraEventTypeDto eventType, CameraPositionDto position); static void setup(ViewEventApi? api, {BinaryMessenger? binaryMessenger}) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapClickEvent was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4445,22 +4763,25 @@ abstract class ViewEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMapLongClickEvent was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4473,22 +4794,25 @@ abstract class ViewEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onRecenterButtonClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4498,22 +4822,25 @@ abstract class ViewEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4521,7 +4848,9 @@ abstract class ViewEventApi { final String? arg_markerId = (args[1] as String?); assert(arg_markerId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent was null, expected non-null String.'); - final MarkerEventTypeDto? arg_eventType = args[2] == null ? null : MarkerEventTypeDto.values[args[2]! as int]; + final MarkerEventTypeDto? arg_eventType = args[2] == null + ? null + : MarkerEventTypeDto.values[args[2]! as int]; assert(arg_eventType != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerEvent was null, expected non-null MarkerEventTypeDto.'); try { @@ -4529,22 +4858,25 @@ abstract class ViewEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4552,33 +4884,39 @@ abstract class ViewEventApi { final String? arg_markerId = (args[1] as String?); assert(arg_markerId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent was null, expected non-null String.'); - final MarkerDragEventTypeDto? arg_eventType = args[2] == null ? null : MarkerDragEventTypeDto.values[args[2]! as int]; + final MarkerDragEventTypeDto? arg_eventType = args[2] == null + ? null + : MarkerDragEventTypeDto.values[args[2]! as int]; assert(arg_eventType != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent was null, expected non-null MarkerDragEventTypeDto.'); final LatLngDto? arg_position = (args[3] as LatLngDto?); assert(arg_position != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMarkerDragEvent was null, expected non-null LatLngDto.'); try { - api.onMarkerDragEvent(arg_viewId!, arg_markerId!, arg_eventType!, arg_position!); + api.onMarkerDragEvent( + arg_viewId!, arg_markerId!, arg_eventType!, arg_position!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolygonClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4591,22 +4929,25 @@ abstract class ViewEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onPolylineClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4619,22 +4960,25 @@ abstract class ViewEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCircleClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4647,22 +4991,25 @@ abstract class ViewEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4671,26 +5018,30 @@ abstract class ViewEventApi { assert(arg_navigationUIEnabled != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onNavigationUIEnabledChanged was null, expected non-null bool.'); try { - api.onNavigationUIEnabledChanged(arg_viewId!, arg_navigationUIEnabled!); + api.onNavigationUIEnabledChanged( + arg_viewId!, arg_navigationUIEnabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4700,22 +5051,25 @@ abstract class ViewEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onMyLocationButtonClicked was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -4725,30 +5079,36 @@ abstract class ViewEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged was null, expected non-null int.'); - final CameraEventTypeDto? arg_eventType = args[1] == null ? null : CameraEventTypeDto.values[args[1]! as int]; + final CameraEventTypeDto? arg_eventType = args[1] == null + ? null + : CameraEventTypeDto.values[args[1]! as int]; assert(arg_eventType != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged was null, expected non-null CameraEventTypeDto.'); - final CameraPositionDto? arg_position = (args[2] as CameraPositionDto?); + final CameraPositionDto? arg_position = + (args[2] as CameraPositionDto?); assert(arg_position != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ViewEventApi.onCameraChanged was null, expected non-null CameraPositionDto.'); try { @@ -4756,8 +5116,9 @@ abstract class ViewEventApi { 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())); } }); } @@ -4825,37 +5186,38 @@ class _NavigationSessionApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return DestinationsDto.decode(readValue(buffer)!); - case 129: + case 129: return LatLngDto.decode(readValue(buffer)!); - case 130: + case 130: return LatLngDto.decode(readValue(buffer)!); - case 131: + case 131: return NavigationAudioGuidanceSettingsDto.decode(readValue(buffer)!); - case 132: + case 132: return NavigationDisplayOptionsDto.decode(readValue(buffer)!); - case 133: + case 133: return NavigationTimeAndDistanceDto.decode(readValue(buffer)!); - case 134: + case 134: return NavigationWaypointDto.decode(readValue(buffer)!); - case 135: + case 135: return NavigationWaypointDto.decode(readValue(buffer)!); - case 136: + case 136: return RouteSegmentDto.decode(readValue(buffer)!); - case 137: + case 137: return RouteSegmentDto.decode(readValue(buffer)!); - case 138: + case 138: return RouteSegmentTrafficDataDto.decode(readValue(buffer)!); - case 139: - return RouteSegmentTrafficDataRoadStretchRenderingDataDto.decode(readValue(buffer)!); - case 140: + case 139: + return RouteSegmentTrafficDataRoadStretchRenderingDataDto.decode( + readValue(buffer)!); + case 140: return RouteTokenOptionsDto.decode(readValue(buffer)!); - case 141: + case 141: return RoutingOptionsDto.decode(readValue(buffer)!); - case 142: + case 142: return SimulationOptionsDto.decode(readValue(buffer)!); - case 143: + case 143: return SpeedAlertOptionsDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -4871,18 +5233,22 @@ class NavigationSessionApi { : __pigeon_binaryMessenger = binaryMessenger; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = _NavigationSessionApiCodec(); + static const MessageCodec pigeonChannelCodec = + _NavigationSessionApiCodec(); /// General. - Future createNavigationSession(bool abnormalTerminationReportingEnabled) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future createNavigationSession( + bool abnormalTerminationReportingEnabled) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([abnormalTerminationReportingEnabled]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([abnormalTerminationReportingEnabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4897,8 +5263,10 @@ class NavigationSessionApi { } Future isInitialized() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4924,8 +5292,10 @@ class NavigationSessionApi { } Future cleanup() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -4945,15 +5315,22 @@ class NavigationSessionApi { } } - Future showTermsAndConditionsDialog(String title, String companyName, bool shouldOnlyShowDriverAwarenessDisclaimer) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future showTermsAndConditionsDialog(String title, String companyName, + bool shouldOnlyShowDriverAwarenessDisclaimer) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([title, companyName, shouldOnlyShowDriverAwarenessDisclaimer]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([ + title, + companyName, + shouldOnlyShowDriverAwarenessDisclaimer + ]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -4973,8 +5350,10 @@ class NavigationSessionApi { } Future areTermsAccepted() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5000,8 +5379,10 @@ class NavigationSessionApi { } Future resetTermsAccepted() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5022,8 +5403,10 @@ class NavigationSessionApi { } Future getNavSDKVersion() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5050,8 +5433,10 @@ class NavigationSessionApi { /// Navigation. Future isGuidanceRunning() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5077,8 +5462,10 @@ class NavigationSessionApi { } Future startGuidance() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5099,8 +5486,10 @@ class NavigationSessionApi { } Future stopGuidance() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5121,8 +5510,10 @@ class NavigationSessionApi { } Future setDestinations(DestinationsDto destinations) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5148,8 +5539,10 @@ class NavigationSessionApi { } Future clearDestinations() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5170,8 +5563,10 @@ class NavigationSessionApi { } Future continueToNextDestination() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5192,8 +5587,10 @@ class NavigationSessionApi { } Future getCurrentTimeAndDistance() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5218,9 +5615,12 @@ class NavigationSessionApi { } } - Future setAudioGuidance(NavigationAudioGuidanceSettingsDto settings) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future setAudioGuidance( + NavigationAudioGuidanceSettingsDto settings) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5241,8 +5641,10 @@ class NavigationSessionApi { } Future setSpeedAlertOptions(SpeedAlertOptionsDto options) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5263,8 +5665,10 @@ class NavigationSessionApi { } Future> getRouteSegments() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5285,13 +5689,16 @@ class NavigationSessionApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (__pigeon_replyList[0] as List?)! + .cast(); } } Future> getTraveledRoute() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5317,8 +5724,10 @@ class NavigationSessionApi { } Future getCurrentRouteSegment() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5340,8 +5749,10 @@ class NavigationSessionApi { /// Simulation Future setUserLocation(LatLngDto location) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5362,8 +5773,10 @@ class NavigationSessionApi { } Future removeUserLocation() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5384,8 +5797,10 @@ class NavigationSessionApi { } Future simulateLocationsAlongExistingRoute() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5405,9 +5820,12 @@ class NavigationSessionApi { } } - Future simulateLocationsAlongExistingRouteWithOptions(SimulationOptionsDto options) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future simulateLocationsAlongExistingRouteWithOptions( + SimulationOptionsDto options) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5427,9 +5845,12 @@ class NavigationSessionApi { } } - Future simulateLocationsAlongNewRoute(List waypoints) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future simulateLocationsAlongNewRoute( + List waypoints) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5454,15 +5875,19 @@ class NavigationSessionApi { } } - Future simulateLocationsAlongNewRouteWithRoutingOptions(List waypoints, RoutingOptionsDto routingOptions) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future simulateLocationsAlongNewRouteWithRoutingOptions( + List waypoints, + RoutingOptionsDto routingOptions) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([waypoints, routingOptions]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([waypoints, routingOptions]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -5481,15 +5906,22 @@ class NavigationSessionApi { } } - Future simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(List waypoints, RoutingOptionsDto routingOptions, SimulationOptionsDto simulationOptions) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future + simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( + List waypoints, + RoutingOptionsDto routingOptions, + SimulationOptionsDto simulationOptions) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([waypoints, routingOptions, simulationOptions]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([waypoints, routingOptions, simulationOptions]) + as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -5509,8 +5941,10 @@ class NavigationSessionApi { } Future pauseSimulation() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5531,8 +5965,10 @@ class NavigationSessionApi { } Future resumeSimulation() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5554,8 +5990,10 @@ class NavigationSessionApi { /// Simulation (iOS only) Future allowBackgroundLocationUpdates(bool allow) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5577,8 +6015,10 @@ class NavigationSessionApi { /// Road snapped location updates. Future enableRoadSnappedLocationUpdates() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5599,8 +6039,10 @@ class NavigationSessionApi { } Future disableRoadSnappedLocationUpdates() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5621,15 +6063,18 @@ class NavigationSessionApi { } /// Enable Turn-by-Turn navigation events. - Future enableTurnByTurnNavigationEvents(int? numNextStepsToPreview) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future enableTurnByTurnNavigationEvents( + int? numNextStepsToPreview) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([numNextStepsToPreview]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([numNextStepsToPreview]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -5644,8 +6089,10 @@ class NavigationSessionApi { } Future disableTurnByTurnNavigationEvents() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -5665,15 +6112,22 @@ class NavigationSessionApi { } } - Future registerRemainingTimeOrDistanceChangedListener(int remainingTimeThresholdSeconds, int remainingDistanceThresholdMeters) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future registerRemainingTimeOrDistanceChangedListener( + int remainingTimeThresholdSeconds, + int remainingDistanceThresholdMeters) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([remainingTimeThresholdSeconds, remainingDistanceThresholdMeters]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([ + remainingTimeThresholdSeconds, + remainingDistanceThresholdMeters + ]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -5724,21 +6178,21 @@ class _NavigationSessionEventApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LaneDirectionDto.decode(readValue(buffer)!); - case 129: + case 129: return LaneDto.decode(readValue(buffer)!); - case 130: + case 130: return LatLngDto.decode(readValue(buffer)!); - case 131: + case 131: return NavInfoDto.decode(readValue(buffer)!); - case 132: + case 132: return NavigationWaypointDto.decode(readValue(buffer)!); - case 133: + case 133: return SpeedingUpdatedEventDto.decode(readValue(buffer)!); - case 134: + case 134: return StepInfoDto.decode(readValue(buffer)!); - case 135: + case 135: return StepInfoDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -5747,7 +6201,8 @@ class _NavigationSessionEventApiCodec extends StandardMessageCodec { } abstract class NavigationSessionEventApi { - static const MessageCodec pigeonChannelCodec = _NavigationSessionEventApiCodec(); + static const MessageCodec pigeonChannelCodec = + _NavigationSessionEventApiCodec(); void onSpeedingUpdated(SpeedingUpdatedEventDto msg); @@ -5759,7 +6214,8 @@ abstract class NavigationSessionEventApi { void onRouteChanged(); - void onRemainingTimeOrDistanceChanged(double remainingTime, double remainingDistance); + void onRemainingTimeOrDistanceChanged( + double remainingTime, double remainingDistance); /// Android-only event. void onTrafficUpdated(); @@ -5773,19 +6229,23 @@ abstract class NavigationSessionEventApi { /// Turn-by-Turn navigation events. void onNavInfo(NavInfoDto navInfo); - static void setup(NavigationSessionEventApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(NavigationSessionEventApi? api, + {BinaryMessenger? binaryMessenger}) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated was null.'); final List args = (message as List?)!; - final SpeedingUpdatedEventDto? arg_msg = (args[0] as SpeedingUpdatedEventDto?); + final SpeedingUpdatedEventDto? arg_msg = + (args[0] as SpeedingUpdatedEventDto?); assert(arg_msg != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onSpeedingUpdated was null, expected non-null SpeedingUpdatedEventDto.'); try { @@ -5793,22 +6253,25 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedLocationUpdated was null.'); final List args = (message as List?)!; final LatLngDto? arg_location = (args[0] as LatLngDto?); assert(arg_location != null, @@ -5818,22 +6281,25 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRoadSnappedRawLocationUpdated was null.'); final List args = (message as List?)!; final LatLngDto? arg_location = (args[0] as LatLngDto?); assert(arg_location != null, @@ -5843,24 +6309,28 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival was null.'); final List args = (message as List?)!; - final NavigationWaypointDto? arg_waypoint = (args[0] as NavigationWaypointDto?); + final NavigationWaypointDto? arg_waypoint = + (args[0] as NavigationWaypointDto?); assert(arg_waypoint != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onArrival was null, expected non-null NavigationWaypointDto.'); try { @@ -5868,15 +6338,18 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRouteChanged', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -5887,22 +6360,25 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged was null.'); final List args = (message as List?)!; final double? arg_remainingTime = (args[0] as double?); assert(arg_remainingTime != null, @@ -5911,19 +6387,23 @@ abstract class NavigationSessionEventApi { assert(arg_remainingDistance != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRemainingTimeOrDistanceChanged was null, expected non-null double.'); try { - api.onRemainingTimeOrDistanceChanged(arg_remainingTime!, arg_remainingDistance!); + api.onRemainingTimeOrDistanceChanged( + arg_remainingTime!, arg_remainingDistance!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onTrafficUpdated', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -5934,15 +6414,18 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onRerouting', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -5953,22 +6436,25 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onGpsAvailabilityUpdate was null.'); final List args = (message as List?)!; final bool? arg_available = (args[0] as bool?); assert(arg_available != null, @@ -5978,22 +6464,25 @@ abstract class NavigationSessionEventApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionEventApi.onNavInfo was null.'); final List args = (message as List?)!; final NavInfoDto? arg_navInfo = (args[0] as NavInfoDto?); assert(arg_navInfo != null, @@ -6003,8 +6492,9 @@ abstract class NavigationSessionEventApi { 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())); } }); } @@ -6020,11 +6510,14 @@ class NavigationInspector { : __pigeon_binaryMessenger = binaryMessenger; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); Future isViewAttachedToSession(int viewId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + const String __pigeon_channelName = + 'dev.flutter.pigeon.google_navigation_flutter.NavigationInspector.isViewAttachedToSession'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, diff --git a/test/google_navigation_flutter_test.dart b/test/google_navigation_flutter_test.dart index 8468df7..b89e741 100644 --- a/test/google_navigation_flutter_test.dart +++ b/test/google_navigation_flutter_test.dart @@ -22,17 +22,16 @@ import 'package:mockito/mockito.dart'; import 'google_navigation_flutter_test.mocks.dart'; import 'messages_test.g.dart'; -@GenerateMocks([ - TestNavigationSessionApi, - TestNavigationViewApi, - TestImageRegistryApi -]) +@GenerateMocks( + [TestNavigationSessionApi, TestMapViewApi, TestImageRegistryApi]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); void onViewCreated(GoogleNavigationViewController controller) {} + void onNavigationViewCreated(GoogleNavigationViewController controller) {} + void onMapViewCreated(GoogleMapViewController controller) {} late MockTestNavigationSessionApi sessionMockApi; - late MockTestNavigationViewApi viewMockApi; + late MockTestMapViewApi viewMockApi; late MockTestImageRegistryApi imageRegistryMockApi; final List platforms = @@ -43,10 +42,10 @@ void main() { setUp(() { sessionMockApi = MockTestNavigationSessionApi(); - viewMockApi = MockTestNavigationViewApi(); + viewMockApi = MockTestMapViewApi(); imageRegistryMockApi = MockTestImageRegistryApi(); TestNavigationSessionApi.setup(sessionMockApi); - TestNavigationViewApi.setup(viewMockApi); + TestMapViewApi.setup(viewMockApi); TestImageRegistryApi.setup(imageRegistryMockApi); }); @@ -61,18 +60,29 @@ void main() { GoogleMapsNavigationPlatform.instance = platform; }); - testWidgets('renders Google Maps Navigation', + testWidgets('renders Google Maps Navigation View', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: GoogleMapsNavigationView( - onViewCreated: onViewCreated, + onViewCreated: onNavigationViewCreated, ), ), ); expect(find.byType(GoogleMapsNavigationView), findsOneWidget); }); + testWidgets('renders Google Maps View', (WidgetTester tester) async { + await tester.pumpWidget( + MaterialApp( + home: GoogleMapsMapView( + onViewCreated: onMapViewCreated, + ), + ), + ); + expect(find.byType(GoogleMapsMapView), findsOneWidget); + }); + group('Navigation view API', () { test('Await map ready api call', () async { // Mock api response diff --git a/test/google_navigation_flutter_test.mocks.dart b/test/google_navigation_flutter_test.mocks.dart index 465aa6f..ad73b60 100644 --- a/test/google_navigation_flutter_test.mocks.dart +++ b/test/google_navigation_flutter_test.mocks.dart @@ -445,12 +445,11 @@ class MockTestNavigationSessionApi extends _i1.Mock ); } -/// A class which mocks [TestNavigationViewApi]. +/// A class which mocks [TestMapViewApi]. /// /// See the documentation for Mockito's code generation for more information. -class MockTestNavigationViewApi extends _i1.Mock - implements _i3.TestNavigationViewApi { - MockTestNavigationViewApi() { +class MockTestMapViewApi extends _i1.Mock implements _i3.TestMapViewApi { + MockTestMapViewApi() { _i1.throwOnMissingStub(this); } diff --git a/test/messages_test.g.dart b/test/messages_test.g.dart index bb0e139..e753f6c 100644 --- a/test/messages_test.g.dart +++ b/test/messages_test.g.dart @@ -1,17 +1,17 @@ // Copyright 2023 Google LLC -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // https://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Autogenerated from Pigeon (v15.0.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, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -93,43 +93,43 @@ class _TestMapViewApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPositionDto.decode(readValue(buffer)!); - case 129: + case 129: return CircleDto.decode(readValue(buffer)!); - case 130: + case 130: return CircleOptionsDto.decode(readValue(buffer)!); - case 131: + case 131: return ImageDescriptorDto.decode(readValue(buffer)!); - case 132: + case 132: return InfoWindowDto.decode(readValue(buffer)!); - case 133: + case 133: return LatLngBoundsDto.decode(readValue(buffer)!); - case 134: + case 134: return LatLngDto.decode(readValue(buffer)!); - case 135: + case 135: return LatLngDto.decode(readValue(buffer)!); - case 136: + case 136: return MarkerAnchorDto.decode(readValue(buffer)!); - case 137: + case 137: return MarkerDto.decode(readValue(buffer)!); - case 138: + case 138: return MarkerOptionsDto.decode(readValue(buffer)!); - case 139: + case 139: return PatternItemDto.decode(readValue(buffer)!); - case 140: + case 140: return PolygonDto.decode(readValue(buffer)!); - case 141: + case 141: return PolygonHoleDto.decode(readValue(buffer)!); - case 142: + case 142: return PolygonOptionsDto.decode(readValue(buffer)!); - case 143: + case 143: return PolylineDto.decode(readValue(buffer)!); - case 144: + case 144: return PolylineOptionsDto.decode(readValue(buffer)!); - case 145: + case 145: return StyleSpanDto.decode(readValue(buffer)!); - case 146: + case 146: return StyleSpanStrokeStyleDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -138,8 +138,10 @@ class _TestMapViewApiCodec extends StandardMessageCodec { } abstract class TestMapViewApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = _TestMapViewApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec pigeonChannelCodec = + _TestMapViewApiCodec(); Future awaitMapReady(int viewId); @@ -191,19 +193,26 @@ abstract class TestMapViewApi { LatLngBoundsDto getVisibleRegion(int viewId); - void followMyLocation(int viewId, CameraPerspectiveDto perspective, double? zoomLevel); + void followMyLocation( + int viewId, CameraPerspectiveDto perspective, double? zoomLevel); - Future animateCameraToCameraPosition(int viewId, CameraPositionDto cameraPosition, int? duration); + Future animateCameraToCameraPosition( + int viewId, CameraPositionDto cameraPosition, int? duration); - Future animateCameraToLatLng(int viewId, LatLngDto point, int? duration); + Future animateCameraToLatLng( + int viewId, LatLngDto point, int? duration); - Future animateCameraToLatLngBounds(int viewId, LatLngBoundsDto bounds, double padding, int? duration); + Future animateCameraToLatLngBounds( + int viewId, LatLngBoundsDto bounds, double padding, int? duration); - Future animateCameraToLatLngZoom(int viewId, LatLngDto point, double zoom, int? duration); + Future animateCameraToLatLngZoom( + int viewId, LatLngDto point, double zoom, int? duration); - Future animateCameraByScroll(int viewId, double scrollByDx, double scrollByDy, int? duration); + Future animateCameraByScroll( + int viewId, double scrollByDx, double scrollByDy, int? duration); - Future animateCameraByZoom(int viewId, double zoomBy, double? focusDx, double? focusDy, int? duration); + Future animateCameraByZoom(int viewId, double zoomBy, double? focusDx, + double? focusDy, int? duration); Future animateCameraToZoom(int viewId, double zoom, int? duration); @@ -211,13 +220,15 @@ abstract class TestMapViewApi { void moveCameraToLatLng(int viewId, LatLngDto point); - void moveCameraToLatLngBounds(int viewId, LatLngBoundsDto bounds, double padding); + void moveCameraToLatLngBounds( + int viewId, LatLngBoundsDto bounds, double padding); void moveCameraToLatLngZoom(int viewId, LatLngDto point, double zoom); void moveCameraByScroll(int viewId, double scrollByDx, double scrollByDy); - void moveCameraByZoom(int viewId, double zoomBy, double? focusDx, double? focusDy); + void moveCameraByZoom( + int viewId, double zoomBy, double? focusDx, double? focusDy); void moveCameraToZoom(int viewId, double zoom); @@ -323,15 +334,20 @@ abstract class TestMapViewApi { static void setup(TestMapViewApi? api, {BinaryMessenger? binaryMessenger}) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.awaitMapReady was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -341,22 +357,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -366,22 +388,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -394,22 +422,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMyLocation was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -419,22 +453,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMapType was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -444,27 +484,34 @@ abstract class TestMapViewApi { return [output.index]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType was null, expected non-null int.'); - final MapTypeDto? arg_mapType = args[1] == null ? null : MapTypeDto.values[args[1]! as int]; + final MapTypeDto? arg_mapType = + args[1] == null ? null : MapTypeDto.values[args[1]! as int]; assert(arg_mapType != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapType was null, expected non-null MapTypeDto.'); try { @@ -472,22 +519,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapStyle was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -500,47 +553,60 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationTripProgressBarEnabled was null, expected non-null int.'); try { - final bool output = api.isNavigationTripProgressBarEnabled(arg_viewId!); + final bool output = + api.isNavigationTripProgressBarEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationTripProgressBarEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -553,22 +619,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationHeaderEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -578,22 +650,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationHeaderEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -606,22 +684,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationFooterEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -631,22 +715,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationFooterEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -659,22 +749,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRecenterButtonEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -684,22 +780,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRecenterButtonEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -712,22 +814,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedLimitIconEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -737,22 +845,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedLimitIconEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -765,22 +879,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isSpeedometerEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -790,22 +910,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setSpeedometerEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -818,22 +944,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficIncidentCardsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -843,22 +975,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficIncidentCardsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -871,22 +1009,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isNavigationUIEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -896,22 +1040,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setNavigationUIEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -924,22 +1074,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCameraPosition was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -949,22 +1105,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getVisibleRegion was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -974,27 +1136,35 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation was null, expected non-null int.'); - final CameraPerspectiveDto? arg_perspective = args[1] == null ? null : CameraPerspectiveDto.values[args[1]! as int]; + final CameraPerspectiveDto? arg_perspective = args[1] == null + ? null + : CameraPerspectiveDto.values[args[1]! as int]; assert(arg_perspective != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.followMyLocation was null, expected non-null CameraPerspectiveDto.'); final double? arg_zoomLevel = (args[2] as double?); @@ -1003,51 +1173,65 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition was null, expected non-null int.'); - final CameraPositionDto? arg_cameraPosition = (args[1] as CameraPositionDto?); + final CameraPositionDto? arg_cameraPosition = + (args[1] as CameraPositionDto?); assert(arg_cameraPosition != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToCameraPosition was null, expected non-null CameraPositionDto.'); final int? arg_duration = (args[2] as int?); try { - final bool output = await api.animateCameraToCameraPosition(arg_viewId!, arg_cameraPosition!, arg_duration); + final bool output = await api.animateCameraToCameraPosition( + arg_viewId!, arg_cameraPosition!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1057,26 +1241,33 @@ abstract class TestMapViewApi { 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLng was null, expected non-null LatLngDto.'); final int? arg_duration = (args[2] as int?); try { - final bool output = await api.animateCameraToLatLng(arg_viewId!, arg_point!, arg_duration); + final bool output = await api.animateCameraToLatLng( + arg_viewId!, arg_point!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1089,26 +1280,33 @@ abstract class TestMapViewApi { 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngBounds was null, expected non-null double.'); final int? arg_duration = (args[3] as int?); try { - final bool output = await api.animateCameraToLatLngBounds(arg_viewId!, arg_bounds!, arg_padding!, arg_duration); + final bool output = await api.animateCameraToLatLngBounds( + arg_viewId!, arg_bounds!, arg_padding!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1121,26 +1319,33 @@ abstract class TestMapViewApi { 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToLatLngZoom was null, expected non-null double.'); final int? arg_duration = (args[3] as int?); try { - final bool output = await api.animateCameraToLatLngZoom(arg_viewId!, arg_point!, arg_zoom!, arg_duration); + final bool output = await api.animateCameraToLatLngZoom( + arg_viewId!, arg_point!, arg_zoom!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1153,26 +1358,33 @@ abstract class TestMapViewApi { 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByScroll was null, expected non-null double.'); final int? arg_duration = (args[3] as int?); try { - final bool output = await api.animateCameraByScroll(arg_viewId!, arg_scrollByDx!, arg_scrollByDy!, arg_duration); + final bool output = await api.animateCameraByScroll( + arg_viewId!, arg_scrollByDx!, arg_scrollByDy!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraByZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1184,26 +1396,33 @@ abstract class TestMapViewApi { final double? arg_focusDy = (args[3] as double?); final int? arg_duration = (args[4] as int?); try { - final bool output = await api.animateCameraByZoom(arg_viewId!, arg_zoomBy!, arg_focusDx, arg_focusDy, arg_duration); + final bool output = await api.animateCameraByZoom(arg_viewId!, + arg_zoomBy!, arg_focusDx, arg_focusDy, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1213,31 +1432,39 @@ abstract class TestMapViewApi { 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.animateCameraToZoom was null, expected non-null double.'); final int? arg_duration = (args[2] as int?); try { - final bool output = await api.animateCameraToZoom(arg_viewId!, arg_zoom!, arg_duration); + final bool output = await api.animateCameraToZoom( + arg_viewId!, arg_zoom!, arg_duration); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition was null, expected non-null int.'); - final CameraPositionDto? arg_cameraPosition = (args[1] as CameraPositionDto?); + final CameraPositionDto? arg_cameraPosition = + (args[1] as CameraPositionDto?); assert(arg_cameraPosition != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToCameraPosition was null, expected non-null CameraPositionDto.'); try { @@ -1245,22 +1472,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLng was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1273,22 +1506,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1300,26 +1539,33 @@ abstract class TestMapViewApi { assert(arg_padding != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngBounds was null, expected non-null double.'); try { - api.moveCameraToLatLngBounds(arg_viewId!, arg_bounds!, arg_padding!); + api.moveCameraToLatLngBounds( + arg_viewId!, arg_bounds!, arg_padding!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToLatLngZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1335,22 +1581,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1362,26 +1614,33 @@ abstract class TestMapViewApi { assert(arg_scrollByDy != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByScroll was null, expected non-null double.'); try { - api.moveCameraByScroll(arg_viewId!, arg_scrollByDx!, arg_scrollByDy!); + api.moveCameraByScroll( + arg_viewId!, arg_scrollByDx!, arg_scrollByDy!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraByZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1392,26 +1651,33 @@ abstract class TestMapViewApi { final double? arg_focusDx = (args[2] as double?); final double? arg_focusDy = (args[3] as double?); try { - api.moveCameraByZoom(arg_viewId!, arg_zoomBy!, arg_focusDx, arg_focusDy); + api.moveCameraByZoom( + arg_viewId!, arg_zoomBy!, arg_focusDx, arg_focusDy); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.moveCameraToZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1424,22 +1690,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.showRouteOverview was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1449,22 +1721,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMinZoomPreference was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1474,22 +1752,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMaxZoomPreference was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1499,22 +1783,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.resetMinMaxZoomPreference was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1524,22 +1814,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMinZoomPreference was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1552,22 +1848,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMaxZoomPreference was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1580,22 +1882,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMyLocationButtonEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1608,22 +1916,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1632,26 +1946,33 @@ abstract class TestMapViewApi { assert(arg_enabled != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setConsumeMyLocationButtonClickEventsEnabled was null, expected non-null bool.'); try { - api.setConsumeMyLocationButtonClickEventsEnabled(arg_viewId!, arg_enabled!); + api.setConsumeMyLocationButtonClickEventsEnabled( + arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1664,22 +1985,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setZoomControlsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1692,22 +2019,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setCompassEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1720,22 +2053,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setRotateGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1748,22 +2087,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1776,22 +2121,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1800,26 +2151,33 @@ abstract class TestMapViewApi { assert(arg_enabled != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setScrollGesturesDuringRotateOrZoomEnabled was null, expected non-null bool.'); try { - api.setScrollGesturesDuringRotateOrZoomEnabled(arg_viewId!, arg_enabled!); + api.setScrollGesturesDuringRotateOrZoomEnabled( + arg_viewId!, arg_enabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTiltGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1832,22 +2190,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setMapToolbarEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1860,22 +2224,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.setTrafficEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1888,22 +2258,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMyLocationButtonEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1913,47 +2289,60 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isConsumeMyLocationButtonClickEventsEnabled was null, expected non-null int.'); try { - final bool output = api.isConsumeMyLocationButtonClickEventsEnabled(arg_viewId!); + final bool output = + api.isConsumeMyLocationButtonClickEventsEnabled(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1963,22 +2352,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isZoomControlsEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -1988,22 +2383,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isCompassEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2013,22 +2414,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isRotateGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2038,22 +2445,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2063,47 +2476,60 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isScrollGesturesEnabledDuringRotateOrZoom was null, expected non-null int.'); try { - final bool output = api.isScrollGesturesEnabledDuringRotateOrZoom(arg_viewId!); + final bool output = + api.isScrollGesturesEnabledDuringRotateOrZoom(arg_viewId!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTiltGesturesEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2113,22 +2539,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isMapToolbarEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2138,22 +2570,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.isTrafficEnabled was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2163,22 +2601,28 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getMarkers was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2188,83 +2632,106 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers was null, expected non-null int.'); - final List? arg_markers = (args[1] as List?)?.cast(); + final List? arg_markers = + (args[1] as List?)?.cast(); assert(arg_markers != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addMarkers was null, expected non-null List.'); try { - final List output = api.addMarkers(arg_viewId!, arg_markers!); + final List output = + api.addMarkers(arg_viewId!, arg_markers!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers was null, expected non-null int.'); - final List? arg_markers = (args[1] as List?)?.cast(); + final List? arg_markers = + (args[1] as List?)?.cast(); assert(arg_markers != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateMarkers was null, expected non-null List.'); try { - final List output = api.updateMarkers(arg_viewId!, arg_markers!); + final List output = + api.updateMarkers(arg_viewId!, arg_markers!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers was null, expected non-null int.'); - final List? arg_markers = (args[1] as List?)?.cast(); + final List? arg_markers = + (args[1] as List?)?.cast(); assert(arg_markers != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeMarkers was null, expected non-null List.'); try { @@ -2272,22 +2739,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearMarkers was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2297,22 +2770,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear', pigeonChannelCodec, - binaryMessenger: binaryMessenger); + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clear was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2322,22 +2801,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolygons was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2347,83 +2832,106 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons was null, expected non-null int.'); - final List? arg_polygons = (args[1] as List?)?.cast(); + final List? arg_polygons = + (args[1] as List?)?.cast(); assert(arg_polygons != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolygons was null, expected non-null List.'); try { - final List output = api.addPolygons(arg_viewId!, arg_polygons!); + final List output = + api.addPolygons(arg_viewId!, arg_polygons!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons was null, expected non-null int.'); - final List? arg_polygons = (args[1] as List?)?.cast(); + final List? arg_polygons = + (args[1] as List?)?.cast(); assert(arg_polygons != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolygons was null, expected non-null List.'); try { - final List output = api.updatePolygons(arg_viewId!, arg_polygons!); + final List output = + api.updatePolygons(arg_viewId!, arg_polygons!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons was null, expected non-null int.'); - final List? arg_polygons = (args[1] as List?)?.cast(); + final List? arg_polygons = + (args[1] as List?)?.cast(); assert(arg_polygons != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolygons was null, expected non-null List.'); try { @@ -2431,22 +2939,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolygons was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2456,22 +2970,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getPolylines was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2481,83 +3001,106 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines was null, expected non-null int.'); - final List? arg_polylines = (args[1] as List?)?.cast(); + final List? arg_polylines = + (args[1] as List?)?.cast(); assert(arg_polylines != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addPolylines was null, expected non-null List.'); try { - final List output = api.addPolylines(arg_viewId!, arg_polylines!); + final List output = + api.addPolylines(arg_viewId!, arg_polylines!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines was null, expected non-null int.'); - final List? arg_polylines = (args[1] as List?)?.cast(); + final List? arg_polylines = + (args[1] as List?)?.cast(); assert(arg_polylines != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updatePolylines was null, expected non-null List.'); try { - final List output = api.updatePolylines(arg_viewId!, arg_polylines!); + final List output = + api.updatePolylines(arg_viewId!, arg_polylines!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines was null, expected non-null int.'); - final List? arg_polylines = (args[1] as List?)?.cast(); + final List? arg_polylines = + (args[1] as List?)?.cast(); assert(arg_polylines != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removePolylines was null, expected non-null List.'); try { @@ -2565,22 +3108,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearPolylines was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2590,22 +3139,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.getCircles was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2615,83 +3170,106 @@ abstract class TestMapViewApi { return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles was null, expected non-null int.'); - final List? arg_circles = (args[1] as List?)?.cast(); + final List? arg_circles = + (args[1] as List?)?.cast(); assert(arg_circles != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.addCircles was null, expected non-null List.'); try { - final List output = api.addCircles(arg_viewId!, arg_circles!); + final List output = + api.addCircles(arg_viewId!, arg_circles!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles was null, expected non-null int.'); - final List? arg_circles = (args[1] as List?)?.cast(); + final List? arg_circles = + (args[1] as List?)?.cast(); assert(arg_circles != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.updateCircles was null, expected non-null List.'); try { - final List output = api.updateCircles(arg_viewId!, arg_circles!); + final List output = + api.updateCircles(arg_viewId!, arg_circles!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles was null, expected non-null int.'); - final List? arg_circles = (args[1] as List?)?.cast(); + final List? arg_circles = + (args[1] as List?)?.cast(); assert(arg_circles != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.removeCircles was null, expected non-null List.'); try { @@ -2699,22 +3277,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.clearCircles was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2724,22 +3308,28 @@ abstract class TestMapViewApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.MapViewApi.registerOnCameraChangedListener was null.'); final List args = (message as List?)!; final int? arg_viewId = (args[0] as int?); assert(arg_viewId != null, @@ -2749,8 +3339,9 @@ abstract class TestMapViewApi { 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())); } }); } @@ -2776,9 +3367,9 @@ class _TestImageRegistryApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ImageDescriptorDto.decode(readValue(buffer)!); - case 129: + case 129: return ImageDescriptorDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2787,10 +3378,13 @@ class _TestImageRegistryApiCodec extends StandardMessageCodec { } abstract class TestImageRegistryApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = _TestImageRegistryApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec pigeonChannelCodec = + _TestImageRegistryApiCodec(); - ImageDescriptorDto registerBitmapImage(String imageId, Uint8List bytes, double imagePixelRatio, double? width, double? height); + ImageDescriptorDto registerBitmapImage(String imageId, Uint8List bytes, + double imagePixelRatio, double? width, double? height); void unregisterImage(ImageDescriptorDto imageDescriptor); @@ -2798,17 +3392,23 @@ abstract class TestImageRegistryApi { void clearRegisteredImages(); - static void setup(TestImageRegistryApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageRegistryApi? api, + {BinaryMessenger? binaryMessenger}) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.registerBitmapImage was null.'); final List args = (message as List?)!; final String? arg_imageId = (args[0] as String?); assert(arg_imageId != null, @@ -2822,28 +3422,40 @@ abstract class TestImageRegistryApi { final double? arg_width = (args[3] as double?); final double? arg_height = (args[4] as double?); try { - final ImageDescriptorDto output = api.registerBitmapImage(arg_imageId!, arg_bytes!, arg_imagePixelRatio!, arg_width, arg_height); + final ImageDescriptorDto output = api.registerBitmapImage( + arg_imageId!, + arg_bytes!, + arg_imagePixelRatio!, + arg_width, + arg_height); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage was null.'); final List args = (message as List?)!; - final ImageDescriptorDto? arg_imageDescriptor = (args[0] as ImageDescriptorDto?); + final ImageDescriptorDto? arg_imageDescriptor = + (args[0] as ImageDescriptorDto?); assert(arg_imageDescriptor != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.unregisterImage was null, expected non-null ImageDescriptorDto.'); try { @@ -2851,46 +3463,59 @@ abstract class TestImageRegistryApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.getRegisteredImages', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { final List output = api.getRegisteredImages(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.ImageRegistryApi.clearRegisteredImages', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.clearRegisteredImages(); 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())); } }); } @@ -2958,37 +3583,38 @@ class _TestNavigationSessionApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return DestinationsDto.decode(readValue(buffer)!); - case 129: + case 129: return LatLngDto.decode(readValue(buffer)!); - case 130: + case 130: return LatLngDto.decode(readValue(buffer)!); - case 131: + case 131: return NavigationAudioGuidanceSettingsDto.decode(readValue(buffer)!); - case 132: + case 132: return NavigationDisplayOptionsDto.decode(readValue(buffer)!); - case 133: + case 133: return NavigationTimeAndDistanceDto.decode(readValue(buffer)!); - case 134: + case 134: return NavigationWaypointDto.decode(readValue(buffer)!); - case 135: + case 135: return NavigationWaypointDto.decode(readValue(buffer)!); - case 136: + case 136: return RouteSegmentDto.decode(readValue(buffer)!); - case 137: + case 137: return RouteSegmentDto.decode(readValue(buffer)!); - case 138: + case 138: return RouteSegmentTrafficDataDto.decode(readValue(buffer)!); - case 139: - return RouteSegmentTrafficDataRoadStretchRenderingDataDto.decode(readValue(buffer)!); - case 140: + case 139: + return RouteSegmentTrafficDataRoadStretchRenderingDataDto.decode( + readValue(buffer)!); + case 140: return RouteTokenOptionsDto.decode(readValue(buffer)!); - case 141: + case 141: return RoutingOptionsDto.decode(readValue(buffer)!); - case 142: + case 142: return SimulationOptionsDto.decode(readValue(buffer)!); - case 143: + case 143: return SpeedAlertOptionsDto.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2997,17 +3623,21 @@ class _TestNavigationSessionApiCodec extends StandardMessageCodec { } abstract class TestNavigationSessionApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = _TestNavigationSessionApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec pigeonChannelCodec = + _TestNavigationSessionApiCodec(); /// General. - Future createNavigationSession(bool abnormalTerminationReportingEnabled); + Future createNavigationSession( + bool abnormalTerminationReportingEnabled); bool isInitialized(); void cleanup(); - Future showTermsAndConditionsDialog(String title, String companyName, bool shouldOnlyShowDriverAwarenessDisclaimer); + Future showTermsAndConditionsDialog(String title, String companyName, + bool shouldOnlyShowDriverAwarenessDisclaimer); bool areTermsAccepted(); @@ -3047,13 +3677,20 @@ abstract class TestNavigationSessionApi { void simulateLocationsAlongExistingRoute(); - void simulateLocationsAlongExistingRouteWithOptions(SimulationOptionsDto options); + void simulateLocationsAlongExistingRouteWithOptions( + SimulationOptionsDto options); - Future simulateLocationsAlongNewRoute(List waypoints); + Future simulateLocationsAlongNewRoute( + List waypoints); - Future simulateLocationsAlongNewRouteWithRoutingOptions(List waypoints, RoutingOptionsDto routingOptions); + Future simulateLocationsAlongNewRouteWithRoutingOptions( + List waypoints, RoutingOptionsDto routingOptions); - Future simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(List waypoints, RoutingOptionsDto routingOptions, SimulationOptionsDto simulationOptions); + Future + simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( + List waypoints, + RoutingOptionsDto routingOptions, + SimulationOptionsDto simulationOptions); void pauseSimulation(); @@ -3072,82 +3709,109 @@ abstract class TestNavigationSessionApi { void disableTurnByTurnNavigationEvents(); - void registerRemainingTimeOrDistanceChangedListener(int remainingTimeThresholdSeconds, int remainingDistanceThresholdMeters); + void registerRemainingTimeOrDistanceChangedListener( + int remainingTimeThresholdSeconds, int remainingDistanceThresholdMeters); - static void setup(TestNavigationSessionApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestNavigationSessionApi? api, + {BinaryMessenger? binaryMessenger}) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession was null.'); final List args = (message as List?)!; - final bool? arg_abnormalTerminationReportingEnabled = (args[0] as bool?); + final bool? arg_abnormalTerminationReportingEnabled = + (args[0] as bool?); assert(arg_abnormalTerminationReportingEnabled != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.createNavigationSession was null, expected non-null bool.'); try { - await api.createNavigationSession(arg_abnormalTerminationReportingEnabled!); + await api.createNavigationSession( + arg_abnormalTerminationReportingEnabled!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isInitialized', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { final bool output = api.isInitialized(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.cleanup', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.cleanup(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog was null.'); final List args = (message as List?)!; final String? arg_title = (args[0] as String?); assert(arg_title != null, @@ -3155,228 +3819,303 @@ abstract class TestNavigationSessionApi { final String? arg_companyName = (args[1] as String?); assert(arg_companyName != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog was null, expected non-null String.'); - final bool? arg_shouldOnlyShowDriverAwarenessDisclaimer = (args[2] as bool?); + final bool? arg_shouldOnlyShowDriverAwarenessDisclaimer = + (args[2] as bool?); assert(arg_shouldOnlyShowDriverAwarenessDisclaimer != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.showTermsAndConditionsDialog was null, expected non-null bool.'); try { - final bool output = await api.showTermsAndConditionsDialog(arg_title!, arg_companyName!, arg_shouldOnlyShowDriverAwarenessDisclaimer!); + final bool output = await api.showTermsAndConditionsDialog( + arg_title!, + arg_companyName!, + arg_shouldOnlyShowDriverAwarenessDisclaimer!); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.areTermsAccepted', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { final bool output = api.areTermsAccepted(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resetTermsAccepted', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.resetTermsAccepted(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getNavSDKVersion', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { final String output = api.getNavSDKVersion(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.isGuidanceRunning', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { final bool output = api.isGuidanceRunning(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.startGuidance', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.startGuidance(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.stopGuidance', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.stopGuidance(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations was null.'); final List args = (message as List?)!; - final DestinationsDto? arg_destinations = (args[0] as DestinationsDto?); + final DestinationsDto? arg_destinations = + (args[0] as DestinationsDto?); assert(arg_destinations != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setDestinations was null, expected non-null DestinationsDto.'); try { - final RouteStatusDto output = await api.setDestinations(arg_destinations!); + final RouteStatusDto output = + await api.setDestinations(arg_destinations!); return [output.index]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.clearDestinations', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.clearDestinations(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.continueToNextDestination', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { - final NavigationWaypointDto? output = api.continueToNextDestination(); + final NavigationWaypointDto? output = + api.continueToNextDestination(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentTimeAndDistance', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { - final NavigationTimeAndDistanceDto output = api.getCurrentTimeAndDistance(); + final NavigationTimeAndDistanceDto output = + api.getCurrentTimeAndDistance(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance was null.'); final List args = (message as List?)!; - final NavigationAudioGuidanceSettingsDto? arg_settings = (args[0] as NavigationAudioGuidanceSettingsDto?); + final NavigationAudioGuidanceSettingsDto? arg_settings = + (args[0] as NavigationAudioGuidanceSettingsDto?); assert(arg_settings != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setAudioGuidance was null, expected non-null NavigationAudioGuidanceSettingsDto.'); try { @@ -3384,24 +4123,31 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions was null.'); final List args = (message as List?)!; - final SpeedAlertOptionsDto? arg_options = (args[0] as SpeedAlertOptionsDto?); + final SpeedAlertOptionsDto? arg_options = + (args[0] as SpeedAlertOptionsDto?); assert(arg_options != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setSpeedAlertOptions was null, expected non-null SpeedAlertOptionsDto.'); try { @@ -3409,79 +4155,103 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getRouteSegments', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { final List output = api.getRouteSegments(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getTraveledRoute', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { final List output = api.getTraveledRoute(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.getCurrentRouteSegment', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { final RouteSegmentDto? output = api.getCurrentRouteSegment(); return [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())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.setUserLocation was null.'); final List args = (message as List?)!; final LatLngDto? arg_location = (args[0] as LatLngDto?); assert(arg_location != null, @@ -3491,62 +4261,81 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.removeUserLocation', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.removeUserLocation(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRoute', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.simulateLocationsAlongExistingRoute(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions was null.'); final List args = (message as List?)!; - final SimulationOptionsDto? arg_options = (args[0] as SimulationOptionsDto?); + final SimulationOptionsDto? arg_options = + (args[0] as SimulationOptionsDto?); assert(arg_options != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongExistingRouteWithOptions was null, expected non-null SimulationOptionsDto.'); try { @@ -3554,144 +4343,193 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute was null.'); final List args = (message as List?)!; - final List? arg_waypoints = (args[0] as List?)?.cast(); + final List? arg_waypoints = + (args[0] as List?)?.cast(); assert(arg_waypoints != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRoute was null, expected non-null List.'); try { - final RouteStatusDto output = await api.simulateLocationsAlongNewRoute(arg_waypoints!); + final RouteStatusDto output = + await api.simulateLocationsAlongNewRoute(arg_waypoints!); return [output.index]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions was null.'); final List args = (message as List?)!; - final List? arg_waypoints = (args[0] as List?)?.cast(); + final List? arg_waypoints = + (args[0] as List?)?.cast(); assert(arg_waypoints != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions was null, expected non-null List.'); - final RoutingOptionsDto? arg_routingOptions = (args[1] as RoutingOptionsDto?); + final RoutingOptionsDto? arg_routingOptions = + (args[1] as RoutingOptionsDto?); assert(arg_routingOptions != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingOptions was null, expected non-null RoutingOptionsDto.'); try { - final RouteStatusDto output = await api.simulateLocationsAlongNewRouteWithRoutingOptions(arg_waypoints!, arg_routingOptions!); + final RouteStatusDto output = + await api.simulateLocationsAlongNewRouteWithRoutingOptions( + arg_waypoints!, arg_routingOptions!); return [output.index]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions was null.'); final List args = (message as List?)!; - final List? arg_waypoints = (args[0] as List?)?.cast(); + final List? arg_waypoints = + (args[0] as List?)?.cast(); assert(arg_waypoints != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions was null, expected non-null List.'); - final RoutingOptionsDto? arg_routingOptions = (args[1] as RoutingOptionsDto?); + final RoutingOptionsDto? arg_routingOptions = + (args[1] as RoutingOptionsDto?); assert(arg_routingOptions != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions was null, expected non-null RoutingOptionsDto.'); - final SimulationOptionsDto? arg_simulationOptions = (args[2] as SimulationOptionsDto?); + final SimulationOptionsDto? arg_simulationOptions = + (args[2] as SimulationOptionsDto?); assert(arg_simulationOptions != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions was null, expected non-null SimulationOptionsDto.'); try { - final RouteStatusDto output = await api.simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions(arg_waypoints!, arg_routingOptions!, arg_simulationOptions!); + final RouteStatusDto output = await api + .simulateLocationsAlongNewRouteWithRoutingAndSimulationOptions( + arg_waypoints!, + arg_routingOptions!, + arg_simulationOptions!); return [output.index]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.pauseSimulation', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.pauseSimulation(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.resumeSimulation', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.resumeSimulation(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.allowBackgroundLocationUpdates was null.'); final List args = (message as List?)!; final bool? arg_allow = (args[0] as bool?); assert(arg_allow != null, @@ -3701,60 +4539,78 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableRoadSnappedLocationUpdates', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.enableRoadSnappedLocationUpdates(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableRoadSnappedLocationUpdates', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.disableRoadSnappedLocationUpdates(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.enableTurnByTurnNavigationEvents was null.'); final List args = (message as List?)!; final int? arg_numNextStepsToPreview = (args[0] as int?); try { @@ -3762,41 +4618,53 @@ abstract class TestNavigationSessionApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.disableTurnByTurnNavigationEvents', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.disableTurnByTurnNavigationEvents(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener was null.'); + 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener was null.'); final List args = (message as List?)!; final int? arg_remainingTimeThresholdSeconds = (args[0] as int?); assert(arg_remainingTimeThresholdSeconds != null, @@ -3805,12 +4673,15 @@ abstract class TestNavigationSessionApi { assert(arg_remainingDistanceThresholdMeters != null, 'Argument for dev.flutter.pigeon.google_navigation_flutter.NavigationSessionApi.registerRemainingTimeOrDistanceChangedListener was null, expected non-null int.'); try { - api.registerRemainingTimeOrDistanceChangedListener(arg_remainingTimeThresholdSeconds!, arg_remainingDistanceThresholdMeters!); + api.registerRemainingTimeOrDistanceChangedListener( + arg_remainingTimeThresholdSeconds!, + arg_remainingDistanceThresholdMeters!); 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())); } }); } From a45a1b8090090af95e4062c6499237b59b1e4e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Tue, 15 Oct 2024 15:06:30 +0800 Subject: [PATCH 05/18] fix: flutter analyze fix --- test/google_navigation_flutter_test.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/test/google_navigation_flutter_test.dart b/test/google_navigation_flutter_test.dart index b89e741..1793b7a 100644 --- a/test/google_navigation_flutter_test.dart +++ b/test/google_navigation_flutter_test.dart @@ -26,7 +26,6 @@ import 'messages_test.g.dart'; [TestNavigationSessionApi, TestMapViewApi, TestImageRegistryApi]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); - void onViewCreated(GoogleNavigationViewController controller) {} void onNavigationViewCreated(GoogleNavigationViewController controller) {} void onMapViewCreated(GoogleMapViewController controller) {} From d39c3427ae8a6487075f4eb42745a59222a98fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Wed, 16 Oct 2024 14:48:00 +0800 Subject: [PATCH 06/18] feature: example app multiple map page supports now non-navigation map --- example/lib/pages/multiple_views.dart | 205 ++++++++++++++++-- .../GoogleMapsNavigationSessionManager.swift | 2 +- 2 files changed, 189 insertions(+), 18 deletions(-) diff --git a/example/lib/pages/multiple_views.dart b/example/lib/pages/multiple_views.dart index 3e5da71..02ac076 100644 --- a/example/lib/pages/multiple_views.dart +++ b/example/lib/pages/multiple_views.dart @@ -14,9 +14,13 @@ // ignore_for_file: public_member_api_docs, unused_field, use_setters_to_change_properties +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:google_navigation_flutter/google_navigation_flutter.dart'; import '../widgets/widgets.dart'; +import '../utils/utils.dart'; +import 'navigation.dart'; class MultipleMapViewsPage extends ExamplePage { const MultipleMapViewsPage({super.key}) @@ -39,24 +43,172 @@ class _MultiplexState extends ExamplePageState { // Counter to keep track of the number of camera moves to alternate between the two cameras. int _cameraMoveCounter = 0; - GoogleNavigationViewController? _firstNavigationController; - GoogleNavigationViewController? _secondNavigationController; + bool _termsAndConditionsAccepted = false; + bool _locationPermissionsAccepted = false; + bool _navigatorInitialized = false; + bool _guidanceRunning = false; + bool _validRoute = false; + + final List _waypoints = []; + int _nextWaypointIndex = 0; + + SimulationState _simulationState = SimulationState.notRunning; + + /// Camera location used to initialize the map view on simulator if location + /// is not available by the given timeout [_userLocationTimeoutMS]. + static const LatLng cameraLocationMIT = + LatLng(latitude: 42.3601, longitude: -71.094013); + static const int _userLocationTimeoutMS = 1500; + + /// Latest user location received from the navigator. + LatLng? _userLocation; + + /// Used to track if navigator has been initialized at least once. + /// In this example app navigator can be cleaned up and re-initialized. + /// This variable is used to make sure that navigator is initialized before + /// showing the navigation view. + bool _navigatorInitializedAtLeastOnce = false; + + GoogleMapViewController? _mapController; + GoogleNavigationViewController? _navigationController; + + @override + void initState() { + super.initState(); + unawaited(_initialize()); + } + + @override + void dispose() { + GoogleMapsNavigator.cleanup(); + clearRegisteredImages(); + super.dispose(); + } + + Future _initialize() async { + // Check if terms and conditions have been accepted and show dialog if not. + await _showTermsAndConditionsDialogIfNeeded(); + + // Check if location permissions have been accepted and show dialog if not. + await _askLocationPermissionsIfNeeded(); + + // Initilize navigator if terms and conditions and location permissions + // have been accepted. + if (_termsAndConditionsAccepted && _locationPermissionsAccepted) { + await _initializeNavigator(); + } + } + + Future _initializeNavigator() async { + assert(_termsAndConditionsAccepted, 'Terms must be accepted'); + assert( + _locationPermissionsAccepted, 'Location permissions must be granted'); + + if (!_navigatorInitialized) { + debugPrint('Initializing new navigation session...'); + await GoogleMapsNavigator.initializeNavigationSession(); + //await _setupListeners(); + await _updateNavigatorInitializationState(); + await _restorePossibleNavigatorState(); + unawaited(_setDefaultUserLocationAfterDelay()); + debugPrint('Navigator has been initialized: $_navigatorInitialized'); + } + setState(() {}); + } + + /// iOS emulator does not update location and does not fire roadsnapping + /// events. Initialize user location to [cameraLocationMIT] if user + /// location is not available after timeout. + Future _setDefaultUserLocationAfterDelay() async { + Future.delayed(const Duration(milliseconds: _userLocationTimeoutMS), + () async { + if (mounted && _userLocation == null) { + _userLocation = + await _navigationController?.getMyLocation() ?? cameraLocationMIT; + if (mounted) { + setState(() {}); + } + } + }); + } + + // Navigator state is not persisted between app restarts, so we need to check + // if there is a valid route and guidance running, and restore the state. + Future _restorePossibleNavigatorState() async { + if (_navigatorInitialized) { + final List waypoints = await _getWaypoints(); + + // Restore local waypoint index + if (waypoints.isNotEmpty) { + final List parts = waypoints.last.title.split(' '); + if (parts.length == 2) { + _nextWaypointIndex = int.tryParse(parts.last) ?? 0; + } + + _validRoute = true; + _waypoints.clear(); + _waypoints.addAll(waypoints); + } + + _guidanceRunning = await GoogleMapsNavigator.isGuidanceRunning(); + if (_guidanceRunning) { + // Guidance is running, but there is currently no way to check if + // simulation is running as well, so we set it's state as unknown. + _simulationState = SimulationState.unknown; + } - void _onViewCreated(GoogleNavigationViewController controller) { - _firstNavigationController = controller; + setState(() {}); + } } - void _onViewCreated2(GoogleNavigationViewController controller) { - _secondNavigationController = controller; + // Helper function to update local waypoint data from the navigation session. + Future> _getWaypoints() async { + assert(_navigatorInitialized); + final List routeSegments = + await GoogleMapsNavigator.getRouteSegments(); + return routeSegments + .where((RouteSegment e) => e.destinationWaypoint != null) + .map((RouteSegment e) => e.destinationWaypoint!) + .toList(); + } + + Future _updateNavigatorInitializationState() async { + _navigatorInitialized = await GoogleMapsNavigator.isInitialized(); + if (_navigatorInitialized) { + _navigatorInitializedAtLeastOnce = true; + } + setState(() {}); + } + + Future _showTermsAndConditionsDialogIfNeeded() async { + _termsAndConditionsAccepted = await requestTermsAndConditionsAcceptance(); + setState(() {}); + } + + Future _askLocationPermissionsIfNeeded() async { + _locationPermissionsAccepted = await requestLocationDialogAcceptance(); + setState(() {}); + } + + void _onViewCreated(GoogleMapViewController controller) { + setState(() { + _mapController = controller; + }); + } + + Future _onViewCreated2( + GoogleNavigationViewController controller) async { + setState(() { + _navigationController = controller; + }); + await controller.setMyLocationEnabled(true); } Future _moveCameras() async { - await _firstNavigationController!.moveCamera(CameraUpdate.newCameraPosition( + await _mapController!.moveCamera(CameraUpdate.newCameraPosition( _cameraMoveCounter.isEven ? cameraPositionOxford : cameraPositionMIT)); - await _secondNavigationController!.moveCamera( - CameraUpdate.newCameraPosition(_cameraMoveCounter.isOdd - ? cameraPositionOxford - : cameraPositionMIT)); + await _navigationController!.moveCamera(CameraUpdate.newCameraPosition( + _cameraMoveCounter.isOdd ? cameraPositionOxford : cameraPositionMIT)); setState(() { _cameraMoveCounter += 1; }); @@ -72,22 +224,41 @@ class _MultiplexState extends ExamplePageState { children: [ SizedBox( height: 200, - child: GoogleMapsNavigationView( + child: GoogleMapsMapView( onViewCreated: _onViewCreated, ), ), const SizedBox(height: 20), SizedBox( height: 200, - child: GoogleMapsNavigationView( - onViewCreated: _onViewCreated2, - ), + child: _navigatorInitializedAtLeastOnce && + _userLocation != null + ? GoogleMapsNavigationView( + onViewCreated: _onViewCreated2, + initialCameraPosition: CameraPosition( + // Initialize map to user location. + target: _userLocation!, + zoom: 15, + ), + ) + : const Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('Waiting navigator and user location'), + SizedBox(height: 10), + SizedBox( + width: 30, + height: 30, + child: CircularProgressIndicator()) + ], + ), + ), ), const SizedBox( height: 50, ), - if (_firstNavigationController != null && - _secondNavigationController != null) + if (_mapController != null && _navigationController != null) ElevatedButton( onPressed: _moveCameras, child: const Text('Move cameras'), diff --git a/ios/Classes/GoogleMapsNavigationSessionManager.swift b/ios/Classes/GoogleMapsNavigationSessionManager.swift index 1eaf620..5f85d75 100644 --- a/ios/Classes/GoogleMapsNavigationSessionManager.swift +++ b/ios/Classes/GoogleMapsNavigationSessionManager.swift @@ -136,7 +136,7 @@ class GoogleMapsNavigationSessionManager: NSObject { _session?.roadSnappedLocationProvider?.add(self) // Attach navigation session to all existing maps views. - try _viewRegistry?.getAllRegisteredViewIds().forEach { id in + try _viewRegistry?.getAllRegisteredNavigationViewIds().forEach { id in try attachNavigationSessionToMapView(mapId: id) } } From 552c7f174c53acd2f45eec7170abf5afc1962e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Wed, 16 Oct 2024 15:07:53 +0800 Subject: [PATCH 07/18] docs: update readme for non-navigation map view --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index e73bb11..c6705fe 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ The view can be controlled with the `GoogleNavigationViewController` that is pas The `GoogleMapsNavigationView` widget should be used within a widget with a bounded size. Using it in an unbounded widget will cause the application to throw a Flutter exception. +You can also add a bare GoogleMapsMapView that works as a normal map view without navigation functionality. + ### Add a navigation view ```dart @@ -139,6 +141,29 @@ class _NavigationSampleState extends State { } ``` +### Add a map view + +```dart +@override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text('Google Maps Navigation Sample')), + body: _navigationSessionInitialized + ? GoogleMapsMapView( + onViewCreated: _onViewCreated, + initialCameraPosition: CameraPosition( + // Initialize map to user location. + target: _userLocation!, + zoom: 15, + ), + // Other view initialization settings + ) + : const Center(child: CircularProgressIndicator()), + ); + } + +``` + See the [example](./example) directory for a complete navigation sample app. ### Requesting and handling permissions From 3f044c47cf47cb80c8e5879b5cbfacf31e150c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Thu, 17 Oct 2024 13:56:18 +0800 Subject: [PATCH 08/18] fix: remove navigation variables and references from map view files --- lib/src/google_maps_map_view.dart | 16 +- lib/src/google_maps_map_view_controller.dart | 164 +------------------ 2 files changed, 10 insertions(+), 170 deletions(-) diff --git a/lib/src/google_maps_map_view.dart b/lib/src/google_maps_map_view.dart index 34da352..78bce38 100644 --- a/lib/src/google_maps_map_view.dart +++ b/lib/src/google_maps_map_view.dart @@ -24,13 +24,13 @@ typedef OnMapViewCreatedCallback = void Function( GoogleMapViewController controller, ); -/// The main map view widget for Google Maps Navigation. -/// {@category Navigation View} +/// The main map view widget for Google Maps Map View. +/// {@category Map View} class GoogleMapsMapView extends StatefulWidget { - /// The main widget for embedding Google Maps Navigation into a Flutter application. + /// The main widget for embedding Google Maps Map View into a Flutter application. /// /// After creating the map view, the [onViewCreated] callback is triggered, providing a - /// [GoogleNavigationViewController] that you can use to interact with the map programmatically. + /// [GoogleMapViewController] that you can use to interact with the map programmatically. /// /// Example usage: /// ```dart @@ -75,7 +75,6 @@ class GoogleMapsMapView extends StatefulWidget { this.onPolygonClicked, this.onPolylineClicked, this.onCircleClicked, - this.onNavigationUIEnabledChanged, this.onMyLocationClicked, this.onMyLocationButtonClicked, this.onCameraMoveStarted, @@ -214,9 +213,6 @@ class GoogleMapsMapView extends StatefulWidget { /// On circle clicked callback. final OnCircleClicked? onCircleClicked; - /// On navigation UI enabled changed callback. - final OnNavigationUIEnabledChanged? onNavigationUIEnabledChanged; - /// On my location clicked callback. final OnMyLocationClicked? onMyLocationClicked; @@ -243,8 +239,8 @@ class GoogleMapsMapView extends StatefulWidget { State createState() => GoogleMapsMapViewState(); } -/// Google Maps Navigation. -/// {@category Navigation View} +/// Google Maps Map View. +/// {@category Map View} class GoogleMapsMapViewState extends State { @override Widget build(BuildContext context) { diff --git a/lib/src/google_maps_map_view_controller.dart b/lib/src/google_maps_map_view_controller.dart index 9089823..eac5bb7 100644 --- a/lib/src/google_maps_map_view_controller.dart +++ b/lib/src/google_maps_map_view_controller.dart @@ -15,13 +15,13 @@ import '../google_navigation_flutter.dart'; import 'google_navigation_flutter_platform_interface.dart'; -/// Navigation View Controller class to handle navigation view events. -/// {@category Navigation View} +/// Map View Controller class to handle map view events. +/// {@category Map View} class GoogleMapViewController { /// Basic constructor. /// /// Don't create this directly, but access through - /// [GoogleMapsNavigationView.onViewCreated] callback. + /// [GoogleMapsMapView.onViewCreated] callback. GoogleMapViewController(this._viewId, [this._viewState]) : settings = NavigationViewUISettings(_viewId) { _initListeners(); @@ -135,11 +135,6 @@ class GoogleMapViewController { /// Change status of my location enabled. /// - /// By default, the my location layer is disabled, but gets - /// automatically enabled on Android when the navigation starts. - /// - /// On iOS this property doesn't control the my location indication during - /// the navigation. Future setMyLocationEnabled(bool enabled) { return GoogleMapsNavigationPlatform.instance .setMyLocationEnabled(viewId: _viewId, enabled: enabled); @@ -159,7 +154,7 @@ class GoogleMapViewController { /// /// Example usage: /// ```dart - /// _navigationViewController.changeMapType(MapType.satellite); + /// _mapViewController.changeMapType(MapType.satellite); /// ``` Future setMapType({required MapType mapType}) async { return GoogleMapsNavigationPlatform.instance @@ -180,11 +175,6 @@ class GoogleMapViewController { /// Gets whether the my location is enabled or disabled. /// - /// By default, the my location layer is disabled, but gets - /// automatically enabled on Android when the navigation starts. - /// - /// On iOS this property doesn't control the my location indication during - /// the navigation. Future isMyLocationEnabled() async { return GoogleMapsNavigationPlatform.instance .isMyLocationEnabled(viewId: _viewId); @@ -194,19 +184,6 @@ class GoogleMapViewController { /// /// Use [perspective] to specify the orientation of the camera /// and optional [zoomLevel] to control the map zoom. - /// - /// Automatically started in the perspective [CameraPerspective.tilted] when - /// the navigation is initialized with [GoogleMapsNavigator.initializeNavigationSession] - /// or when navigation UI gets re-enabled with [setNavigationUIEnabled]. - /// - /// In Android, you can use [GoogleMapsNavigationView.onCameraStartedFollowingLocation] - /// and [GoogleMapsNavigationView.onCameraStoppedFollowingLocation] callbacks - /// to detect when the follow location mode is enabled or disabled. - /// - /// Note there are small differences on how Android and iOS handle the camera - /// during the follow my location mode (tilt, zoom, transitions, etc.). - /// - /// See also [GoogleMapsNavigator.startGuidance], [showRouteOverview] and [animateCamera]. Future followMyLocation(CameraPerspective perspective, {double? zoomLevel}) async { return GoogleMapsNavigationPlatform.instance.followMyLocation( @@ -269,58 +246,6 @@ class GoogleMapViewController { .moveCamera(viewId: _viewId, cameraUpdate: cameraUpdate); } - /// Is the navigation trip progress bar enabled. - Future isNavigationTripProgressBarEnabled() { - return GoogleMapsNavigationPlatform.instance - .isNavigationTripProgressBarEnabled(viewId: _viewId); - } - - /// Enable or disable the navigation trip progress bar. - /// - /// By default, the navigation trip progress bar is disabled. - Future setNavigationTripProgressBarEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance - .setNavigationTripProgressBarEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Is the navigation header enabled. - Future isNavigationHeaderEnabled() { - return GoogleMapsNavigationPlatform.instance - .isNavigationHeaderEnabled(viewId: _viewId); - } - - /// Enable or disable the navigation header. - /// - /// By default, the navigation header is enabled. - Future setNavigationHeaderEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setNavigationHeaderEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Is the navigation footer enabled. - Future isNavigationFooterEnabled() { - return GoogleMapsNavigationPlatform.instance - .isNavigationFooterEnabled(viewId: _viewId); - } - - /// Enable or disable the navigation footer. - /// - /// By default, the navigation footer is enabled. - /// - /// Also known as ETA card, for example in Android - /// calls [setEtaCardEnabled().](https://developers.google.com/maps/documentation/navigation/android-sdk/v1/reference/com/google/android/libraries/navigation/NavigationView#setEtaCardEnabled(boolean)) - Future setNavigationFooterEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setNavigationFooterEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - /// Is the recenter button enabled. Future isRecenterButtonEnabled() { return GoogleMapsNavigationPlatform.instance @@ -337,87 +262,6 @@ class GoogleMapViewController { ); } - /// Can the speed limit indication be displayed. - Future isSpeedLimitIconEnabled() { - return GoogleMapsNavigationPlatform.instance - .isSpeedLimitIconEnabled(viewId: _viewId); - } - - /// Allow showing the speed limit indicator. - /// - /// By default, the speed limit is not displayed. - Future setSpeedLimitIconEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setSpeedLimitIconEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Can the speedometer be displayed. - Future isSpeedometerEnabled() { - return GoogleMapsNavigationPlatform.instance - .isSpeedometerEnabled(viewId: _viewId); - } - - /// Allow showing the speedometer. - /// - /// By default, the speedometer is not displayed. - Future setSpeedometerEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setSpeedometerEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Are the incident cards displayed. - Future isTrafficIncidentCardsEnabled() { - return GoogleMapsNavigationPlatform.instance - .isTrafficIncidentCardsEnabled(viewId: _viewId); - } - - /// Enable or disable showing of the incident cards. - /// - /// By default, the incident cards are shown. - Future setTrafficIncidentCardsEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setTrafficIncidentCardsEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Check if the navigation user interface is shown. - Future isNavigationUIEnabled() { - return GoogleMapsNavigationPlatform.instance - .isNavigationUIEnabled(viewId: _viewId); - } - - /// Show or hide the navigation user interface shown on top of the map. - /// - /// When enabled also actives [followMyLocation] camera mode. - /// - /// Disabling hides routes on iOS, but on Android the routes stay visible. - /// - /// By default, the navigation UI is enabled when the session has been - /// initialized with [GoogleMapsNavigator.initializeNavigationSession]. - /// - /// Fails on Android if the navigation session has not been initialized, - /// and on iOS if the terms and conditions have not been accepted. - Future setNavigationUIEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setNavigationUIEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Move the map camera to show the route overview. - /// - /// See also [followMyLocation] and [animateCamera]. - Future showRouteOverview() { - return GoogleMapsNavigationPlatform.instance.showRouteOverview( - viewId: _viewId, - ); - } - /// Returns the minimum zoom level preference from the map view. /// If minimum zoom preference is not set previously, returns minimum possible /// zoom level for the current map type. From 9cffa516f57a68a23faa15fc337ce07af116aa3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Thu, 17 Oct 2024 16:19:33 +0800 Subject: [PATCH 09/18] docs: update dart doc --- dartdoc_options.yaml | 5 ++++- doc/map-view.md | 0 lib/src/google_maps_map_view_controller.dart | 2 +- lib/src/google_navigation_flutter.dart | 8 ++++++++ lib/src/types/circles.dart | 3 +++ lib/src/types/lat_lng.dart | 1 + lib/src/types/lat_lng_bounds.dart | 1 + lib/src/types/markers.dart | 8 ++++++++ lib/src/types/navigation_view_types.dart | 11 +++++++++++ lib/src/types/polygons.dart | 3 +++ lib/src/types/polylines.dart | 6 ++++++ lib/src/types/stroke_patterns.dart | 5 +++++ lib/src/types/view_initialization_options.dart | 2 ++ 13 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 doc/map-view.md diff --git a/dartdoc_options.yaml b/dartdoc_options.yaml index a028247..f52b430 100644 --- a/dartdoc_options.yaml +++ b/dartdoc_options.yaml @@ -20,10 +20,13 @@ dartdoc: "Navigation View": markdown: doc/navigation-view.md name: Navigation View + "Map View": + markdown: doc/map-view.md + name: Map View "Image Registry": markdown: doc/image-registry.md name: Image Registry - categoryOrder: ["Navigation", "Navigation View", "Image Registry"] + categoryOrder: ["Map View", "Navigation", "Navigation View", "Image Registry"] showUndocumentedCategories: true nodoc: ['**/*.g.dart'] diff --git a/doc/map-view.md b/doc/map-view.md new file mode 100644 index 0000000..e69de29 diff --git a/lib/src/google_maps_map_view_controller.dart b/lib/src/google_maps_map_view_controller.dart index eac5bb7..19ee629 100644 --- a/lib/src/google_maps_map_view_controller.dart +++ b/lib/src/google_maps_map_view_controller.dart @@ -226,7 +226,7 @@ class GoogleMapViewController { /// On iOS [duration] and [onFinished] are not supported and defining them /// does nothing. /// - /// See also [moveCamera], [followMyLocation], [showRouteOverview]. + /// See also [moveCamera], [followMyLocation]. Future animateCamera(CameraUpdate cameraUpdate, {Duration? duration, AnimationFinishedCallback? onFinished}) { return GoogleMapsNavigationPlatform.instance.animateCamera( diff --git a/lib/src/google_navigation_flutter.dart b/lib/src/google_navigation_flutter.dart index ebd0243..2483e34 100644 --- a/lib/src/google_navigation_flutter.dart +++ b/lib/src/google_navigation_flutter.dart @@ -161,6 +161,7 @@ typedef OnCameraStoppedFollowingLocation = void Function( /// Settings for the user interface of the map. /// {@category Navigation View} +/// {@category Map View} class NavigationViewUISettings { /// [NavigationViewUISettings] constructor. NavigationViewUISettings(this._viewId); @@ -347,6 +348,7 @@ class NavigationViewUISettings { /// [GoogleNavigationViewController.removeMarkers] failed /// to find the marker given to the method. /// {@category Navigation View} +/// {@category Map View} class MarkerNotFoundException implements Exception { /// Default constructor for [MarkerNotFoundException]. const MarkerNotFoundException(); @@ -356,6 +358,7 @@ class MarkerNotFoundException implements Exception { /// [GoogleNavigationViewController.removePolygons] failed /// to find the polygon given to the method. /// {@category Navigation View} +/// {@category Map View} class PolygonNotFoundException implements Exception { /// Default constructor for [PolygonNotFoundException]. const PolygonNotFoundException(); @@ -365,6 +368,7 @@ class PolygonNotFoundException implements Exception { /// [GoogleNavigationViewController.removePolylines] failed /// to find the polyline given to the method. /// {@category Navigation View} +/// {@category Map View} class PolylineNotFoundException implements Exception { /// Default constructor for [PolylineNotFoundException]. const PolylineNotFoundException(); @@ -374,6 +378,7 @@ class PolylineNotFoundException implements Exception { /// [GoogleNavigationViewController.removeCircles] failed /// to find the circle given to the method. /// {@category Navigation View} +/// {@category Map View} class CircleNotFoundException implements Exception { /// Default constructor for [CircleNotFoundException]. const CircleNotFoundException(); @@ -381,6 +386,7 @@ class CircleNotFoundException implements Exception { /// [GoogleNavigationViewController.setMapStyle] failed to set the map style. /// {@category Navigation View} +/// {@category Map View} class MapStyleException implements Exception { /// Default constructor for [MapStyleException]. const MapStyleException(); @@ -388,6 +394,7 @@ class MapStyleException implements Exception { /// [GoogleNavigationViewController.setMaxZoomPreference] failed to set zoom level. /// {@category Navigation View} +/// {@category Map View} class MaxZoomRangeException implements Exception { /// Default constructor for [MaxZoomRangeException]. const MaxZoomRangeException(); @@ -400,6 +407,7 @@ class MaxZoomRangeException implements Exception { /// [GoogleNavigationViewController.setMinZoomPreference] failed to set zoom level. /// {@category Navigation View} +/// {@category Map View} class MinZoomRangeException implements Exception { /// Default constructor for [MinZoomRangeException]. const MinZoomRangeException(); diff --git a/lib/src/types/circles.dart b/lib/src/types/circles.dart index f0720dc..e700a03 100644 --- a/lib/src/types/circles.dart +++ b/lib/src/types/circles.dart @@ -19,6 +19,7 @@ import '../../google_navigation_flutter.dart'; /// Circle that has beed added to map. /// {@category Navigation View} +/// {@category Map View} @immutable class Circle { /// Construct [Circle]. @@ -54,6 +55,7 @@ class Circle { /// Defines CircleOptions for a circle. /// {@category Navigation View} +/// {@category Map View} @immutable class CircleOptions { /// Initialize [CircleOptions] object. @@ -157,6 +159,7 @@ class CircleOptions { /// Event emitted when a circle is clicked. /// {@category Navigation View} +/// {@category Map View} @immutable class CircleClickedEvent { /// Initialize [CircleClickedEvent] object. diff --git a/lib/src/types/lat_lng.dart b/lib/src/types/lat_lng.dart index a7f2837..a6846b5 100644 --- a/lib/src/types/lat_lng.dart +++ b/lib/src/types/lat_lng.dart @@ -17,6 +17,7 @@ import 'package:flutter/foundation.dart'; /// LatLng coordinate object. /// {@category Navigation} /// {@category Navigation View} +/// {@category Map View} @immutable class LatLng { /// Initializes a [LatLng] with the provided latitude and longitude values. diff --git a/lib/src/types/lat_lng_bounds.dart b/lib/src/types/lat_lng_bounds.dart index d4ab837..a8a2089 100644 --- a/lib/src/types/lat_lng_bounds.dart +++ b/lib/src/types/lat_lng_bounds.dart @@ -18,6 +18,7 @@ import '../../google_navigation_flutter.dart'; /// LatLngBounds bounds object. /// {@category Navigation View} +/// {@category Map View} @immutable class LatLngBounds { /// Initialize LatLngBounds with the given southwest and northeast points. diff --git a/lib/src/types/markers.dart b/lib/src/types/markers.dart index 1a04a05..e2eddb4 100644 --- a/lib/src/types/markers.dart +++ b/lib/src/types/markers.dart @@ -18,6 +18,7 @@ import '../../google_navigation_flutter.dart'; /// Marker that has beed added to the map. /// {@category Navigation View} +/// {@category Map View} @immutable class Marker { /// Construct [Marker] @@ -53,6 +54,7 @@ class Marker { /// Defines MarkerOptions for a marker. /// {@category Navigation View} +/// {@category Map View} @immutable class MarkerOptions { /// Initialize MarkerOptions object. @@ -196,6 +198,7 @@ class MarkerOptions { /// Text labels for [Marker] info window. /// {@category Navigation View} +/// {@category Map View} @immutable class InfoWindow { /// Construct [InfoWindow] object. @@ -243,6 +246,7 @@ class InfoWindow { /// Specifies the anchor to be at a particular point in the marker image. /// {@category Navigation View} +/// {@category Map View} @immutable class MarkerAnchor { /// Initialize MarkerAnchor object. @@ -274,6 +278,7 @@ class MarkerAnchor { /// Marker event types /// {@category Navigation View} +/// {@category Map View} enum MarkerEventType { /// The marker has been tapped. clicked, @@ -290,6 +295,7 @@ enum MarkerEventType { /// Marker drag event types /// {@category Navigation View} +/// {@category Map View} enum MarkerDragEventType { /// The marker is being dragged. drag, @@ -303,6 +309,7 @@ enum MarkerDragEventType { /// Marker event sent from platform side. /// {@category Navigation View} +/// {@category Map View} @immutable class MarkerEvent { /// Initialize [MarkerEvent] object. @@ -320,6 +327,7 @@ class MarkerEvent { /// Marker drag event sent from platform side. /// {@category Navigation View} +/// {@category Map View} @immutable class MarkerDragEvent { /// Initialize [MarkerDragEvent] object. diff --git a/lib/src/types/navigation_view_types.dart b/lib/src/types/navigation_view_types.dart index 870b2a8..b424476 100644 --- a/lib/src/types/navigation_view_types.dart +++ b/lib/src/types/navigation_view_types.dart @@ -22,6 +22,7 @@ class NavigationViewRecenterButtonClickedEvent {} /// Map type. /// {@category Navigation View} +/// {@category Map View} enum MapType { /// No type set. none, @@ -41,6 +42,7 @@ enum MapType { /// Represents the camera position in a Google Maps view. /// {@category Navigation View} +/// {@category Map View} class CameraPosition { /// Creates a [CameraPosition] object with map centered /// to the [target] with the given [bearing], [tilt] and [zoom] level. @@ -74,6 +76,7 @@ class CameraPosition { /// Parameter given to parameter given to the [GoogleNavigationViewController.followMyLocation] /// to specify the orientation of the camera. /// {@category Navigation View} +/// {@category Map View} enum CameraPerspective { /// A tilted perspective facing in the same direction as the user. tilted, @@ -87,6 +90,7 @@ enum CameraPerspective { /// Represents the click position in a Google Maps view. /// {@category Navigation View} +/// {@category Map View} class MapClickEvent { /// Creates a [MapClickEvent] object. const MapClickEvent(this.target); @@ -107,6 +111,7 @@ class NavigationUIEnabledChangedEvent { /// Represents the long click position in a Google Maps view. /// {@category Navigation View} +/// {@category Map View} class MapLongClickEvent { /// Creates a [MapLongClickEvent] object. const MapLongClickEvent(this.target); @@ -202,6 +207,7 @@ class RouteSegment { /// Internal camera update type. /// {@category Navigation View} +/// {@category Map View} enum CameraUpdateType { /// Camera update to a camera position. cameraPosition, @@ -228,6 +234,7 @@ enum CameraUpdateType { /// Defines a camera move, supporting absolute moves as well as moves relative /// the current position. /// {@category Navigation View} +/// {@category Map View} class CameraUpdate { CameraUpdate._(this.type); @@ -374,14 +381,17 @@ class CameraUpdate { /// My location clicked event. /// {@category Navigation View} +/// {@category Map View} class MyLocationClickedEvent {} /// My location button clicked event. /// {@category Navigation View} +/// {@category Map View} class MyLocationButtonClickedEvent {} /// Represents the event type for [CameraChangedEvent]. /// {@category Navigation View} +/// {@category Map View} enum CameraEventType { /// Camera move initiated by developer or in response to user action. /// For example: zoom buttons, my location button, or marker clicks. @@ -405,6 +415,7 @@ enum CameraEventType { /// Represents camera changed events in a Google Maps view. /// {@category Navigation View} +/// {@category Map View} class CameraChangedEvent { /// Creates a [CameraChangedEvent] object. const CameraChangedEvent({required this.eventType, required this.position}); diff --git a/lib/src/types/polygons.dart b/lib/src/types/polygons.dart index d997ee7..e11d3a2 100644 --- a/lib/src/types/polygons.dart +++ b/lib/src/types/polygons.dart @@ -20,6 +20,7 @@ import '../../google_navigation_flutter.dart'; /// Polygon that has beed added to map. /// {@category Navigation View} +/// {@category Map View} @immutable class Polygon { /// Construct [Polygon]. @@ -55,6 +56,7 @@ class Polygon { /// Defines PolygonOptions for a polygon. /// {@category Navigation View} +/// {@category Map View} @immutable class PolygonOptions { /// Initialize [PolygonOptions] object. @@ -172,6 +174,7 @@ class PolygonOptions { /// Event emitted when a polygon is clicked. /// {@category Navigation View} +/// {@category Map View} @immutable class PolygonClickedEvent { /// Initialize [PolygonClickedEvent] object. diff --git a/lib/src/types/polylines.dart b/lib/src/types/polylines.dart index 837badf..c1123fe 100644 --- a/lib/src/types/polylines.dart +++ b/lib/src/types/polylines.dart @@ -19,6 +19,7 @@ import '../../google_navigation_flutter.dart'; /// Polyline that has beed added to map. /// {@category Navigation View} +/// {@category Map View} @immutable class Polyline { /// Construct [Polyline]. @@ -54,6 +55,7 @@ class Polyline { /// Defines PolylineOptions for a polyline. /// {@category Navigation View} +/// {@category Map View} @immutable class PolylineOptions { /// Initialize [PolylineOptions] object. @@ -165,6 +167,7 @@ class PolylineOptions { /// Style for stroke of a polyline. /// {@category Navigation View} +/// {@category Map View} class StyleSpanStrokeStyle { /// Initialize with solid color. StyleSpanStrokeStyle.solidColor({ @@ -189,6 +192,7 @@ class StyleSpanStrokeStyle { /// Style and length of a stroke on polyline. /// {@category Navigation View} +/// {@category Map View} class StyleSpan { /// Initialize with length and style. StyleSpan({ @@ -205,6 +209,7 @@ class StyleSpan { /// Joint types for [Polyline] and outline of [Polygon]. /// {@category Navigation View} +/// {@category Map View} enum StrokeJointType { /// Flat bevel on the outside of the joint. bevel, @@ -218,6 +223,7 @@ enum StrokeJointType { /// Event emitted when a polyline is clicked. /// {@category Navigation View} +/// {@category Map View} @immutable class PolylineClickedEvent { /// Initialize [PolylineClickedEvent] object. diff --git a/lib/src/types/stroke_patterns.dart b/lib/src/types/stroke_patterns.dart index 302d510..00d2c96 100644 --- a/lib/src/types/stroke_patterns.dart +++ b/lib/src/types/stroke_patterns.dart @@ -19,6 +19,7 @@ import '../../google_navigation_flutter.dart'; /// Pattern used in the stroke pattern for a [Polyline] or the outline of a [Polygon] or [Circle]. /// {@category Navigation View} +/// {@category Map View} enum PatternType { /// Dash pattern. dash, @@ -32,6 +33,7 @@ enum PatternType { /// Item used in the stroke pattern for a Polyline or the outline of a Polygon or Circle. /// {@category Navigation View} +/// {@category Map View} abstract class PatternItem { /// Initialize [PatternItem] object. const PatternItem(this.type); @@ -42,6 +44,7 @@ abstract class PatternItem { /// Class representing a dash used in the stroke pattern for a [Polyline] or the outline of a [Polygon] or [Circle]. /// {@category Navigation View} +/// {@category Map View} @immutable class DashPattern extends PatternItem { /// Initialize [DashPattern] object. @@ -67,6 +70,7 @@ class DashPattern extends PatternItem { /// Class representing a dot used in the stroke pattern for a [Polyline] or the outline of a [Polygon] or [Circle]. /// {@category Navigation View} +/// {@category Map View} @immutable class DotPattern extends PatternItem { /// Initialize [DotPattern] object. @@ -75,6 +79,7 @@ class DotPattern extends PatternItem { /// Class representing a gap used in the stroke pattern for a [Polyline] or the outline of a [Polygon] or [Circle]. /// {@category Navigation View} +/// {@category Map View} @immutable class GapPattern extends PatternItem { /// Initialize [GapPattern] object. diff --git a/lib/src/types/view_initialization_options.dart b/lib/src/types/view_initialization_options.dart index 8dcc361..21b8c5e 100644 --- a/lib/src/types/view_initialization_options.dart +++ b/lib/src/types/view_initialization_options.dart @@ -36,6 +36,7 @@ import '../../google_navigation_flutter.dart'; /// ); /// ``` /// {@category Navigation View} +/// {@category Map View} @immutable class MapViewInitializationOptions { /// Creates a new instance of [MapViewInitializationOptions ] with the given initial @@ -80,6 +81,7 @@ class MapViewInitializationOptions { /// ); /// ``` /// {@category Navigation View} +/// {@category Map View} @immutable class MapOptions { /// Creates a new instance of [MapOptions] with the given initial From 2fa13977f79d449e4ec7846b6d53ee2db432d1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Fri, 25 Oct 2024 16:38:45 +0800 Subject: [PATCH 10/18] refactor: listener and map view refactoring --- lib/src/google_maps_map_view.dart | 148 +++++++++- lib/src/google_maps_map_view_controller.dart | 104 +------ lib/src/google_maps_navigation_view.dart | 278 ++++++------------ ...oogle_maps_navigation_view_controller.dart | 177 +---------- 4 files changed, 236 insertions(+), 471 deletions(-) diff --git a/lib/src/google_maps_map_view.dart b/lib/src/google_maps_map_view.dart index 78bce38..9f33e22 100644 --- a/lib/src/google_maps_map_view.dart +++ b/lib/src/google_maps_map_view.dart @@ -26,7 +26,7 @@ typedef OnMapViewCreatedCallback = void Function( /// The main map view widget for Google Maps Map View. /// {@category Map View} -class GoogleMapsMapView extends StatefulWidget { +class GoogleMapsMapView extends GoogleMapsBaseMapView { /// The main widget for embedding Google Maps Map View into a Flutter application. /// /// After creating the map view, the [onViewCreated] callback is triggered, providing a @@ -47,6 +47,74 @@ class GoogleMapsMapView extends StatefulWidget { const GoogleMapsMapView( {super.key, required this.onViewCreated, + super.initialCameraPosition = const CameraPosition(), + super.initialMapType = MapType.normal, + super.initialCompassEnabled = true, + super.initialRotateGesturesEnabled = true, + super.initialScrollGesturesEnabled = true, + super.initialTiltGesturesEnabled = true, + super.initialZoomGesturesEnabled = true, + super.initialScrollGesturesEnabledDuringRotateOrZoom = true, + super.initialMapToolbarEnabled = true, + super.initialMinZoomPreference, + super.initialMaxZoomPreference, + super.initialZoomControlsEnabled = true, + super.initialCameraTargetBounds, + super.layoutDirection, + super.gestureRecognizers = + const >{}, + super.onRecenterButtonClicked, + super.onMarkerClicked, + super.onMarkerDrag, + super.onMarkerDragStart, + super.onMarkerDragEnd, + super.onMarkerInfoWindowClicked, + super.onMarkerInfoWindowClosed, + super.onMarkerInfoWindowLongClicked, + super.onMapClicked, + super.onMapLongClicked, + super.onPolygonClicked, + super.onPolylineClicked, + super.onCircleClicked, + super.onMyLocationClicked, + super.onMyLocationButtonClicked, + super.onCameraMoveStarted, + super.onCameraMove, + super.onCameraIdle, + super.onCameraStartedFollowingLocation, + super.onCameraStoppedFollowingLocation}); + + /// On view created callback. + final OnMapViewCreatedCallback onViewCreated; + + /// Creates a [State] for this [GoogleMapsBaseMapView]. + @override + State createState() => GoogleMapsMapViewState(); +} + +/// The base view for map view and navigation view. +/// {@category Map View} +@protected +abstract class GoogleMapsBaseMapView extends StatefulWidget { + /// The main widget for embedding Google Maps Map View into a Flutter application. + /// + /// After creating the map view, the [onViewCreated] callback is triggered, providing a + /// [GoogleMapViewController] that you can use to interact with the map programmatically. + /// + /// Example usage: + /// ```dart + /// GoogleMapsMapView( + /// onViewCreated: (controller) { + /// // Use the controller to interact with the map. + /// }, + /// initialCameraPosition: CameraPosition( + /// // Initial camera position parameters + /// ), + /// // Other initial map settings... + /// ) + /// ``` + const GoogleMapsBaseMapView( + {super.key, this.initialCameraPosition = const CameraPosition(), this.initialMapType = MapType.normal, this.initialCompassEnabled = true, @@ -83,9 +151,6 @@ class GoogleMapsMapView extends StatefulWidget { this.onCameraStartedFollowingLocation, this.onCameraStoppedFollowingLocation}); - /// On view created callback. - final OnMapViewCreatedCallback onViewCreated; - /// The initial positioning of the camera in the map view. final CameraPosition initialCameraPosition; @@ -233,15 +298,78 @@ class GoogleMapsMapView extends StatefulWidget { /// On camera stopped following location callback (Android-only). final OnCameraStoppedFollowingLocation? onCameraStoppedFollowingLocation; +} - /// Creates a [State] for this [GoogleMapsMapView]. - @override - State createState() => GoogleMapsMapViewState(); +abstract class MapViewState extends State { + @protected + void initMapViewListeners(int viewId) { + if (widget.onMapClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMapClickEventStream(viewId: viewId) + .listen((MapClickEvent event) { + widget.onMapClicked!(event.target); + }); + } + + if (widget.onMapLongClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMapLongClickEventStream(viewId: viewId) + .listen((MapLongClickEvent event) { + widget.onMapLongClicked!(event.target); + }); + } + + GoogleMapsNavigationPlatform.instance + .getMarkerEventStream(viewId: viewId) + .listen((MarkerEvent event) { + switch (event.eventType) { + case MarkerEventType.clicked: + widget.onMarkerClicked?.call(event.markerId); + case MarkerEventType.infoWindowClicked: + widget.onMarkerInfoWindowClicked?.call(event.markerId); + case MarkerEventType.infoWindowClosed: + widget.onMarkerInfoWindowClosed?.call(event.markerId); + case MarkerEventType.infoWindowLongClicked: + widget.onMarkerInfoWindowLongClicked?.call(event.markerId); + } + }); + + GoogleMapsNavigationPlatform.instance + .getMarkerDragEventStream(viewId: viewId) + .listen((MarkerDragEvent event) { + switch (event.eventType) { + case MarkerDragEventType.drag: + widget.onMarkerDrag?.call(event.markerId, event.position); + case MarkerDragEventType.dragEnd: + widget.onMarkerDragEnd?.call(event.markerId, event.position); + case MarkerDragEventType.dragStart: + widget.onMarkerDragStart?.call(event.markerId, event.position); + } + + GoogleMapsNavigationPlatform.instance + .getPolygonClickedEventStream(viewId: viewId) + .listen((PolygonClickedEvent event) { + widget.onPolygonClicked?.call(event.polygonId); + }); + + GoogleMapsNavigationPlatform.instance + .getPolylineClickedEventStream(viewId: viewId) + .listen((PolylineClickedEvent event) { + widget.onPolylineClicked?.call(event.polylineId); + }); + + GoogleMapsNavigationPlatform.instance + .getCircleClickedEventStream(viewId: viewId) + .listen((CircleClickedEvent event) { + widget.onCircleClicked?.call(event.circleId); + }); + }); + } } /// Google Maps Map View. /// {@category Map View} -class GoogleMapsMapViewState extends State { +class GoogleMapsMapViewState extends MapViewState { @override Widget build(BuildContext context) { return GoogleMapsNavigationPlatform.instance.buildMapView( @@ -272,8 +400,10 @@ class GoogleMapsMapViewState extends State { /// Callback method when platform view is created. void _onPlatformViewCreated(int viewId) { + initMapViewListeners(viewId); + final GoogleMapViewController viewController = - GoogleMapViewController(viewId, this); + GoogleMapViewController(viewId); widget.onViewCreated(viewController); } } diff --git a/lib/src/google_maps_map_view_controller.dart b/lib/src/google_maps_map_view_controller.dart index 19ee629..20d5498 100644 --- a/lib/src/google_maps_map_view_controller.dart +++ b/lib/src/google_maps_map_view_controller.dart @@ -21,16 +21,12 @@ class GoogleMapViewController { /// Basic constructor. /// /// Don't create this directly, but access through - /// [GoogleMapsMapView.onViewCreated] callback. - GoogleMapViewController(this._viewId, [this._viewState]) - : settings = NavigationViewUISettings(_viewId) { - _initListeners(); - } + /// [GoogleMapsBaseMapView.onViewCreated] callback. + GoogleMapViewController(this._viewId) + : settings = NavigationViewUISettings(_viewId); final int _viewId; - final GoogleMapsMapViewState? _viewState; - /// Settings for the user interface of the map. final NavigationViewUISettings settings; @@ -39,100 +35,6 @@ class GoogleMapViewController { return _viewId; } - /// Initializes the event channel listeners for the map view instance. - void _initListeners() { - _setOnMapClickedListeners(); - _setOnMarkerClickedListeners(); - _setOnMarkerDragListeners(); - _setOnPolygonClickedListener(); - _setOnPolylineClickedListener(); - _setOnCircleClickedListener(); - } - - /// Sets the event channel listener for the map click event listeners. - void _setOnMapClickedListeners() { - if (_viewState != null) { - if (_viewState.widget.onMapClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMapClickEventStream(viewId: _viewId) - .listen((MapClickEvent event) { - _viewState.widget.onMapClicked!(event.target); - }); - } - if (_viewState.widget.onMapLongClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMapLongClickEventStream(viewId: _viewId) - .listen((MapLongClickEvent event) { - _viewState.widget.onMapLongClicked!(event.target); - }); - } - } - } - - /// Sets the event channel listener for the marker clicked events. - void _setOnMarkerClickedListeners() { - GoogleMapsNavigationPlatform.instance - .getMarkerEventStream(viewId: _viewId) - .listen((MarkerEvent event) { - switch (event.eventType) { - case MarkerEventType.clicked: - _viewState?.widget.onMarkerClicked?.call(event.markerId); - case MarkerEventType.infoWindowClicked: - _viewState?.widget.onMarkerInfoWindowClicked?.call(event.markerId); - case MarkerEventType.infoWindowClosed: - _viewState?.widget.onMarkerInfoWindowClosed?.call(event.markerId); - case MarkerEventType.infoWindowLongClicked: - _viewState?.widget.onMarkerInfoWindowLongClicked - ?.call(event.markerId); - } - }); - } - - /// Sets the event channel listener for the marker drag event. - void _setOnMarkerDragListeners() { - GoogleMapsNavigationPlatform.instance - .getMarkerDragEventStream(viewId: _viewId) - .listen((MarkerDragEvent event) { - switch (event.eventType) { - case MarkerDragEventType.drag: - _viewState?.widget.onMarkerDrag?.call(event.markerId, event.position); - case MarkerDragEventType.dragEnd: - _viewState?.widget.onMarkerDragEnd - ?.call(event.markerId, event.position); - case MarkerDragEventType.dragStart: - _viewState?.widget.onMarkerDragStart - ?.call(event.markerId, event.position); - } - }); - } - - /// Sets the event channel listener for the polygon clicked event. - void _setOnPolygonClickedListener() { - GoogleMapsNavigationPlatform.instance - .getPolygonClickedEventStream(viewId: _viewId) - .listen((PolygonClickedEvent event) { - _viewState?.widget.onPolygonClicked?.call(event.polygonId); - }); - } - - /// Sets the event channel listener for the polyline clicked event. - void _setOnPolylineClickedListener() { - GoogleMapsNavigationPlatform.instance - .getPolylineClickedEventStream(viewId: _viewId) - .listen((PolylineClickedEvent event) { - _viewState?.widget.onPolylineClicked?.call(event.polylineId); - }); - } - - /// Sets the event channel listener for the circle clicked event. - void _setOnCircleClickedListener() { - GoogleMapsNavigationPlatform.instance - .getCircleClickedEventStream(viewId: _viewId) - .listen((CircleClickedEvent event) { - _viewState?.widget.onCircleClicked?.call(event.circleId); - }); - } - /// Change status of my location enabled. /// Future setMyLocationEnabled(bool enabled) { diff --git a/lib/src/google_maps_navigation_view.dart b/lib/src/google_maps_navigation_view.dart index dec63a9..f68ac66 100644 --- a/lib/src/google_maps_navigation_view.dart +++ b/lib/src/google_maps_navigation_view.dart @@ -26,7 +26,7 @@ typedef OnNavigationViewCreatedCallback = void Function( /// The main map view widget for Google Maps Navigation. /// {@category Navigation View} -class GoogleMapsNavigationView extends StatefulWidget { +class GoogleMapsNavigationView extends GoogleMapsBaseMapView { /// The main widget for embedding Google Maps Navigation into a Flutter application. /// /// After creating the map view, the [onViewCreated] callback is triggered, providing a @@ -47,128 +47,49 @@ class GoogleMapsNavigationView extends StatefulWidget { const GoogleMapsNavigationView( {super.key, required this.onViewCreated, - this.initialCameraPosition = const CameraPosition(), - this.initialMapType = MapType.normal, - this.initialCompassEnabled = true, - this.initialRotateGesturesEnabled = true, - this.initialScrollGesturesEnabled = true, - this.initialTiltGesturesEnabled = true, - this.initialZoomGesturesEnabled = true, - this.initialScrollGesturesEnabledDuringRotateOrZoom = true, - this.initialMapToolbarEnabled = true, - this.initialMinZoomPreference, - this.initialMaxZoomPreference, - this.initialZoomControlsEnabled = true, - this.initialCameraTargetBounds, + super.initialCameraPosition = const CameraPosition(), + super.initialMapType = MapType.normal, + super.initialCompassEnabled = true, + super.initialRotateGesturesEnabled = true, + super.initialScrollGesturesEnabled = true, + super.initialTiltGesturesEnabled = true, + super.initialZoomGesturesEnabled = true, + super.initialScrollGesturesEnabledDuringRotateOrZoom = true, + super.initialMapToolbarEnabled = true, + super.initialMinZoomPreference, + super.initialMaxZoomPreference, + super.initialZoomControlsEnabled = true, + super.initialCameraTargetBounds, this.initialNavigationUIEnabledPreference = NavigationUIEnabledPreference.automatic, - this.layoutDirection, - this.gestureRecognizers = const >{}, - this.onRecenterButtonClicked, - this.onMarkerClicked, - this.onMarkerDrag, - this.onMarkerDragStart, - this.onMarkerDragEnd, - this.onMarkerInfoWindowClicked, - this.onMarkerInfoWindowClosed, - this.onMarkerInfoWindowLongClicked, - this.onMapClicked, - this.onMapLongClicked, - this.onPolygonClicked, - this.onPolylineClicked, - this.onCircleClicked, + super.layoutDirection, + super.gestureRecognizers = + const >{}, + super.onRecenterButtonClicked, + super.onMarkerClicked, + super.onMarkerDrag, + super.onMarkerDragStart, + super.onMarkerDragEnd, + super.onMarkerInfoWindowClicked, + super.onMarkerInfoWindowClosed, + super.onMarkerInfoWindowLongClicked, + super.onMapClicked, + super.onMapLongClicked, + super.onPolygonClicked, + super.onPolylineClicked, + super.onCircleClicked, this.onNavigationUIEnabledChanged, - this.onMyLocationClicked, - this.onMyLocationButtonClicked, - this.onCameraMoveStarted, - this.onCameraMove, - this.onCameraIdle, - this.onCameraStartedFollowingLocation, - this.onCameraStoppedFollowingLocation}); + super.onMyLocationClicked, + super.onMyLocationButtonClicked, + super.onCameraMoveStarted, + super.onCameraMove, + super.onCameraIdle, + super.onCameraStartedFollowingLocation, + super.onCameraStoppedFollowingLocation}); /// On view created callback. final OnNavigationViewCreatedCallback onViewCreated; - /// The initial positioning of the camera in the map view. - final CameraPosition initialCameraPosition; - - /// The directionality to be used for text layout within the embedded view. - final TextDirection? layoutDirection; - - /// The type of map to display, specified using [MapType] enum values. - final MapType initialMapType; - - /// Specifies whether the compass should be enabled. - /// - /// The compass is an icon on the map that indicates the direction of north on the map. - /// If enabled, it is only shown when the camera is tilted or rotated away from - /// its default orientation (tilt of 0 and a bearing of 0). - /// - /// By default, the compass is enabled. - final bool initialCompassEnabled; - - /// Specifies whether rotate gestures should be enabled. - /// - /// If enabled, users can use a two-finger rotate gesture to rotate the camera. - /// If disabled, users cannot rotate the camera via gestures. - /// This setting doesn't restrict the user from tapping the compass icon to reset the camera orientation, - /// nor does it restrict programmatic movements and animation of the camera. - /// - /// By default, the rotation gestures are enabled. - final bool initialRotateGesturesEnabled; - - /// Specifies whether scroll gestures should be enabled. - /// - /// By default, the scroll gestures are enabled. - final bool initialScrollGesturesEnabled; - - /// Specifies whether tilt gestures should be enabled. - /// - /// By default, the tilt gestures are enabled. - final bool initialTiltGesturesEnabled; - - /// Specifies whether zoom gestures should be enabled. - /// - /// By default, the zoom gestures enabled. - final bool initialZoomGesturesEnabled; - - /// Specifies whether scroll gestures during rotate or zoom should be enabled. - /// - /// If enabled, users can swipe to pan the camera. If disabled, swiping has no effect. - /// This setting doesn't restrict programmatic movement and animation of the camera. - /// - /// By default, the zoom gestures enabled. - final bool initialScrollGesturesEnabledDuringRotateOrZoom; - - /// Specifies whether the map toolbar should be enabled. Only applicable on Android. - /// - /// If enabled, and the map toolbar can be shown in the current context, - /// users will see a bar with various context-dependent actions. - /// - /// By default, the map toolbar is enabled. - final bool initialMapToolbarEnabled; - - /// Specifies a preferred lower bound for camera zoom. - /// - /// Null by default (not limited). - final double? initialMinZoomPreference; - - /// Specifies a preferred upper bound for camera zoom. - /// - /// Null by default (not limited). - final double? initialMaxZoomPreference; - - /// Specifies whether the zoom controls should be enabled. Only applicable on Android. - /// - /// By default, the zoom controls are enabled. - final bool initialZoomControlsEnabled; - - /// Specifies a bounds to constrain the camera target, so that when users scroll and pan the map, - /// the camera target does not move outside these bounds. - /// - /// Null by default (unbounded). - final LatLngBounds? initialCameraTargetBounds; - /// Determines the initial visibility of the navigation UI on map initialization. /// /// By default set to [NavigationUIEnabledPreference.automatic], @@ -184,77 +105,9 @@ class GoogleMapsNavigationView extends StatefulWidget { /// the terms and conditions is enough. final NavigationUIEnabledPreference initialNavigationUIEnabledPreference; - /// Which gestures should be forwarded to the PlatformView. - /// - /// When this set is empty, the map will only handle pointer events for gestures that - /// were not claimed by any other gesture recognizer. - /// - /// See [PlatformViewSurface.gestureRecognizers] for details. - final Set> gestureRecognizers; - - /// On recenter button clicked event callback. - final OnRecenterButtonClicked? onRecenterButtonClicked; - - /// On marker clicked callback. - final OnMarkerClicked? onMarkerClicked; - - /// On marker drag callback. - final OnMarkerDrag? onMarkerDrag; - - /// On marker drag start callback. - final OnMarkerDragStart? onMarkerDragStart; - - /// On marker drag end callback. - final OnMarkerDragEnd? onMarkerDragEnd; - - /// On marker info window clicked callback. - final OnMarkerInfoWindowClicked? onMarkerInfoWindowClicked; - - /// On marker info window closed callback. - final OnMarkerInfoWindowClosed? onMarkerInfoWindowClosed; - - /// On marker info window long clicked callback. - final OnMarkerInfoWindowLongClicked? onMarkerInfoWindowLongClicked; - - /// On map clicked callback. - final OnMapClicked? onMapClicked; - - /// On map long clicked callback. - final OnMapLongClicked? onMapLongClicked; - - /// On polygon clicked callback. - final OnPolygonClicked? onPolygonClicked; - - /// On polyline clicked callback. - final OnPolylineClicked? onPolylineClicked; - - /// On circle clicked callback. - final OnCircleClicked? onCircleClicked; - /// On navigation UI enabled changed callback. final OnNavigationUIEnabledChanged? onNavigationUIEnabledChanged; - /// On my location clicked callback. - final OnMyLocationClicked? onMyLocationClicked; - - /// On my location button clicked callback. - final OnMyLocationButtonClicked? onMyLocationButtonClicked; - - /// On camera move started callback. - final OnCameraMoveStarted? onCameraMoveStarted; - - /// On camera move callback. - final OnCameraMove? onCameraMove; - - /// On camera idle callback. - final OnCameraIdle? onCameraIdle; - - /// On camera started following location callback (Android-only). - final OnCameraStartedFollowingLocation? onCameraStartedFollowingLocation; - - /// On camera stopped following location callback (Android-only). - final OnCameraStoppedFollowingLocation? onCameraStoppedFollowingLocation; - /// Creates a [State] for this [GoogleMapsNavigationView]. @override State createState() => GoogleMapsNavigationViewState(); @@ -262,7 +115,8 @@ class GoogleMapsNavigationView extends StatefulWidget { /// Google Maps Navigation. /// {@category Navigation View} -class GoogleMapsNavigationViewState extends State { +class GoogleMapsNavigationViewState + extends MapViewState { @override Widget build(BuildContext context) { return GoogleMapsNavigationPlatform.instance.buildNavigationView( @@ -295,8 +149,60 @@ class GoogleMapsNavigationViewState extends State { /// Callback method when platform view is created. void _onPlatformViewCreated(int viewId) { + initMapViewListeners(viewId); + _initNavigationViewListeners(viewId); final GoogleNavigationViewController viewController = - GoogleNavigationViewController(viewId, this); + GoogleNavigationViewController(viewId); widget.onViewCreated(viewController); } + + void _initNavigationViewListeners(int viewId) { + if (widget.onRecenterButtonClicked != null) { + GoogleMapsNavigationPlatform.instance + .getNavigationRecenterButtonClickedEventStream(viewId: viewId) + .listen(widget.onRecenterButtonClicked); + } + if (widget.onMyLocationClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMyLocationClickedEventStream(viewId: viewId) + .listen(widget.onMyLocationClicked); + } + if (widget.onNavigationUIEnabledChanged != null) { + GoogleMapsNavigationPlatform.instance + .getNavigationUIEnabledChangedEventStream(viewId: viewId) + .listen((NavigationUIEnabledChangedEvent event) { + widget.onNavigationUIEnabledChanged?.call(event.navigationUIEnabled); + }); + } + if (widget.onMyLocationButtonClicked != null) { + GoogleMapsNavigationPlatform.instance + .getMyLocationButtonClickedEventStream(viewId: viewId) + .listen(widget.onMyLocationButtonClicked); + } + if (widget.onCameraMoveStarted != null || + widget.onCameraMove != null || + widget.onCameraIdle != null) { + GoogleMapsNavigationPlatform.instance + .registerOnCameraChangedListener(viewId: viewId); + } + + GoogleMapsNavigationPlatform.instance + .getCameraChangedEventStream(viewId: viewId) + .listen((CameraChangedEvent event) { + switch (event.eventType) { + case CameraEventType.moveStartedByApi: + widget.onCameraMoveStarted?.call(event.position, false); + case CameraEventType.moveStartedByGesture: + widget.onCameraMoveStarted?.call(event.position, true); + case CameraEventType.onCameraMove: + widget.onCameraMove?.call(event.position); + case CameraEventType.onCameraIdle: + widget.onCameraIdle?.call(event.position); + case CameraEventType.onCameraStartedFollowingLocation: + widget.onCameraStartedFollowingLocation?.call(event.position); + case CameraEventType.onCameraStoppedFollowingLocation: + widget.onCameraStoppedFollowingLocation?.call(event.position); + } + }); + } } diff --git a/lib/src/google_maps_navigation_view_controller.dart b/lib/src/google_maps_navigation_view_controller.dart index 1958b94..00d8097 100644 --- a/lib/src/google_maps_navigation_view_controller.dart +++ b/lib/src/google_maps_navigation_view_controller.dart @@ -22,15 +22,11 @@ class GoogleNavigationViewController { /// /// Don't create this directly, but access through /// [GoogleMapsNavigationView.onViewCreated] callback. - GoogleNavigationViewController(this._viewId, [this._viewState]) - : settings = NavigationViewUISettings(_viewId) { - _initListeners(); - } + GoogleNavigationViewController(this._viewId) + : settings = NavigationViewUISettings(_viewId); final int _viewId; - final GoogleMapsNavigationViewState? _viewState; - /// Settings for the user interface of the map. final NavigationViewUISettings settings; @@ -39,175 +35,6 @@ class GoogleNavigationViewController { return _viewId; } - /// Initializes the event channel listeners for the navigation view instance. - void _initListeners() { - _setOnMapClickedListeners(); - _setOnRecenterButtonClickedListener(); - _setOnMarkerClickedListeners(); - _setOnMarkerDragListeners(); - _setOnPolygonClickedListener(); - _setOnPolylineClickedListener(); - _setOnCircleClickedListener(); - _setOnNavigationUIEnabledChangedListener(); - _setOnMyLocationClickedListener(); - _setOnMyLocationButtonClickedListener(); - _setOnCameraChangedListener(); - } - - /// Sets the event channel listener for the map click event listeners. - void _setOnMapClickedListeners() { - if (_viewState != null) { - if (_viewState.widget.onMapClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMapClickEventStream(viewId: _viewId) - .listen((MapClickEvent event) { - _viewState.widget.onMapClicked!(event.target); - }); - } - if (_viewState.widget.onMapLongClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMapLongClickEventStream(viewId: _viewId) - .listen((MapLongClickEvent event) { - _viewState.widget.onMapLongClicked!(event.target); - }); - } - } - } - - /// Sets the event channel listener for the on recenter button clicked event. - void _setOnRecenterButtonClickedListener() { - if (_viewState != null && - _viewState.widget.onRecenterButtonClicked != null) { - GoogleMapsNavigationPlatform.instance - .getNavigationRecenterButtonClickedEventStream(viewId: _viewId) - .listen(_viewState.widget.onRecenterButtonClicked); - } - } - - /// Sets the event channel listener for the marker clicked events. - void _setOnMarkerClickedListeners() { - GoogleMapsNavigationPlatform.instance - .getMarkerEventStream(viewId: _viewId) - .listen((MarkerEvent event) { - switch (event.eventType) { - case MarkerEventType.clicked: - _viewState?.widget.onMarkerClicked?.call(event.markerId); - case MarkerEventType.infoWindowClicked: - _viewState?.widget.onMarkerInfoWindowClicked?.call(event.markerId); - case MarkerEventType.infoWindowClosed: - _viewState?.widget.onMarkerInfoWindowClosed?.call(event.markerId); - case MarkerEventType.infoWindowLongClicked: - _viewState?.widget.onMarkerInfoWindowLongClicked - ?.call(event.markerId); - } - }); - } - - /// Sets the event channel listener for the on my location clicked event. - void _setOnMyLocationClickedListener() { - if (_viewState != null && _viewState.widget.onMyLocationClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMyLocationClickedEventStream(viewId: _viewId) - .listen(_viewState.widget.onMyLocationClicked); - } - } - - /// Sets the event channel listener for the on my location button clicked event. - void _setOnMyLocationButtonClickedListener() { - if (_viewState != null && - _viewState.widget.onMyLocationButtonClicked != null) { - GoogleMapsNavigationPlatform.instance - .getMyLocationButtonClickedEventStream(viewId: _viewId) - .listen(_viewState.widget.onMyLocationButtonClicked); - } - } - - /// Sets the event channel listener for camera changed events. - void _setOnCameraChangedListener() { - // Register listeners if any of the callbacks are not null. - if (_viewState?.widget.onCameraMoveStarted != null || - _viewState?.widget.onCameraMove != null || - _viewState?.widget.onCameraIdle != null) { - GoogleMapsNavigationPlatform.instance - .registerOnCameraChangedListener(viewId: _viewId); - } - GoogleMapsNavigationPlatform.instance - .getCameraChangedEventStream(viewId: _viewId) - .listen((CameraChangedEvent event) { - switch (event.eventType) { - case CameraEventType.moveStartedByApi: - _viewState?.widget.onCameraMoveStarted?.call(event.position, false); - case CameraEventType.moveStartedByGesture: - _viewState?.widget.onCameraMoveStarted?.call(event.position, true); - case CameraEventType.onCameraMove: - _viewState?.widget.onCameraMove?.call(event.position); - case CameraEventType.onCameraIdle: - _viewState?.widget.onCameraIdle?.call(event.position); - case CameraEventType.onCameraStartedFollowingLocation: - _viewState?.widget.onCameraStartedFollowingLocation - ?.call(event.position); - case CameraEventType.onCameraStoppedFollowingLocation: - _viewState?.widget.onCameraStoppedFollowingLocation - ?.call(event.position); - } - }); - } - - /// Sets the event channel listener for the marker drag event. - void _setOnMarkerDragListeners() { - GoogleMapsNavigationPlatform.instance - .getMarkerDragEventStream(viewId: _viewId) - .listen((MarkerDragEvent event) { - switch (event.eventType) { - case MarkerDragEventType.drag: - _viewState?.widget.onMarkerDrag?.call(event.markerId, event.position); - case MarkerDragEventType.dragEnd: - _viewState?.widget.onMarkerDragEnd - ?.call(event.markerId, event.position); - case MarkerDragEventType.dragStart: - _viewState?.widget.onMarkerDragStart - ?.call(event.markerId, event.position); - } - }); - } - - /// Sets the event channel listener for the polygon clicked event. - void _setOnPolygonClickedListener() { - GoogleMapsNavigationPlatform.instance - .getPolygonClickedEventStream(viewId: _viewId) - .listen((PolygonClickedEvent event) { - _viewState?.widget.onPolygonClicked?.call(event.polygonId); - }); - } - - /// Sets the event channel listener for the polyline clicked event. - void _setOnPolylineClickedListener() { - GoogleMapsNavigationPlatform.instance - .getPolylineClickedEventStream(viewId: _viewId) - .listen((PolylineClickedEvent event) { - _viewState?.widget.onPolylineClicked?.call(event.polylineId); - }); - } - - /// Sets the event channel listener for the circle clicked event. - void _setOnCircleClickedListener() { - GoogleMapsNavigationPlatform.instance - .getCircleClickedEventStream(viewId: _viewId) - .listen((CircleClickedEvent event) { - _viewState?.widget.onCircleClicked?.call(event.circleId); - }); - } - - /// Sets the event channel listener for the navigation UI enabled changed event. - void _setOnNavigationUIEnabledChangedListener() { - GoogleMapsNavigationPlatform.instance - .getNavigationUIEnabledChangedEventStream(viewId: _viewId) - .listen((NavigationUIEnabledChangedEvent event) { - _viewState?.widget.onNavigationUIEnabledChanged - ?.call(event.navigationUIEnabled); - }); - } - /// Change status of my location enabled. /// /// By default, the my location layer is disabled, but gets From 84d8ddf489fabbb33765eb7aacb677d89dbb5ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Fri, 25 Oct 2024 17:18:55 +0800 Subject: [PATCH 11/18] refactor: navigation viewcontroller now extends map viewcontroller in flutter --- lib/src/google_maps_map_view.dart | 20 +- ...oogle_maps_navigation_view_controller.dart | 397 +----------------- 2 files changed, 19 insertions(+), 398 deletions(-) diff --git a/lib/src/google_maps_map_view.dart b/lib/src/google_maps_map_view.dart index 9f33e22..5da564b 100644 --- a/lib/src/google_maps_map_view.dart +++ b/lib/src/google_maps_map_view.dart @@ -92,27 +92,11 @@ class GoogleMapsMapView extends GoogleMapsBaseMapView { State createState() => GoogleMapsMapViewState(); } -/// The base view for map view and navigation view. +/// The base view for map view and navigation view. Not to be used by itself. /// {@category Map View} @protected abstract class GoogleMapsBaseMapView extends StatefulWidget { - /// The main widget for embedding Google Maps Map View into a Flutter application. - /// - /// After creating the map view, the [onViewCreated] callback is triggered, providing a - /// [GoogleMapViewController] that you can use to interact with the map programmatically. - /// - /// Example usage: - /// ```dart - /// GoogleMapsMapView( - /// onViewCreated: (controller) { - /// // Use the controller to interact with the map. - /// }, - /// initialCameraPosition: CameraPosition( - /// // Initial camera position parameters - /// ), - /// // Other initial map settings... - /// ) - /// ``` + /// Abstract base class that contans the shared logic of GoogleMapsMapView and GoogleMapsNavigation View. const GoogleMapsBaseMapView( {super.key, this.initialCameraPosition = const CameraPosition(), diff --git a/lib/src/google_maps_navigation_view_controller.dart b/lib/src/google_maps_navigation_view_controller.dart index 00d8097..36c493f 100644 --- a/lib/src/google_maps_navigation_view_controller.dart +++ b/lib/src/google_maps_navigation_view_controller.dart @@ -17,164 +17,17 @@ import 'google_navigation_flutter_platform_interface.dart'; /// Navigation View Controller class to handle navigation view events. /// {@category Navigation View} -class GoogleNavigationViewController { +class GoogleNavigationViewController extends GoogleMapViewController { /// Basic constructor. /// /// Don't create this directly, but access through /// [GoogleMapsNavigationView.onViewCreated] callback. - GoogleNavigationViewController(this._viewId) - : settings = NavigationViewUISettings(_viewId); - - final int _viewId; - - /// Settings for the user interface of the map. - final NavigationViewUISettings settings; - - /// Getter for view ID. - int getViewId() { - return _viewId; - } - - /// Change status of my location enabled. - /// - /// By default, the my location layer is disabled, but gets - /// automatically enabled on Android when the navigation starts. - /// - /// On iOS this property doesn't control the my location indication during - /// the navigation. - Future setMyLocationEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance - .setMyLocationEnabled(viewId: _viewId, enabled: enabled); - } - - /// This method returns the current map type of the Google Maps view instance. - Future getMapType() { - return GoogleMapsNavigationPlatform.instance.getMapType(viewId: _viewId); - } - - /// Changes the type of the map being displayed on the Google Maps view. - /// - /// The [mapType] parameter specifies the new map type to be set. - /// It should be one of the values defined in the [MapType] enum, - /// such as [MapType.normal], [MapType.satellite], [MapType.terrain], - /// or [MapType.hybrid]. - /// - /// Example usage: - /// ```dart - /// _navigationViewController.changeMapType(MapType.satellite); - /// ``` - Future setMapType({required MapType mapType}) async { - return GoogleMapsNavigationPlatform.instance - .setMapType(viewId: _viewId, mapType: mapType); - } - - /// Sets the styling of the base map using a string containing JSON. - /// Null value will reset the base map to default style. - /// If [styleJson] is invalid throws [MapStyleException]. - /// - /// For more details see the official documentation: - /// https://developers.google.com/maps/documentation/ios-sdk/styling - /// https://developers.google.com/maps/documentation/android-sdk/styling - Future setMapStyle(String? styleJson) async { - return GoogleMapsNavigationPlatform.instance - .setMapStyle(_viewId, styleJson); - } - - /// Gets whether the my location is enabled or disabled. - /// - /// By default, the my location layer is disabled, but gets - /// automatically enabled on Android when the navigation starts. - /// - /// On iOS this property doesn't control the my location indication during - /// the navigation. - Future isMyLocationEnabled() async { - return GoogleMapsNavigationPlatform.instance - .isMyLocationEnabled(viewId: _viewId); - } - - /// Ask the camera to follow the user's location. - /// - /// Use [perspective] to specify the orientation of the camera - /// and optional [zoomLevel] to control the map zoom. - /// - /// Automatically started in the perspective [CameraPerspective.tilted] when - /// the navigation is initialized with [GoogleMapsNavigator.initializeNavigationSession] - /// or when navigation UI gets re-enabled with [setNavigationUIEnabled]. - /// - /// In Android, you can use [GoogleMapsNavigationView.onCameraStartedFollowingLocation] - /// and [GoogleMapsNavigationView.onCameraStoppedFollowingLocation] callbacks - /// to detect when the follow location mode is enabled or disabled. - /// - /// Note there are small differences on how Android and iOS handle the camera - /// during the follow my location mode (tilt, zoom, transitions, etc.). - /// - /// See also [GoogleMapsNavigator.startGuidance], [showRouteOverview] and [animateCamera]. - Future followMyLocation(CameraPerspective perspective, - {double? zoomLevel}) async { - return GoogleMapsNavigationPlatform.instance.followMyLocation( - viewId: _viewId, perspective: perspective, zoomLevel: zoomLevel); - } - - /// Gets user's current location. - Future getMyLocation() async { - return GoogleMapsNavigationPlatform.instance.getMyLocation(viewId: _viewId); - } - - /// Gets the current visible map region or camera bounds. - Future getVisibleRegion() async { - return GoogleMapsNavigationPlatform.instance - .getVisibleRegion(viewId: _viewId); - } - - /// Gets the current position of the camera. - Future getCameraPosition() async { - return GoogleMapsNavigationPlatform.instance - .getCameraPosition(viewId: _viewId); - } - - /// Animates the movement of the camera from the current position - /// to the position defined in the [cameraUpdate]. - /// - /// See [CameraUpdate] for more information on how to create different camera - /// animations. - /// - /// On Android you can override the default animation [duration] and - /// set [onFinished] callback that is called when the animation completes - /// (passes true) or is cancelled (passes false). - /// - /// Example usage: - /// ```dart - /// controller.animateCamera(CameraUpdate.zoomIn(), - /// duration: Duration(milliseconds: 600), - /// onFinished: (bool success) => {}); - /// ``` - /// On iOS [duration] and [onFinished] are not supported and defining them - /// does nothing. - /// - /// See also [moveCamera], [followMyLocation], [showRouteOverview]. - Future animateCamera(CameraUpdate cameraUpdate, - {Duration? duration, AnimationFinishedCallback? onFinished}) { - return GoogleMapsNavigationPlatform.instance.animateCamera( - viewId: _viewId, - cameraUpdate: cameraUpdate, - duration: duration?.inMilliseconds, - onFinished: onFinished); - } - - /// Moves the camera from the current position to the position - /// defined in the [cameraUpdate]. - /// - /// See [CameraUpdate] for more information - /// on how to create different camera movements. - Future moveCamera(CameraUpdate cameraUpdate) { - return GoogleMapsNavigationPlatform.instance - .moveCamera(viewId: _viewId, cameraUpdate: cameraUpdate); - } + GoogleNavigationViewController(super.viewId); /// Is the navigation trip progress bar enabled. Future isNavigationTripProgressBarEnabled() { return GoogleMapsNavigationPlatform.instance - .isNavigationTripProgressBarEnabled(viewId: _viewId); + .isNavigationTripProgressBarEnabled(viewId: getViewId()); } /// Enable or disable the navigation trip progress bar. @@ -183,7 +36,7 @@ class GoogleNavigationViewController { Future setNavigationTripProgressBarEnabled(bool enabled) { return GoogleMapsNavigationPlatform.instance .setNavigationTripProgressBarEnabled( - viewId: _viewId, + viewId: getViewId(), enabled: enabled, ); } @@ -191,7 +44,7 @@ class GoogleNavigationViewController { /// Is the navigation header enabled. Future isNavigationHeaderEnabled() { return GoogleMapsNavigationPlatform.instance - .isNavigationHeaderEnabled(viewId: _viewId); + .isNavigationHeaderEnabled(viewId: getViewId()); } /// Enable or disable the navigation header. @@ -199,7 +52,7 @@ class GoogleNavigationViewController { /// By default, the navigation header is enabled. Future setNavigationHeaderEnabled(bool enabled) { return GoogleMapsNavigationPlatform.instance.setNavigationHeaderEnabled( - viewId: _viewId, + viewId: getViewId(), enabled: enabled, ); } @@ -207,7 +60,7 @@ class GoogleNavigationViewController { /// Is the navigation footer enabled. Future isNavigationFooterEnabled() { return GoogleMapsNavigationPlatform.instance - .isNavigationFooterEnabled(viewId: _viewId); + .isNavigationFooterEnabled(viewId: getViewId()); } /// Enable or disable the navigation footer. @@ -218,23 +71,7 @@ class GoogleNavigationViewController { /// calls [setEtaCardEnabled().](https://developers.google.com/maps/documentation/navigation/android-sdk/v1/reference/com/google/android/libraries/navigation/NavigationView#setEtaCardEnabled(boolean)) Future setNavigationFooterEnabled(bool enabled) { return GoogleMapsNavigationPlatform.instance.setNavigationFooterEnabled( - viewId: _viewId, - enabled: enabled, - ); - } - - /// Is the recenter button enabled. - Future isRecenterButtonEnabled() { - return GoogleMapsNavigationPlatform.instance - .isRecenterButtonEnabled(viewId: _viewId); - } - - /// Enable or disable the recenter button. - /// - /// By default, the recenter button is enabled. - Future setRecenterButtonEnabled(bool enabled) { - return GoogleMapsNavigationPlatform.instance.setRecenterButtonEnabled( - viewId: _viewId, + viewId: getViewId(), enabled: enabled, ); } @@ -242,7 +79,7 @@ class GoogleNavigationViewController { /// Can the speed limit indication be displayed. Future isSpeedLimitIconEnabled() { return GoogleMapsNavigationPlatform.instance - .isSpeedLimitIconEnabled(viewId: _viewId); + .isSpeedLimitIconEnabled(viewId: getViewId()); } /// Allow showing the speed limit indicator. @@ -250,7 +87,7 @@ class GoogleNavigationViewController { /// By default, the speed limit is not displayed. Future setSpeedLimitIconEnabled(bool enabled) { return GoogleMapsNavigationPlatform.instance.setSpeedLimitIconEnabled( - viewId: _viewId, + viewId: getViewId(), enabled: enabled, ); } @@ -258,7 +95,7 @@ class GoogleNavigationViewController { /// Can the speedometer be displayed. Future isSpeedometerEnabled() { return GoogleMapsNavigationPlatform.instance - .isSpeedometerEnabled(viewId: _viewId); + .isSpeedometerEnabled(viewId: getViewId()); } /// Allow showing the speedometer. @@ -266,7 +103,7 @@ class GoogleNavigationViewController { /// By default, the speedometer is not displayed. Future setSpeedometerEnabled(bool enabled) { return GoogleMapsNavigationPlatform.instance.setSpeedometerEnabled( - viewId: _viewId, + viewId: getViewId(), enabled: enabled, ); } @@ -274,7 +111,7 @@ class GoogleNavigationViewController { /// Are the incident cards displayed. Future isTrafficIncidentCardsEnabled() { return GoogleMapsNavigationPlatform.instance - .isTrafficIncidentCardsEnabled(viewId: _viewId); + .isTrafficIncidentCardsEnabled(viewId: getViewId()); } /// Enable or disable showing of the incident cards. @@ -282,7 +119,7 @@ class GoogleNavigationViewController { /// By default, the incident cards are shown. Future setTrafficIncidentCardsEnabled(bool enabled) { return GoogleMapsNavigationPlatform.instance.setTrafficIncidentCardsEnabled( - viewId: _viewId, + viewId: getViewId(), enabled: enabled, ); } @@ -290,7 +127,7 @@ class GoogleNavigationViewController { /// Check if the navigation user interface is shown. Future isNavigationUIEnabled() { return GoogleMapsNavigationPlatform.instance - .isNavigationUIEnabled(viewId: _viewId); + .isNavigationUIEnabled(viewId: getViewId()); } /// Show or hide the navigation user interface shown on top of the map. @@ -306,7 +143,7 @@ class GoogleNavigationViewController { /// and on iOS if the terms and conditions have not been accepted. Future setNavigationUIEnabled(bool enabled) { return GoogleMapsNavigationPlatform.instance.setNavigationUIEnabled( - viewId: _viewId, + viewId: getViewId(), enabled: enabled, ); } @@ -316,207 +153,7 @@ class GoogleNavigationViewController { /// See also [followMyLocation] and [animateCamera]. Future showRouteOverview() { return GoogleMapsNavigationPlatform.instance.showRouteOverview( - viewId: _viewId, + viewId: getViewId(), ); } - - /// Returns the minimum zoom level preference from the map view. - /// If minimum zoom preference is not set previously, returns minimum possible - /// zoom level for the current map type. - Future getMinZoomPreference() { - return GoogleMapsNavigationPlatform.instance - .getMinZoomPreference(viewId: _viewId); - } - - /// Returns the maximum zoom level preference from the map view. - /// If maximum zoom preference is not set previously, returns maximum possible - /// zoom level for the current map type. - Future getMaxZoomPreference() { - return GoogleMapsNavigationPlatform.instance - .getMaxZoomPreference(viewId: _viewId); - } - - /// Removes any previously specified upper and lower zoom bounds. - Future resetMinMaxZoomPreference() { - return GoogleMapsNavigationPlatform.instance - .resetMinMaxZoomPreference(viewId: _viewId); - } - - /// Sets a preferred lower bound for the camera zoom. - /// - /// When the minimum zoom changes, the SDK adjusts all later camera updates - /// to respect that minimum if possible. Note that there are technical - /// considerations that may prevent the SDK from allowing users to zoom too low. - /// - /// Throws [MinZoomRangeException] if [minZoomPreference] is - /// greater than maximum zoom lavel. - Future setMinZoomPreference(double minZoomPreference) { - return GoogleMapsNavigationPlatform.instance.setMinZoomPreference( - viewId: _viewId, minZoomPreference: minZoomPreference); - } - - /// Sets a preferred upper bound for the camera zoom. - /// - /// When the maximum zoom changes, the SDK adjusts all later camera updates - /// to respect that maximum if possible. Note that there are technical - /// considerations that may prevent the SDK from allowing users to zoom too - /// deep into the map. For example, satellite or terrain may have a lower - /// maximum zoom than the base map tiles. - /// - /// Throws [MaxZoomRangeException] if [maxZoomPreference] is - /// less than minimum zoom lavel. - Future setMaxZoomPreference(double maxZoomPreference) { - return GoogleMapsNavigationPlatform.instance.setMaxZoomPreference( - viewId: _viewId, maxZoomPreference: maxZoomPreference); - } - - /// Retrieves all markers that have been added to the map view. - Future> getMarkers() { - return GoogleMapsNavigationPlatform.instance.getMarkers(viewId: _viewId); - } - - /// Add markers to the map view. - Future> addMarkers(List markerOptions) { - return GoogleMapsNavigationPlatform.instance - .addMarkers(viewId: _viewId, markerOptions: markerOptions); - } - - /// Update markers to the map view. - /// - /// Throws [MarkerNotFoundException] if the [markers] list contains one or - /// more markers that have not been added to the map view via [addMarkers] or - /// contains markers that have already been removed from the map view. - Future> updateMarkers(List markers) async { - return GoogleMapsNavigationPlatform.instance - .updateMarkers(viewId: _viewId, markers: markers); - } - - /// Remove markers from the map view. - /// - /// Throws [MarkerNotFoundException] if the [markers] list contains one or - /// more markers that have not been added to the map view via [addMarkers] or - /// contains markers that have already been removed from the map view. - Future removeMarkers(List markers) async { - return GoogleMapsNavigationPlatform.instance - .removeMarkers(viewId: _viewId, markers: markers); - } - - /// Remove all markers from the map view. - Future clearMarkers() { - return GoogleMapsNavigationPlatform.instance.clearMarkers(viewId: _viewId); - } - - /// Retrieves all polygons that have been added to the map view. - Future> getPolygons() { - return GoogleMapsNavigationPlatform.instance.getPolygons(viewId: _viewId); - } - - /// Add polygons to the map view. - Future> addPolygons(List polygonOptions) { - return GoogleMapsNavigationPlatform.instance - .addPolygons(viewId: _viewId, polygonOptions: polygonOptions); - } - - /// Update polygons to the map view. - /// - /// Throws [PolygonNotFoundException] if the [polygons] list contains - /// polygon that has not beed added to the map view via [addPolygons] or - /// contains polygon that has already been removed from the map view. - Future> updatePolygons(List polygons) async { - return GoogleMapsNavigationPlatform.instance - .updatePolygons(viewId: _viewId, polygons: polygons); - } - - /// Remove polygons from the map view. - /// - /// Throws [PolygonNotFoundException] if the [polygons] list contains - /// polygon that has not beed added to the map view via [addPolygons] or - /// contains polygon that has already been removed from the map view. - Future removePolygons(List polygons) async { - return GoogleMapsNavigationPlatform.instance - .removePolygons(viewId: _viewId, polygons: polygons); - } - - /// Remove all polygons from the map view. - Future clearPolygons() { - return GoogleMapsNavigationPlatform.instance.clearPolygons(viewId: _viewId); - } - - /// Retrieves all polylines that have been added to the map view. - Future> getPolylines() { - return GoogleMapsNavigationPlatform.instance.getPolylines(viewId: _viewId); - } - - /// Add polylines to the map view. - Future> addPolylines(List polylineOptions) { - return GoogleMapsNavigationPlatform.instance - .addPolylines(viewId: _viewId, polylineOptions: polylineOptions); - } - - /// Update polylines to the map view. - /// - /// Throws [PolylineNotFoundException] if the [polylines] list contains - /// polyline that has not beed added to the map view via [addPolylines] or - /// contains polyline that has already been removed from the map view. - Future> updatePolylines(List polylines) async { - return GoogleMapsNavigationPlatform.instance - .updatePolylines(viewId: _viewId, polylines: polylines); - } - - /// Remove polylines from the map view. - /// - /// Throws [PolylineNotFoundException] if the [polylines] list contains - /// polyline that has not beed added to the map view via [addPolylines] or - /// contains polyline that has already been removed from the map view. - Future removePolylines(List polylines) async { - return GoogleMapsNavigationPlatform.instance - .removePolylines(viewId: _viewId, polylines: polylines); - } - - /// Remove all polylines from the map view. - Future clearPolylines() { - return GoogleMapsNavigationPlatform.instance - .clearPolylines(viewId: _viewId); - } - - /// Gets all circles from the map view. - Future> getCircles() { - return GoogleMapsNavigationPlatform.instance.getCircles(viewId: _viewId); - } - - /// Add circles to the map view. - Future> addCircles(List options) { - return GoogleMapsNavigationPlatform.instance - .addCircles(viewId: _viewId, options: options); - } - - /// Update circles to the map view. - /// - /// Throws [CircleNotFoundException] if the [circles] list contains one or - /// more circles that have not been added to the map view via [addCircles] or - /// contains circles that have already been removed from the map view. - Future> updateCircles(List circles) async { - return GoogleMapsNavigationPlatform.instance - .updateCircles(viewId: _viewId, circles: circles); - } - - /// Remove circles from the map view. - /// - /// Throws [CircleNotFoundException] if the [circles] list contains one or - /// more circles that have not been added to the map view via [addCircles] or - /// contains circles that have already been removed from the map view. - Future removeCircles(List circles) async { - return GoogleMapsNavigationPlatform.instance - .removeCircles(viewId: _viewId, circles: circles); - } - - /// Remove all circles from the map view. - Future clearCircles() { - return GoogleMapsNavigationPlatform.instance.clearCircles(viewId: _viewId); - } - - /// Remove all markers, polylines, polygons, overlays, etc from the map view. - Future clear() { - return GoogleMapsNavigationPlatform.instance.clear(viewId: _viewId); - } } From f676e3b2804bdf4059a382699383a2aa58000df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Fri, 25 Oct 2024 17:40:56 +0800 Subject: [PATCH 12/18] refactor: android redundant function removal --- .../navigation/GoogleMapsNavigationView.kt | 61 ------------------- 1 file changed, 61 deletions(-) diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt index d42f43b..bb634b6 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt @@ -171,67 +171,6 @@ internal constructor( super.initListeners() } - @Throws(FlutterError::class) - private fun findMarkerId(marker: Marker): String { - return _markers.find { it.marker == marker }?.markerId - ?: throw FlutterError("markerNotFound", "Could not find the marker.") - } - - @Throws(FlutterError::class) - private fun findMarkerController(markerId: String): MarkerController? { - return _markers.find { it.markerId == markerId } - } - - @Throws(FlutterError::class) - private fun findPolygonId(polygon: Polygon): String { - return _polygons.find { it.polygon == polygon }?.polygonId - ?: throw FlutterError("polygonNotFound", "Could not find the polygon.") - } - - @Throws(FlutterError::class) - private fun findPolylineId(polyline: Polyline): String { - return _polylines.find { it.polyline == polyline }?.polylineId - ?: throw FlutterError("polylineNotFound", "Could not find the polyline.") - } - - @Throws(FlutterError::class) - private fun findCircleId(circle: Circle): String { - return _circles.find { it.circle == circle }?.circleId - ?: throw FlutterError("circleNotFound", "Could not find the circle") - } - - @Throws(FlutterError::class) - private fun findPolygonController(polygonId: String): PolygonController? { - return _polygons.find { it.polygonId == polygonId } - } - - @Throws(FlutterError::class) - private fun findPolylineController(polylineId: String): PolylineController? { - return _polylines.find { it.polylineId == polylineId } - } - - @Throws(FlutterError::class) - private fun findCircleController(circleId: String): CircleController? { - return _circles.find { it.circleId == circleId } - } - - @Throws(FlutterError::class) - private fun sendMarkerEvent(marker: Marker, eventType: MarkerEventTypeDto) { - val markerId = findMarkerId(marker) - viewEventApi.onMarkerEvent(viewId.toLong(), markerId, eventType) {} - } - - @Throws(FlutterError::class) - private fun sendMarkerDragEvent(marker: Marker, eventType: MarkerDragEventTypeDto) { - val markerId = findMarkerId(marker) - viewEventApi.onMarkerDragEvent( - viewId.toLong(), - markerId, - eventType, - LatLngDto(marker.position.latitude, marker.position.longitude) - ) {} - } - fun isNavigationTripProgressBarEnabled(): Boolean { return _isNavigationTripProgressBarEnabled } From f2b404b1a89e270431b72ed44eda7b9f50074f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Mon, 28 Oct 2024 11:31:24 +0800 Subject: [PATCH 13/18] fix: general fixes and refactoring --- .../navigation/GoogleMapsNavigationView.kt | 4 - .../GoogleMapsViewMessageHandler.kt | 2 +- lib/src/google_maps_map_view.dart | 136 +++++++++--------- lib/src/google_navigation_flutter.dart | 5 - lib/src/method_channel/common_view_api.dart | 2 +- 5 files changed, 70 insertions(+), 79 deletions(-) diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt index bb634b6..aa66069 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt @@ -22,10 +22,6 @@ import android.view.View import com.google.android.gms.maps.CameraUpdateFactory import com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener import com.google.android.gms.maps.GoogleMapOptions -import com.google.android.gms.maps.model.Circle -import com.google.android.gms.maps.model.Marker -import com.google.android.gms.maps.model.Polygon -import com.google.android.gms.maps.model.Polyline import com.google.android.libraries.navigation.NavigationView import io.flutter.plugin.platform.PlatformView diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt index dadfc21..eec03b4 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt @@ -18,7 +18,7 @@ package com.google.maps.flutter.navigation import android.content.res.Resources -/** GoogleMapsNavigationMessageHandler */ +/** GoogleMapsViewMessageHandler */ class GoogleMapsViewMessageHandler(private val viewRegistry: GoogleMapsViewRegistry) : MapViewApi { private fun getNavigationView(viewId: Int): GoogleMapsNavigationView { diff --git a/lib/src/google_maps_map_view.dart b/lib/src/google_maps_map_view.dart index 5da564b..c29a809 100644 --- a/lib/src/google_maps_map_view.dart +++ b/lib/src/google_maps_map_view.dart @@ -24,74 +24,6 @@ typedef OnMapViewCreatedCallback = void Function( GoogleMapViewController controller, ); -/// The main map view widget for Google Maps Map View. -/// {@category Map View} -class GoogleMapsMapView extends GoogleMapsBaseMapView { - /// The main widget for embedding Google Maps Map View into a Flutter application. - /// - /// After creating the map view, the [onViewCreated] callback is triggered, providing a - /// [GoogleMapViewController] that you can use to interact with the map programmatically. - /// - /// Example usage: - /// ```dart - /// GoogleMapsMapView( - /// onViewCreated: (controller) { - /// // Use the controller to interact with the map. - /// }, - /// initialCameraPosition: CameraPosition( - /// // Initial camera position parameters - /// ), - /// // Other initial map settings... - /// ) - /// ``` - const GoogleMapsMapView( - {super.key, - required this.onViewCreated, - super.initialCameraPosition = const CameraPosition(), - super.initialMapType = MapType.normal, - super.initialCompassEnabled = true, - super.initialRotateGesturesEnabled = true, - super.initialScrollGesturesEnabled = true, - super.initialTiltGesturesEnabled = true, - super.initialZoomGesturesEnabled = true, - super.initialScrollGesturesEnabledDuringRotateOrZoom = true, - super.initialMapToolbarEnabled = true, - super.initialMinZoomPreference, - super.initialMaxZoomPreference, - super.initialZoomControlsEnabled = true, - super.initialCameraTargetBounds, - super.layoutDirection, - super.gestureRecognizers = - const >{}, - super.onRecenterButtonClicked, - super.onMarkerClicked, - super.onMarkerDrag, - super.onMarkerDragStart, - super.onMarkerDragEnd, - super.onMarkerInfoWindowClicked, - super.onMarkerInfoWindowClosed, - super.onMarkerInfoWindowLongClicked, - super.onMapClicked, - super.onMapLongClicked, - super.onPolygonClicked, - super.onPolylineClicked, - super.onCircleClicked, - super.onMyLocationClicked, - super.onMyLocationButtonClicked, - super.onCameraMoveStarted, - super.onCameraMove, - super.onCameraIdle, - super.onCameraStartedFollowingLocation, - super.onCameraStoppedFollowingLocation}); - - /// On view created callback. - final OnMapViewCreatedCallback onViewCreated; - - /// Creates a [State] for this [GoogleMapsBaseMapView]. - @override - State createState() => GoogleMapsMapViewState(); -} - /// The base view for map view and navigation view. Not to be used by itself. /// {@category Map View} @protected @@ -284,6 +216,74 @@ abstract class GoogleMapsBaseMapView extends StatefulWidget { final OnCameraStoppedFollowingLocation? onCameraStoppedFollowingLocation; } +/// The main map view widget for Google Maps Map View. +/// {@category Map View} +class GoogleMapsMapView extends GoogleMapsBaseMapView { + /// The main widget for embedding Google Maps Map View into a Flutter application. + /// + /// After creating the map view, the [onViewCreated] callback is triggered, providing a + /// [GoogleMapViewController] that you can use to interact with the map programmatically. + /// + /// Example usage: + /// ```dart + /// GoogleMapsMapView( + /// onViewCreated: (controller) { + /// // Use the controller to interact with the map. + /// }, + /// initialCameraPosition: CameraPosition( + /// // Initial camera position parameters + /// ), + /// // Other initial map settings... + /// ) + /// ``` + const GoogleMapsMapView( + {super.key, + required this.onViewCreated, + super.initialCameraPosition = const CameraPosition(), + super.initialMapType = MapType.normal, + super.initialCompassEnabled = true, + super.initialRotateGesturesEnabled = true, + super.initialScrollGesturesEnabled = true, + super.initialTiltGesturesEnabled = true, + super.initialZoomGesturesEnabled = true, + super.initialScrollGesturesEnabledDuringRotateOrZoom = true, + super.initialMapToolbarEnabled = true, + super.initialMinZoomPreference, + super.initialMaxZoomPreference, + super.initialZoomControlsEnabled = true, + super.initialCameraTargetBounds, + super.layoutDirection, + super.gestureRecognizers = + const >{}, + super.onRecenterButtonClicked, + super.onMarkerClicked, + super.onMarkerDrag, + super.onMarkerDragStart, + super.onMarkerDragEnd, + super.onMarkerInfoWindowClicked, + super.onMarkerInfoWindowClosed, + super.onMarkerInfoWindowLongClicked, + super.onMapClicked, + super.onMapLongClicked, + super.onPolygonClicked, + super.onPolylineClicked, + super.onCircleClicked, + super.onMyLocationClicked, + super.onMyLocationButtonClicked, + super.onCameraMoveStarted, + super.onCameraMove, + super.onCameraIdle, + super.onCameraStartedFollowingLocation, + super.onCameraStoppedFollowingLocation}); + + /// On view created callback. + final OnMapViewCreatedCallback onViewCreated; + + /// Creates a [State] for this [GoogleMapsMapView]. + @override + State createState() => GoogleMapsMapViewState(); +} + abstract class MapViewState extends State { @protected void initMapViewListeners(int viewId) { diff --git a/lib/src/google_navigation_flutter.dart b/lib/src/google_navigation_flutter.dart index 2483e34..83369d0 100644 --- a/lib/src/google_navigation_flutter.dart +++ b/lib/src/google_navigation_flutter.dart @@ -17,11 +17,6 @@ import 'dart:async'; import '../google_navigation_flutter.dart'; import 'google_navigation_flutter_platform_interface.dart'; -/// The view creation callback. -typedef OnCreatedCallback = void Function( - GoogleNavigationViewController controller, -); - /// Called during speeding event. typedef OnSpeedingUpdatedEventCallback = void Function( SpeedingUpdatedEvent onSpeedingUpdatedEvent, diff --git a/lib/src/method_channel/common_view_api.dart b/lib/src/method_channel/common_view_api.dart index c42c330..06a43a8 100644 --- a/lib/src/method_channel/common_view_api.dart +++ b/lib/src/method_channel/common_view_api.dart @@ -22,7 +22,7 @@ import '../google_navigation_flutter_platform_interface.dart'; import 'method_channel.dart'; /// @nodoc -/// Class that handles navigation view communications. +/// Class that handles map view and navigation view communications. mixin CommonNavigationViewAPI on NavigationViewAPIInterface { final MapViewApi _viewApi = MapViewApi(); bool _viewApiHasBeenSetUp = false; From 8009cb9c5d8d90232162fa73416a63315ce2a3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Mon, 28 Oct 2024 14:16:43 +0800 Subject: [PATCH 14/18] refactor: android base map view refactoring --- .../maps/flutter/navigation/GoogleMapView.kt | 2 +- .../navigation/GoogleMapsBaseMapView.kt | 52 +++++++++++++++ .../navigation/GoogleMapsNavigationView.kt | 63 +------------------ .../GoogleMapsViewMessageHandler.kt | 10 +-- 4 files changed, 59 insertions(+), 68 deletions(-) diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt index 76b9261..95ec8d5 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapView.kt @@ -30,7 +30,7 @@ internal constructor( viewEventApi: ViewEventApi, private val viewRegistry: GoogleMapsViewRegistry, imageRegistry: ImageRegistry -) : PlatformView, GoogleMapsBaseMapView(viewId, viewEventApi, imageRegistry) { +) : PlatformView, GoogleMapsBaseMapView(viewId, mapOptions, viewEventApi, imageRegistry) { private val _mapView: MapView = MapView(context, mapOptions) override fun getView(): View { diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt index d992209..13127ce 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt @@ -25,6 +25,7 @@ import com.google.android.gms.maps.CameraUpdate import com.google.android.gms.maps.CameraUpdateFactory import com.google.android.gms.maps.GoogleMap import com.google.android.gms.maps.GoogleMap.OnMarkerDragListener +import com.google.android.gms.maps.GoogleMapOptions import com.google.android.gms.maps.model.CameraPosition import com.google.android.gms.maps.model.Circle import com.google.android.gms.maps.model.FollowMyLocationOptions @@ -38,6 +39,7 @@ import com.google.android.libraries.navigation.NavigationView abstract class GoogleMapsBaseMapView( protected val viewId: Int, + mapOptions: GoogleMapOptions, protected val viewEventApi: ViewEventApi, private val imageRegistry: ImageRegistry ) { @@ -52,6 +54,11 @@ abstract class GoogleMapsBaseMapView( private val _polylines = mutableListOf() private val _circles = mutableListOf() + // Store preferred zoom values here because MapView getMinZoom and + // getMaxZoom always return min/max possible values and not the preferred ones. + private var _minZoomLevelPreference: Float? = null + private var _maxZoomLevelPreference: Float? = null + // Nullable variable to hold the callback function private var _mapReadyCallback: ((Result) -> Unit)? = null private var _loadedCallbackPending = false @@ -83,6 +90,11 @@ abstract class GoogleMapsBaseMapView( } } + init { + _minZoomLevelPreference = mapOptions.minZoomPreference + _maxZoomLevelPreference = mapOptions.maxZoomPreference + } + protected fun mapReady() { // Call and clear view ready callback if available. _mapReadyCallback?.let { callback -> @@ -301,6 +313,46 @@ abstract class GoogleMapsBaseMapView( getMap().uiSettings.isZoomControlsEnabled = enabled } + fun getMinZoomPreference(): Float { + return _minZoomLevelPreference ?: getMap().minZoomLevel + } + + fun getMaxZoomPreference(): Float { + return _maxZoomLevelPreference ?: getMap().maxZoomLevel + } + + fun resetMinMaxZoomPreference() { + _minZoomLevelPreference = null + _maxZoomLevelPreference = null + getMap().resetMinMaxZoomPreference() + } + + @Throws(FlutterError::class) + fun setMinZoomPreference(minZoomPreference: Float) { + if (minZoomPreference > (_maxZoomLevelPreference ?: getMap().maxZoomLevel)) { + throw FlutterError( + "minZoomGreaterThanMaxZoom", + "Minimum zoom level cannot be greater than maximum zoom level" + ) + } + + _minZoomLevelPreference = minZoomPreference + getMap().setMinZoomPreference(minZoomPreference) + } + + @Throws(FlutterError::class) + fun setMaxZoomPreference(maxZoomPreference: Float) { + if (maxZoomPreference < (_minZoomLevelPreference ?: getMap().minZoomLevel)) { + throw FlutterError( + "maxZoomLessThanMinZoom", + "Maximum zoom level cannot be less than minimum zoom level" + ) + } + + _maxZoomLevelPreference = maxZoomPreference + getMap().setMaxZoomPreference(maxZoomPreference) + } + fun setCompassEnabled(enabled: Boolean) { invalidateViewAfterMapLoad() getMap().uiSettings.isCompassEnabled = enabled diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt index aa66069..46f16e2 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt @@ -34,23 +34,8 @@ internal constructor( private val viewRegistry: GoogleMapsViewRegistry, viewEventApi: ViewEventApi, private val imageRegistry: ImageRegistry -) : PlatformView, GoogleMapsBaseMapView(viewId, viewEventApi, imageRegistry) { - companion object { - const val INVALIDATION_FRAME_SKIP_AMOUNT = 4 // Amount of skip frames before invalidation - } - +) : PlatformView, GoogleMapsBaseMapView(viewId, mapOptions, viewEventApi, imageRegistry) { private val _navigationView: NavigationView = NavigationView(context, mapOptions) - private val _frameDelayHandler = FrameDelayHandler(INVALIDATION_FRAME_SKIP_AMOUNT) - private var _loadedCallbackPending = false - private val _markers = mutableListOf() - private val _polygons = mutableListOf() - private val _polylines = mutableListOf() - private val _circles = mutableListOf() - - // Store preferred zoom values here because MapView getMinZoom and - // getMaxZoom always return min/max possible values and not the preferred ones. - private var _minZoomLevelPreference: Float? = null - private var _maxZoomLevelPreference: Float? = null /// Default values for UI features. private var _isNavigationTripProgressBarEnabled: Boolean = false @@ -61,9 +46,6 @@ internal constructor( private var _isSpeedometerEnabled: Boolean = false private var _isTrafficIncidentCardsEnabled: Boolean = true - // Nullable variable to hold the callback function - private var _mapReadyCallback: ((Result) -> Unit)? = null - override fun getView(): View { return _navigationView } @@ -87,9 +69,6 @@ internal constructor( } _navigationView.isNavigationUiEnabled = navigationViewEnabled - _minZoomLevelPreference = mapOptions.minZoomPreference - _maxZoomLevelPreference = mapOptions.maxZoomPreference - _navigationView.getMapAsync { map -> setMap(map) initListeners() @@ -253,46 +232,6 @@ internal constructor( _navigationView.showRouteOverview() } - fun getMinZoomPreference(): Float { - return _minZoomLevelPreference ?: getMap().minZoomLevel - } - - fun getMaxZoomPreference(): Float { - return _maxZoomLevelPreference ?: getMap().maxZoomLevel - } - - fun resetMinMaxZoomPreference() { - _minZoomLevelPreference = null - _maxZoomLevelPreference = null - getMap().resetMinMaxZoomPreference() - } - - @Throws(FlutterError::class) - fun setMinZoomPreference(minZoomPreference: Float) { - if (minZoomPreference > (_maxZoomLevelPreference ?: getMap().maxZoomLevel)) { - throw FlutterError( - "minZoomGreaterThanMaxZoom", - "Minimum zoom level cannot be greater than maximum zoom level" - ) - } - - _minZoomLevelPreference = minZoomPreference - getMap().setMinZoomPreference(minZoomPreference) - } - - @Throws(FlutterError::class) - fun setMaxZoomPreference(maxZoomPreference: Float) { - if (maxZoomPreference < (_minZoomLevelPreference ?: getMap().minZoomLevel)) { - throw FlutterError( - "maxZoomLessThanMinZoom", - "Maximum zoom level cannot be less than minimum zoom level" - ) - } - - _maxZoomLevelPreference = maxZoomPreference - getMap().setMaxZoomPreference(maxZoomPreference) - } - fun registerOnCameraChangedListener() { getMap().setOnCameraMoveStartedListener { reason -> val event = diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt index eec03b4..e93f872 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt @@ -369,23 +369,23 @@ class GoogleMapsViewMessageHandler(private val viewRegistry: GoogleMapsViewRegis } override fun getMinZoomPreference(viewId: Long): Double { - return getNavigationView(viewId.toInt()).getMinZoomPreference().toDouble() + return getView(viewId.toInt()).getMinZoomPreference().toDouble() } override fun getMaxZoomPreference(viewId: Long): Double { - return getNavigationView(viewId.toInt()).getMaxZoomPreference().toDouble() + return getView(viewId.toInt()).getMaxZoomPreference().toDouble() } override fun resetMinMaxZoomPreference(viewId: Long) { - getNavigationView(viewId.toInt()).resetMinMaxZoomPreference() + getView(viewId.toInt()).resetMinMaxZoomPreference() } override fun setMinZoomPreference(viewId: Long, minZoomPreference: Double) { - getNavigationView(viewId.toInt()).setMinZoomPreference(minZoomPreference.toFloat()) + getView(viewId.toInt()).setMinZoomPreference(minZoomPreference.toFloat()) } override fun setMaxZoomPreference(viewId: Long, maxZoomPreference: Double) { - getNavigationView(viewId.toInt()).setMaxZoomPreference(maxZoomPreference.toFloat()) + getView(viewId.toInt()).setMaxZoomPreference(maxZoomPreference.toFloat()) } override fun getMarkers(viewId: Long): List { From c59c0512d984b09f9a88c0cf078e0d300d9838c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Mon, 28 Oct 2024 16:21:15 +0800 Subject: [PATCH 15/18] test: update integration tests for regular google map view --- example/integration_test/shared.dart | 167 ++ example/integration_test/t06_map_test.dart | 534 ++--- ...8_marker_polygon_polyline_circle_test.dart | 1821 +++++++++-------- 3 files changed, 1389 insertions(+), 1133 deletions(-) diff --git a/example/integration_test/shared.dart b/example/integration_test/shared.dart index e5d242e..c6648c4 100644 --- a/example/integration_test/shared.dart +++ b/example/integration_test/shared.dart @@ -33,6 +33,20 @@ export 'package:flutter_test/flutter_test.dart'; export 'package:google_navigation_flutter/google_navigation_flutter.dart'; export 'package:patrol/patrol.dart'; +// Type used for iterating over different maps to be tested. +enum TestMapType { + /// Regular google map view. + map, + + /// Navigation map. + navigation, +} + +const List testMapTypes = [ + TestMapType.map, + TestMapType.navigation +]; + /// Location coordinates for starting position simulation in Finland - Näkkäläntie. const double startLocationLat = 68.593793; const double startLocationLng = 23.510763; @@ -87,6 +101,24 @@ Widget wrapNavigationView(GoogleMapsNavigationView navigationView) { ); } +/// Pumps a [mapView] widget in tester [$] and then waits until it settles. +Future pumpMapView( + PatrolIntegrationTester $, GoogleMapsMapView mapView) async { + await $.pumpWidget(wrapMapView(mapView)); + await $.pumpAndSettle(); +} + +/// Wraps a [mapView] in widgets. +Widget wrapMapView(GoogleMapsMapView mapView) { + return MaterialApp( + home: Scaffold( + body: Center( + child: mapView, + ), + ), + ); +} + Future checkTermsAndConditionsAcceptance( PatrolIntegrationTester $) async { if (!await GoogleMapsNavigator.areTermsAccepted()) { @@ -202,6 +234,81 @@ Future startNavigation( return controller; } +/// Returns a map view controller based on the provided test map type. +Future getMapViewControllerForTestMapType( + PatrolIntegrationTester $, { + required TestMapType testMapType, + bool initializeNavigation = true, + bool simulateLocation = false, + void Function(String)? onMarkerClicked, + void Function(String)? onCircleClicked, + void Function(LatLng)? onMapClicked, + void Function(LatLng)? onMapLongClicked, + void Function(String, LatLng)? onMarkerDrag, + void Function(String, LatLng)? onMarkerDragEnd, + void Function(String, LatLng)? onMarkerDragStart, + void Function(String)? onMarkerInfoWindowClicked, + void Function(String)? onMarkerInfoWindowClosed, + void Function(String)? onMarkerInfoWindowLongClicked, + void Function(MyLocationButtonClickedEvent)? onMyLocationButtonClicked, + void Function(MyLocationClickedEvent)? onMyLocationClicked, + void Function(bool)? onNavigationUIEnabledChanged, + void Function(String)? onPolygonClicked, + void Function(String)? onPolylineClicked, + void Function(NavigationViewRecenterButtonClickedEvent)? + onRecenterButtonClicked, + void Function(CameraPosition)? onCameraIdle, +}) async { + GoogleMapViewController viewController; + + switch (testMapType) { + /// Set up map. + case TestMapType.map: + viewController = await startMapView( + $, + onMarkerClicked: onMarkerClicked, + onCircleClicked: onCircleClicked, + onMapClicked: onMapClicked, + onMapLongClicked: onMapLongClicked, + onMarkerDrag: onMarkerDrag, + onMarkerDragEnd: onMarkerDragEnd, + onMarkerDragStart: onMarkerDragStart, + onMarkerInfoWindowClicked: onMarkerInfoWindowClicked, + onMarkerInfoWindowClosed: onMarkerInfoWindowClosed, + onMarkerInfoWindowLongClicked: onMarkerInfoWindowLongClicked, + onMyLocationButtonClicked: onMyLocationButtonClicked, + onMyLocationClicked: onMyLocationClicked, + onPolygonClicked: onPolygonClicked, + onPolylineClicked: onPolygonClicked, + ); // Instantiate a regular map. + break; + + /// Set up navigation map. + case TestMapType.navigation: + viewController = await startNavigationWithoutDestination($, + initializeNavigation: initializeNavigation, + simulateLocation: simulateLocation, + onMarkerClicked: onMarkerClicked, + onCircleClicked: onCircleClicked, + onMapClicked: onMapClicked, + onMapLongClicked: onMapLongClicked, + onMarkerDrag: onMarkerDrag, + onMarkerDragEnd: onMarkerDragEnd, + onMarkerDragStart: onMarkerDragStart, + onMarkerInfoWindowClicked: onMarkerInfoWindowClicked, + onMarkerInfoWindowClosed: onMarkerInfoWindowClosed, + onMarkerInfoWindowLongClicked: onMarkerInfoWindowLongClicked, + onMyLocationButtonClicked: onMyLocationButtonClicked, + onMyLocationClicked: onMyLocationClicked, + onPolygonClicked: onPolygonClicked, + onPolylineClicked: onPolygonClicked, + onRecenterButtonClicked: + onRecenterButtonClicked); // Instantiate a navigation map. + break; + } + return viewController; +} + /// Start navigation without setting the destination. /// /// Optionally simulate the starting location with [simulateLocation], @@ -282,6 +389,66 @@ Future startNavigationWithoutDestination( return controller; } +/// Start regular map view. +/// +/// Optionally set various event callback listener functions. +Future startMapView( + PatrolIntegrationTester $, { + void Function(String)? onMarkerClicked, + void Function(String)? onCircleClicked, + void Function(LatLng)? onMapClicked, + void Function(LatLng)? onMapLongClicked, + void Function(String, LatLng)? onMarkerDrag, + void Function(String, LatLng)? onMarkerDragEnd, + void Function(String, LatLng)? onMarkerDragStart, + void Function(String)? onMarkerInfoWindowClicked, + void Function(String)? onMarkerInfoWindowClosed, + void Function(String)? onMarkerInfoWindowLongClicked, + void Function(MyLocationButtonClickedEvent)? onMyLocationButtonClicked, + void Function(MyLocationClickedEvent)? onMyLocationClicked, + void Function(String)? onPolygonClicked, + void Function(String)? onPolylineClicked, + void Function(NavigationViewRecenterButtonClickedEvent)? + onRecenterButtonClicked, + void Function(CameraPosition)? onCameraIdle, +}) async { + final Completer controllerCompleter = + Completer(); + + //await checkLocationDialogAndTosAcceptance($); + + final Key key = GlobalKey(); + await pumpMapView( + $, + GoogleMapsMapView( + key: key, + onViewCreated: (GoogleMapViewController viewController) { + controllerCompleter.complete(viewController); + }, + onMarkerClicked: onMarkerClicked, + onCircleClicked: onCircleClicked, + onMapClicked: onMapClicked, + onMapLongClicked: onMapLongClicked, + onMarkerDrag: onMarkerDrag, + onMarkerDragEnd: onMarkerDragEnd, + onMarkerDragStart: onMarkerDragStart, + onMarkerInfoWindowClicked: onMarkerInfoWindowClicked, + onMarkerInfoWindowClosed: onMarkerInfoWindowClosed, + onMarkerInfoWindowLongClicked: onMarkerInfoWindowLongClicked, + onMyLocationButtonClicked: onMyLocationButtonClicked, + onMyLocationClicked: onMyLocationClicked, + onPolygonClicked: onPolygonClicked, + onPolylineClicked: onPolygonClicked, + onRecenterButtonClicked: onRecenterButtonClicked, + ), + ); + + final GoogleMapViewController controller = await controllerCompleter.future; + await $.pumpAndSettle(); + + return controller; +} + /// A function that waits until a certain condition is met, e.g. until the camera moves where intended. /// /// The function constantly sends the Value objects from [getValue] function diff --git a/example/integration_test/t06_map_test.dart b/example/integration_test/t06_map_test.dart index 1e939bc..dd3b0a6 100644 --- a/example/integration_test/t06_map_test.dart +++ b/example/integration_test/t06_map_test.dart @@ -27,280 +27,338 @@ import 'shared.dart'; void main() { patrol('Test map types', (PatrolIntegrationTester $) async { - /// Set up navigation. - final GoogleNavigationViewController viewController = - await startNavigationWithoutDestination($); - - // Test default type. - expect(await viewController.getMapType(), MapType.normal); - - final List types = [ - MapType.satellite, - MapType.terrain, - MapType.hybrid, - MapType.normal, - ]; - - for (final MapType type in types) { - await viewController.setMapType(mapType: type); - expect(await viewController.getMapType(), type); + for (final TestMapType testMapType in testMapTypes) { + /// Get viewController for the test type (navigation map or regular map). + GoogleMapViewController viewController = + await getMapViewControllerForTestMapType($, testMapType: testMapType); + + // Test default type. + expect(await viewController.getMapType(), MapType.normal); + + final List types = [ + MapType.satellite, + MapType.terrain, + MapType.hybrid, + MapType.normal, + ]; + + for (final MapType type in types) { + await viewController.setMapType(mapType: type); + expect(await viewController.getMapType(), type); + } } }); patrol('Test platform view creation params', (PatrolIntegrationTester $) async { - final Completer controllerCompleter = - Completer(); - - final Key key = GlobalKey(); - await pumpNavigationView( - $, - GoogleMapsNavigationView( - key: key, - initialMapType: MapType.hybrid, - initialCompassEnabled: false, - initialRotateGesturesEnabled: false, - initialScrollGesturesEnabled: false, - initialTiltGesturesEnabled: false, - initialZoomGesturesEnabled: false, - initialZoomControlsEnabled: false, - initialScrollGesturesEnabledDuringRotateOrZoom: false, - initialMapToolbarEnabled: false, - onViewCreated: (GoogleNavigationViewController viewController) { - controllerCompleter.complete(viewController); - }, - ), - ); - - final GoogleNavigationViewController controller = - await controllerCompleter.future; - - /// Test the value initialization succeeded - expect(await controller.getMapType(), MapType.hybrid); - expect(await controller.settings.isCompassEnabled(), false); - expect(await controller.settings.isRotateGesturesEnabled(), false); - expect(await controller.settings.isScrollGesturesEnabled(), false); - expect(await controller.settings.isTiltGesturesEnabled(), false); - expect(await controller.settings.isZoomGesturesEnabled(), false); - expect( - await controller.settings.isScrollGesturesEnabledDuringRotateOrZoom(), - false); - - if (Platform.isAndroid) { - expect(await controller.settings.isZoomControlsEnabled(), false); - expect(await controller.settings.isMapToolbarEnabled(), false); + for (final TestMapType testMapType in testMapTypes) { + final Completer controllerCompleter = + Completer(); + + switch (testMapType) { + case TestMapType.map: + final Key key = GlobalKey(); + await pumpMapView( + $, + GoogleMapsMapView( + key: key, + initialMapType: MapType.hybrid, + initialCompassEnabled: false, + initialRotateGesturesEnabled: false, + initialScrollGesturesEnabled: false, + initialTiltGesturesEnabled: false, + initialZoomGesturesEnabled: false, + initialZoomControlsEnabled: false, + initialScrollGesturesEnabledDuringRotateOrZoom: false, + initialMapToolbarEnabled: false, + onViewCreated: (GoogleMapViewController viewController) { + controllerCompleter.complete(viewController); + }, + ), + ); + break; + case TestMapType.navigation: + final Key key = GlobalKey(); + await pumpNavigationView( + $, + GoogleMapsNavigationView( + key: key, + initialMapType: MapType.hybrid, + initialCompassEnabled: false, + initialRotateGesturesEnabled: false, + initialScrollGesturesEnabled: false, + initialTiltGesturesEnabled: false, + initialZoomGesturesEnabled: false, + initialZoomControlsEnabled: false, + initialScrollGesturesEnabledDuringRotateOrZoom: false, + initialMapToolbarEnabled: false, + onViewCreated: (GoogleNavigationViewController viewController) { + controllerCompleter.complete(viewController); + }, + ), + ); + break; + } + + final GoogleMapViewController controller = + await controllerCompleter.future; + + /// Test the value initialization succeeded + expect(await controller.getMapType(), MapType.hybrid); + expect(await controller.settings.isCompassEnabled(), false); + expect(await controller.settings.isRotateGesturesEnabled(), false); + expect(await controller.settings.isScrollGesturesEnabled(), false); + expect(await controller.settings.isTiltGesturesEnabled(), false); + expect(await controller.settings.isZoomGesturesEnabled(), false); + expect( + await controller.settings.isScrollGesturesEnabledDuringRotateOrZoom(), + false); + + if (Platform.isAndroid) { + expect(await controller.settings.isZoomControlsEnabled(), false); + expect(await controller.settings.isMapToolbarEnabled(), false); + } } }); patrol('Test map UI settings', (PatrolIntegrationTester $) async { - /// The events are not tested because there's currently no reliable way to trigger them. - void onMyLocationButtonClicked(MyLocationButtonClickedEvent event) { - debugPrint('My location button clicked event: currently $event'); - } + for (final TestMapType testMapType in testMapTypes) { + /// The events are not tested because there's currently no reliable way to trigger them. + void onMyLocationButtonClicked(MyLocationButtonClickedEvent event) { + debugPrint('My location button clicked event: currently $event'); + } - /// The events are not tested because there's no reliable way to trigger them currently. - void onMyLocationClicked(MyLocationClickedEvent event) { - debugPrint('My location clicked event: currently $event'); - } + /// The events are not tested because there's no reliable way to trigger them currently. + void onMyLocationClicked(MyLocationClickedEvent event) { + debugPrint('My location clicked event: currently $event'); + } - /// The events are not tested because there's no reliable way to trigger them currently. - void onMapLongClicked(LatLng coordinates) { - debugPrint( - 'Map clicked event lat: ${coordinates.latitude}, lng: ${coordinates.longitude}.'); - } + /// The events are not tested because there's no reliable way to trigger them currently. + void onMapLongClicked(LatLng coordinates) { + debugPrint( + 'Map clicked event lat: ${coordinates.latitude}, lng: ${coordinates.longitude}.'); + } - /// Set up navigation without initialization to test isMyLocationEnabled - /// is false before initialization is done. Test the onMapClicked event - /// and setting the other callback functions. - final GoogleNavigationViewController controller = - await startNavigationWithoutDestination( - $, - initializeNavigation: false, - onMapClicked: expectAsync1((LatLng msg) { - expectSync(msg, isA()); - }, max: 1), - onMapLongClicked: onMapLongClicked, - onMyLocationButtonClicked: onMyLocationButtonClicked, - onMyLocationClicked: onMyLocationClicked, - ); - - /// Test that the onMapClicked event comes in. - await $.native.tapAt(const Offset(0.5, 0.5)); - - /// Test the default values match with what has been documented in the - /// API documentation in google_navigation_flutter.dart file. - expect(await controller.isMyLocationEnabled(), false); - expect(await controller.settings.isMyLocationButtonEnabled(), true); - expect(await controller.settings.isZoomGesturesEnabled(), true); - expect(await controller.settings.isCompassEnabled(), true); - expect(await controller.settings.isRotateGesturesEnabled(), true); - expect(await controller.settings.isScrollGesturesEnabled(), true); - expect( - await controller.settings.isScrollGesturesEnabledDuringRotateOrZoom(), - true); - expect(await controller.settings.isTiltGesturesEnabled(), true); - if (Platform.isAndroid) { - expect(await controller.settings.isMapToolbarEnabled(), true); - } + /// Set up navigation without initialization to test isMyLocationEnabled + /// is false before initialization is done. Test the onMapClicked event + /// and setting the other callback functions. + final GoogleMapViewController controller = + + /// Get viewController for the test type (navigation map or regular map). + await getMapViewControllerForTestMapType( + $, + testMapType: testMapType, + initializeNavigation: false, + onMapClicked: expectAsync1((LatLng msg) { + expectSync(msg, isA()); + }, max: 1), + onMapLongClicked: onMapLongClicked, + onMyLocationButtonClicked: onMyLocationButtonClicked, + onMyLocationClicked: onMyLocationClicked, + ); + + /// Test that the onMapClicked event comes in. + await $.native.tapAt(const Offset(0.5, 0.5)); + + /// Test the default values match with what has been documented in the + /// API documentation in google_navigation_flutter.dart file. + expect(await controller.isMyLocationEnabled(), false); + expect(await controller.settings.isMyLocationButtonEnabled(), true); + expect(await controller.settings.isZoomGesturesEnabled(), true); + expect(await controller.settings.isCompassEnabled(), true); + expect(await controller.settings.isRotateGesturesEnabled(), true); + expect(await controller.settings.isScrollGesturesEnabled(), true); + expect( + await controller.settings.isScrollGesturesEnabledDuringRotateOrZoom(), + true); + expect(await controller.settings.isTiltGesturesEnabled(), true); + if (Platform.isAndroid) { + expect(await controller.settings.isMapToolbarEnabled(), true); + } - final List results = [true, false, true]; - for (final bool result in results) { - await controller.setMyLocationEnabled(result); - expect(await controller.isMyLocationEnabled(), result); + final List results = [true, false, true]; + for (final bool result in results) { + await controller.setMyLocationEnabled(result); + expect(await controller.isMyLocationEnabled(), result); - await controller.settings.setMyLocationButtonEnabled(result); - expect(await controller.settings.isMyLocationButtonEnabled(), result); + await controller.settings.setMyLocationButtonEnabled(result); + expect(await controller.settings.isMyLocationButtonEnabled(), result); - await controller.settings.setZoomGesturesEnabled(result); - expect(await controller.settings.isZoomGesturesEnabled(), result); + await controller.settings.setZoomGesturesEnabled(result); + expect(await controller.settings.isZoomGesturesEnabled(), result); - await controller.settings.setCompassEnabled(result); - expect(await controller.settings.isCompassEnabled(), result); + await controller.settings.setCompassEnabled(result); + expect(await controller.settings.isCompassEnabled(), result); - await controller.settings.setRotateGesturesEnabled(result); - expect(await controller.settings.isRotateGesturesEnabled(), result); + await controller.settings.setRotateGesturesEnabled(result); + expect(await controller.settings.isRotateGesturesEnabled(), result); - await controller.settings.setScrollGesturesEnabled(result); - expect(await controller.settings.isScrollGesturesEnabled(), result); + await controller.settings.setScrollGesturesEnabled(result); + expect(await controller.settings.isScrollGesturesEnabled(), result); - await controller.settings - .setScrollGesturesDuringRotateOrZoomEnabled(result); - expect( - await controller.settings.isScrollGesturesEnabledDuringRotateOrZoom(), - result); + await controller.settings + .setScrollGesturesDuringRotateOrZoomEnabled(result); + expect( + await controller.settings + .isScrollGesturesEnabledDuringRotateOrZoom(), + result); - await controller.settings.setTiltGesturesEnabled(result); - expect(await controller.settings.isTiltGesturesEnabled(), result); + await controller.settings.setTiltGesturesEnabled(result); + expect(await controller.settings.isTiltGesturesEnabled(), result); - await controller.settings.setTrafficEnabled(result); - expect(await controller.settings.isTrafficEnabled(), result); + await controller.settings.setTrafficEnabled(result); + expect(await controller.settings.isTrafficEnabled(), result); - if (Platform.isAndroid) { - await controller.settings.setZoomControlsEnabled(result); - expect(await controller.settings.isZoomControlsEnabled(), result); + if (Platform.isAndroid) { + await controller.settings.setZoomControlsEnabled(result); + expect(await controller.settings.isZoomControlsEnabled(), result); - await controller.settings.setMapToolbarEnabled(result); - expect(await controller.settings.isMapToolbarEnabled(), result); + await controller.settings.setMapToolbarEnabled(result); + expect(await controller.settings.isMapToolbarEnabled(), result); + } } - } - // Test methods not supported on iOS - if (Platform.isIOS) { - try { - await controller.settings.isZoomControlsEnabled(); - fail('Expected to get UnsupportedError'); - } on Object catch (e) { - expect(e, const TypeMatcher()); - } - try { - await controller.settings.setZoomControlsEnabled(true); - fail('Expected to get UnsupportedError'); - } on Object catch (e) { - expect(e, const TypeMatcher()); - } - try { - await controller.settings.isMapToolbarEnabled(); - fail('Expected to get UnsupportedError'); - } on Object catch (e) { - expect(e, const TypeMatcher()); - } - try { - await controller.settings.setMapToolbarEnabled(true); - fail('Expected to get UnsupportedError'); - } on Object catch (e) { - expect(e, const TypeMatcher()); + // Test methods not supported on iOS + if (Platform.isIOS) { + try { + await controller.settings.isZoomControlsEnabled(); + fail('Expected to get UnsupportedError'); + } on Object catch (e) { + expect(e, const TypeMatcher()); + } + try { + await controller.settings.setZoomControlsEnabled(true); + fail('Expected to get UnsupportedError'); + } on Object catch (e) { + expect(e, const TypeMatcher()); + } + try { + await controller.settings.isMapToolbarEnabled(); + fail('Expected to get UnsupportedError'); + } on Object catch (e) { + expect(e, const TypeMatcher()); + } + try { + await controller.settings.setMapToolbarEnabled(true); + fail('Expected to get UnsupportedError'); + } on Object catch (e) { + expect(e, const TypeMatcher()); + } } } }); patrol('Test map style', (PatrolIntegrationTester $) async { - /// Set up navigation. - final GoogleNavigationViewController viewController = - await startNavigationWithoutDestination($); - - // Test that valid json doens't throw exception. - await viewController.setMapStyle( - '[{"elementType":"geometry","stylers":[{"color":"#ffffff"}]}]'); - - // Test that null value doesn't throw exception. - await viewController.setMapStyle(null); - - // Test that invalid json throws exception. - try { - await viewController.setMapStyle('not_json'); - fail('expected to get MapStyleException'); - } on MapStyleException catch (e) { - expect(e, isNotNull); + for (final TestMapType testMapType in testMapTypes) { + /// Get viewController for the test type (navigation map or regular map). + GoogleMapViewController viewController = + await getMapViewControllerForTestMapType($, testMapType: testMapType); + + // Test that valid json doens't throw exception. + await viewController.setMapStyle( + '[{"elementType":"geometry","stylers":[{"color":"#ffffff"}]}]'); + + // Test that null value doesn't throw exception. + await viewController.setMapStyle(null); + + // Test that invalid json throws exception. + try { + await viewController.setMapStyle('not_json'); + fail('expected to get MapStyleException'); + } on MapStyleException catch (e) { + expect(e, isNotNull); + } } }); patrol('Test min max zoom level', (PatrolIntegrationTester $) async { - /// For some reason the functionality works on Android example app, but it doesn't work - /// during the testing. Will skip Android testing for now. - final Completer viewControllerCompleter = - Completer(); - - await checkLocationDialogAcceptance($); - - /// Display navigation view. - final Key key = GlobalKey(); - await pumpNavigationView( - $, - GoogleMapsNavigationView( - key: key, - onViewCreated: (GoogleNavigationViewController controller) { - viewControllerCompleter.complete(controller); - }, - ), - ); - - final GoogleNavigationViewController viewController = - await viewControllerCompleter.future; - - // Test that valid zoom values don't throw exception. - await viewController.setMinZoomPreference(10); - await viewController.setMaxZoomPreference(11); - - // Test that min max values were changed. - double newMinZoomPreference = await viewController.getMinZoomPreference(); - double newMaxZoomPreference = await viewController.getMaxZoomPreference(); - - expect(newMinZoomPreference, 10.0); - expect(newMaxZoomPreference, 11.0); - - // Reset zoom limits. - await viewController.resetMinMaxZoomPreference(); - - // Test that min max values were reset. - final double resetedMinZoom = await viewController.getMinZoomPreference(); - final double resetedMaxZoom = await viewController.getMaxZoomPreference(); - - expect(resetedMinZoom, isNot(10.0)); - expect(resetedMaxZoom, isNot(11.0)); - - // Test that invalid value throws exception. - try { - await viewController.setMinZoomPreference(40); - fail('expected to get ZoomPreferenceException'); - } on MinZoomRangeException catch (e) { - expect(e, isNotNull); - } - try { - await viewController.setMaxZoomPreference(1); - fail('expected to get ZoomPreferenceException'); - } on MaxZoomRangeException catch (e) { - expect(e, isNotNull); - } + for (final TestMapType testMapType in testMapTypes) { + /// For some reason the functionality works on Android example app, but it doesn't work + /// during the testing. Will skip Android testing for now. + final Completer viewControllerCompleter = + Completer(); + + await checkLocationDialogAcceptance($); + + switch (testMapType) { + case TestMapType.map: + + /// Display map view. + final Key key = GlobalKey(); + await pumpMapView( + $, + GoogleMapsMapView( + key: key, + onViewCreated: (GoogleMapViewController controller) { + viewControllerCompleter.complete(controller); + }, + ), + ); + break; + case TestMapType.navigation: + + /// Display navigation view. + final Key key = GlobalKey(); + await pumpNavigationView( + $, + GoogleMapsNavigationView( + key: key, + onViewCreated: (GoogleNavigationViewController controller) { + viewControllerCompleter.complete(controller); + }, + ), + ); + break; + } - // Try to set out of bounds values. - await viewController.setMinZoomPreference(0); - await viewController.setMaxZoomPreference(50); + final GoogleMapViewController viewController = + await viewControllerCompleter.future; - newMinZoomPreference = await viewController.getMinZoomPreference(); - newMaxZoomPreference = await viewController.getMaxZoomPreference(); + // Test that valid zoom values don't throw exception. + await viewController.setMinZoomPreference(10); + await viewController.setMaxZoomPreference(11); - // Expect the same values. The actual zoom level will be limited by the map. - expect(newMinZoomPreference, 0.0); - expect(newMaxZoomPreference, 50.0); + // Test that min max values were changed. + double newMinZoomPreference = await viewController.getMinZoomPreference(); + double newMaxZoomPreference = await viewController.getMaxZoomPreference(); + + expect(newMinZoomPreference, 10.0); + expect(newMaxZoomPreference, 11.0); + + // Reset zoom limits. + await viewController.resetMinMaxZoomPreference(); + + // Test that min max values were reset. + final double resetedMinZoom = await viewController.getMinZoomPreference(); + final double resetedMaxZoom = await viewController.getMaxZoomPreference(); + + expect(resetedMinZoom, isNot(10.0)); + expect(resetedMaxZoom, isNot(11.0)); + + // Test that invalid value throws exception. + try { + await viewController.setMinZoomPreference(40); + fail('expected to get ZoomPreferenceException'); + } on MinZoomRangeException catch (e) { + expect(e, isNotNull); + } + try { + await viewController.setMaxZoomPreference(1); + fail('expected to get ZoomPreferenceException'); + } on MaxZoomRangeException catch (e) { + expect(e, isNotNull); + } + + // Try to set out of bounds values. + await viewController.setMinZoomPreference(0); + await viewController.setMaxZoomPreference(50); + + newMinZoomPreference = await viewController.getMinZoomPreference(); + newMaxZoomPreference = await viewController.getMaxZoomPreference(); + + // Expect the same values. The actual zoom level will be limited by the map. + expect(newMinZoomPreference, 0.0); + expect(newMaxZoomPreference, 50.0); + } }); } diff --git a/example/integration_test/t08_marker_polygon_polyline_circle_test.dart b/example/integration_test/t08_marker_polygon_polyline_circle_test.dart index 065c4df..975f3df 100644 --- a/example/integration_test/t08_marker_polygon_polyline_circle_test.dart +++ b/example/integration_test/t08_marker_polygon_polyline_circle_test.dart @@ -29,943 +29,974 @@ import 'shared.dart'; void main() { patrol('Marker tests', (PatrolIntegrationTester $) async { - void onMarkerClicked(String event) { - debugPrint('Marker clicked event: $event.'); - } + for (final TestMapType testMapType in testMapTypes) { + void onMarkerClicked(String event) { + debugPrint('Marker clicked event: $event.'); + } - /// The events are not tested because there's currently no reliable way to trigger them. - void onMarkerDrag(String event, LatLng coordinates) { - debugPrint('Marker dragged event: $event. Coorinates: $coordinates.'); - } + /// The events are not tested because there's currently no reliable way to trigger them. + void onMarkerDrag(String event, LatLng coordinates) { + debugPrint('Marker dragged event: $event. Coorinates: $coordinates.'); + } - /// The events are not tested because there's currently no reliable way to trigger them. - void onMarkerInfoWindowAction(String event) { - debugPrint('Marker dragged event: $event.'); - } + /// The events are not tested because there's currently no reliable way to trigger them. + void onMarkerInfoWindowAction(String event) { + debugPrint('Marker dragged event: $event.'); + } + + /// Get viewController for the test type (navigation map or regular map). + final GoogleMapViewController viewController = + await getMapViewControllerForTestMapType( + $, + testMapType: testMapType, + onMarkerClicked: onMarkerClicked, + onMarkerDrag: onMarkerDrag, + onMarkerDragEnd: onMarkerDrag, + onMarkerDragStart: onMarkerDrag, + onMarkerInfoWindowClicked: onMarkerInfoWindowAction, + onMarkerInfoWindowClosed: onMarkerInfoWindowAction, + onMarkerInfoWindowLongClicked: onMarkerInfoWindowAction, + ); + + // markerOne options. + const MarkerOptions markerOneOptions = MarkerOptions( + position: + LatLng(latitude: 60.34856639667419, longitude: 25.03459821831162), + infoWindow: InfoWindow( + title: 'Helsinki Office', + snippet: 'markerOne', + ), + ); + + // Add marker and save response to [addedMarkersList]. + final List addedMarkersList = + await viewController.addMarkers([markerOneOptions]); + expect(addedMarkersList.length, 1); + final Marker? addedMarker = addedMarkersList.first; + + // Get markers and save them to [getMarkerList]. + final List getMarkersList = await viewController.getMarkers(); + expect(getMarkersList.length, 1); + final Marker? getMarker = getMarkersList.first; + + List markers = [addedMarker!, getMarker!]; + + /// Test MarkerOptions default values against addedMarker and getMarkers responses. + for (final Marker marker in markers) { + expect(marker.options.alpha, 1.0); + expect(marker.options.anchor.u, 0.5); + expect(marker.options.anchor.v, 1.0); + expect(marker.options.draggable, false); + expect(marker.options.flat, false); + expect(marker.options.icon, ImageDescriptor.defaultImage); + expect(marker.options.consumeTapEvents, false); + expect(marker.options.position, markerOneOptions.position); + expect(marker.options.rotation, 0.0); + expect( + marker.options.infoWindow.title, markerOneOptions.infoWindow.title); + expect(marker.options.infoWindow.snippet, + markerOneOptions.infoWindow.snippet); + expect(marker.options.infoWindow.anchor.u, 0.5); + expect(marker.options.infoWindow.anchor.v, 0.0); + expect(marker.options.visible, true); + expect(marker.options.zIndex, 0.0); + } + + /// Create a marker icon. + final ByteData imageBytes = await rootBundle.load('assets/marker1.png'); + final ImageDescriptor customIcon = + await registerBitmapImage(bitmap: imageBytes, imagePixelRatio: 2); + + // markerTwo options. + final MarkerOptions markerTwoOptions = MarkerOptions( + alpha: 0.5, + anchor: const MarkerAnchor(u: 0.1, v: 0.2), + draggable: true, + flat: true, + icon: customIcon, + consumeTapEvents: true, + position: const LatLng( + latitude: 65.01193816057041, longitude: 25.46790635614996), + rotation: 70, + infoWindow: const InfoWindow( + title: 'Oulu Office', + snippet: 'markerTwo', + anchor: MarkerAnchor(u: 0.3, v: 0.4), + ), + visible: false, + zIndex: 2, + ); + + final Marker markerTwo = addedMarker.copyWith(options: markerTwoOptions); + + // Update marker and save response. + final List updatedMarkersList = + await viewController.updateMarkers([markerTwo]); + expect(updatedMarkersList.length, 1); + final Marker? updatedMarker = updatedMarkersList.first; + + // Get updated markers and save them to [getUpdatedMarkerList]. + final List getUpdatedMarkersList = + await viewController.getMarkers(); + expect(getUpdatedMarkersList.length, 1); + final Marker? getUpdatedMarker = getUpdatedMarkersList.first; + + const double tolerance = 0.0000001; + markers = [updatedMarker!, getUpdatedMarker!]; + + /// Test updated marker options against updateMarkers and getMarkers responses. + for (final Marker marker in markers) { + expect(marker.markerId, addedMarker.markerId); + expect(marker.options.alpha, markerTwoOptions.alpha); + expect(marker.options.anchor.u, + closeTo(markerTwoOptions.anchor.u, tolerance)); + expect(marker.options.anchor.v, + closeTo(markerTwoOptions.anchor.v, tolerance)); + expect(marker.options.draggable, markerTwoOptions.draggable); + expect(marker.options.flat, markerTwoOptions.flat); + expect(marker.options.icon, markerTwoOptions.icon); + expect( + marker.options.consumeTapEvents, markerTwoOptions.consumeTapEvents); + expect(marker.options.infoWindow.anchor.u, + closeTo(markerTwoOptions.infoWindow.anchor.u, tolerance)); + expect(marker.options.infoWindow.anchor.v, + closeTo(markerTwoOptions.infoWindow.anchor.v, tolerance)); + expect(marker.options.position, markerTwoOptions.position); + expect(marker.options.rotation, markerTwoOptions.rotation); + expect(marker.options.infoWindow.snippet, + markerTwoOptions.infoWindow.snippet); + expect( + marker.options.infoWindow.title, markerTwoOptions.infoWindow.title); + expect(marker.options.visible, markerTwoOptions.visible); + expect(marker.options.zIndex, markerTwoOptions.zIndex); + } + + // markerThree options. + const MarkerOptions markerThreeOptions = MarkerOptions( + position: + LatLng(latitude: 62.25743381335948, longitude: 25.779330148583174), + infoWindow: InfoWindow( + title: 'Jyväskylä', + snippet: 'markerThree', + ), + ); - /// Set up navigation and test setting the callback functions. - final GoogleNavigationViewController viewController = - await startNavigationWithoutDestination( - $, - onMarkerClicked: onMarkerClicked, - onMarkerDrag: onMarkerDrag, - onMarkerDragEnd: onMarkerDrag, - onMarkerDragStart: onMarkerDrag, - onMarkerInfoWindowClicked: onMarkerInfoWindowAction, - onMarkerInfoWindowClosed: onMarkerInfoWindowAction, - onMarkerInfoWindowLongClicked: onMarkerInfoWindowAction, - ); - - // markerOne options. - const MarkerOptions markerOneOptions = MarkerOptions( - position: - LatLng(latitude: 60.34856639667419, longitude: 25.03459821831162), - infoWindow: InfoWindow( - title: 'Helsinki Office', - snippet: 'markerOne', - ), - ); - - // Add marker and save response to [addedMarkersList]. - final List addedMarkersList = - await viewController.addMarkers([markerOneOptions]); - expect(addedMarkersList.length, 1); - final Marker? addedMarker = addedMarkersList.first; - - // Get markers and save them to [getMarkerList]. - final List getMarkersList = await viewController.getMarkers(); - expect(getMarkersList.length, 1); - final Marker? getMarker = getMarkersList.first; - - List markers = [addedMarker!, getMarker!]; - - /// Test MarkerOptions default values against addedMarker and getMarkers responses. - for (final Marker marker in markers) { - expect(marker.markerId, 'Marker_0'); - expect(marker.options.alpha, 1.0); - expect(marker.options.anchor.u, 0.5); - expect(marker.options.anchor.v, 1.0); - expect(marker.options.draggable, false); - expect(marker.options.flat, false); - expect(marker.options.icon, ImageDescriptor.defaultImage); - expect(marker.options.consumeTapEvents, false); - expect(marker.options.position, markerOneOptions.position); - expect(marker.options.rotation, 0.0); - expect( - marker.options.infoWindow.title, markerOneOptions.infoWindow.title); - expect(marker.options.infoWindow.snippet, - markerOneOptions.infoWindow.snippet); - expect(marker.options.infoWindow.anchor.u, 0.5); - expect(marker.options.infoWindow.anchor.v, 0.0); - expect(marker.options.visible, true); - expect(marker.options.zIndex, 0.0); - } + /// Test addMarkers() adds markers in correct order. + final List removeMarkerList = + await viewController.addMarkers([ + markerThreeOptions, + markerOneOptions, + ]); - /// Create a marker icon. - final ByteData imageBytes = await rootBundle.load('assets/marker1.png'); - final ImageDescriptor customIcon = - await registerBitmapImage(bitmap: imageBytes, imagePixelRatio: 2); - - // markerTwo options. - final MarkerOptions markerTwoOptions = MarkerOptions( - alpha: 0.5, - anchor: const MarkerAnchor(u: 0.1, v: 0.2), - draggable: true, - flat: true, - icon: customIcon, - consumeTapEvents: true, - position: const LatLng( - latitude: 65.01193816057041, longitude: 25.46790635614996), - rotation: 70, - infoWindow: const InfoWindow( - title: 'Oulu Office', - snippet: 'markerTwo', - anchor: MarkerAnchor(u: 0.3, v: 0.4), - ), - visible: false, - zIndex: 2, - ); - - final Marker markerTwo = addedMarker.copyWith(options: markerTwoOptions); - - // Update marker and save response. - final List updatedMarkersList = - await viewController.updateMarkers([markerTwo]); - expect(updatedMarkersList.length, 1); - final Marker? updatedMarker = updatedMarkersList.first; - - // Get updated markers and save them to [getUpdatedMarkerList]. - final List getUpdatedMarkersList = - await viewController.getMarkers(); - expect(getUpdatedMarkersList.length, 1); - final Marker? getUpdatedMarker = getUpdatedMarkersList.first; - - const double tolerance = 0.0000001; - markers = [updatedMarker!, getUpdatedMarker!]; - - /// Test updated marker options against updateMarkers and getMarkers responses. - for (final Marker marker in markers) { - expect(marker.markerId, addedMarker.markerId); - expect(marker.options.alpha, markerTwoOptions.alpha); - expect(marker.options.anchor.u, - closeTo(markerTwoOptions.anchor.u, tolerance)); - expect(marker.options.anchor.v, - closeTo(markerTwoOptions.anchor.v, tolerance)); - expect(marker.options.draggable, markerTwoOptions.draggable); - expect(marker.options.flat, markerTwoOptions.flat); - expect(marker.options.icon, markerTwoOptions.icon); + final List getRemoveMarkerList = + await viewController.getMarkers(); + + expect(removeMarkerList.length, 2); + expect(removeMarkerList.first!.options.infoWindow.title, 'Jyväskylä'); expect( - marker.options.consumeTapEvents, markerTwoOptions.consumeTapEvents); - expect(marker.options.infoWindow.anchor.u, - closeTo(markerTwoOptions.infoWindow.anchor.u, tolerance)); - expect(marker.options.infoWindow.anchor.v, - closeTo(markerTwoOptions.infoWindow.anchor.v, tolerance)); - expect(marker.options.position, markerTwoOptions.position); - expect(marker.options.rotation, markerTwoOptions.rotation); - expect(marker.options.infoWindow.snippet, - markerTwoOptions.infoWindow.snippet); + removeMarkerList.last!.options.infoWindow.title, 'Helsinki Office'); + expect(getRemoveMarkerList.length, 3); expect( - marker.options.infoWindow.title, markerTwoOptions.infoWindow.title); - expect(marker.options.visible, markerTwoOptions.visible); - expect(marker.options.zIndex, markerTwoOptions.zIndex); - } + getRemoveMarkerList.first!.options.infoWindow.title, 'Oulu Office'); + expect(getRemoveMarkerList.last!.options.infoWindow.title, + 'Helsinki Office'); - // markerThree options. - const MarkerOptions markerThreeOptions = MarkerOptions( - position: - LatLng(latitude: 62.25743381335948, longitude: 25.779330148583174), - infoWindow: InfoWindow( - title: 'Jyväskylä', - snippet: 'markerThree', - ), - ); - - /// Test addMarkers() adds markers in correct order. - final List removeMarkerList = - await viewController.addMarkers([ - markerThreeOptions, - markerOneOptions, - ]); - - final List getRemoveMarkerList = await viewController.getMarkers(); - - expect(removeMarkerList.length, 2); - expect(removeMarkerList.first!.options.infoWindow.title, 'Jyväskylä'); - expect(removeMarkerList.last!.options.infoWindow.title, 'Helsinki Office'); - expect(getRemoveMarkerList.length, 3); - expect(getRemoveMarkerList.first!.options.infoWindow.title, 'Oulu Office'); - expect( - getRemoveMarkerList.last!.options.infoWindow.title, 'Helsinki Office'); - - /// Test removeMarkers() removes correct markers. - // Remove the first marker = ouluOffice marker. - final Marker firstMarker = getRemoveMarkerList.first!; - await viewController.removeMarkers([firstMarker]); - List getRemovedMarkerList = await viewController.getMarkers(); - expect(getRemovedMarkerList.length, 2); - expect(getRemovedMarkerList.first!.options.infoWindow.title, 'Jyväskylä'); - expect( - getRemovedMarkerList.last!.options.infoWindow.title, 'Helsinki Office'); - - /// Test that trying to remove or update a marker that doesn't exist - /// throws error. - try { + /// Test removeMarkers() removes correct markers. + // Remove the first marker = ouluOffice marker. + final Marker firstMarker = getRemoveMarkerList.first!; await viewController.removeMarkers([firstMarker]); - fail('Expected removeMarkers() to fail with MarkerNotFoundException.'); - } on MarkerNotFoundException catch (e) { - expect(e, isNotNull); - } - try { - await viewController.updateMarkers([firstMarker]); - fail('Expected updateMarkers() to fail with MarkerNotFoundException.'); - } on MarkerNotFoundException catch (e) { - expect(e, isNotNull); + List getRemovedMarkerList = await viewController.getMarkers(); + expect(getRemovedMarkerList.length, 2); + expect(getRemovedMarkerList.first!.options.infoWindow.title, 'Jyväskylä'); + expect(getRemovedMarkerList.last!.options.infoWindow.title, + 'Helsinki Office'); + + /// Test that trying to remove or update a marker that doesn't exist + /// throws error. + try { + await viewController.removeMarkers([firstMarker]); + fail('Expected removeMarkers() to fail with MarkerNotFoundException.'); + } on MarkerNotFoundException catch (e) { + expect(e, isNotNull); + } + try { + await viewController.updateMarkers([firstMarker]); + fail('Expected updateMarkers() to fail with MarkerNotFoundException.'); + } on MarkerNotFoundException catch (e) { + expect(e, isNotNull); + } + + // Remove Helsinki office marker. + await viewController.removeMarkers([removeMarkerList.last!]); + getRemovedMarkerList = await viewController.getMarkers(); + expect(getRemovedMarkerList.length, 1); + expect(getRemovedMarkerList.first!.options.infoWindow.title, 'Jyväskylä'); + + // Add two markers. + List clearMarkerList = await viewController + .addMarkers([markerOneOptions, markerTwoOptions]); + List getClearMarkerList = await viewController.getMarkers(); + + expect(clearMarkerList.length, 2); + expect( + clearMarkerList.first!.options.infoWindow.title, 'Helsinki Office'); + expect(clearMarkerList.last!.options.infoWindow.title, 'Oulu Office'); + expect(getClearMarkerList.length, 3); + expect(getClearMarkerList.first!.options.infoWindow.title, 'Jyväskylä'); + expect(getClearMarkerList.last!.options.infoWindow.title, 'Oulu Office'); + + /// Remove the middle marker and test the order stays. + await viewController.removeMarkers([getClearMarkerList[1]!]); + + getClearMarkerList = await viewController.getMarkers(); + expect(getClearMarkerList.length, 2); + expect(getClearMarkerList.first!.options.infoWindow.title, 'Jyväskylä'); + expect(getClearMarkerList.last!.options.infoWindow.title, 'Oulu Office'); + + /// Test clearMarkers() function works. + await viewController.clearMarkers(); + + getClearMarkerList = await viewController.getMarkers(); + expect(getClearMarkerList, isEmpty); + + /// Test clear() function clears also markers. + clearMarkerList = await viewController + .addMarkers([markerOneOptions, markerTwoOptions]); + getClearMarkerList = await viewController.getMarkers(); + expect(clearMarkerList.length, 2); + expect(getClearMarkerList.length, 2); + + await viewController.clear(); + getClearMarkerList = await viewController.getMarkers(); + expect(getClearMarkerList, isEmpty); } - - // Remove Helsinki office marker. - await viewController.removeMarkers([removeMarkerList.last!]); - getRemovedMarkerList = await viewController.getMarkers(); - expect(getRemovedMarkerList.length, 1); - expect(getRemovedMarkerList.first!.options.infoWindow.title, 'Jyväskylä'); - - // Add two markers. - List clearMarkerList = await viewController - .addMarkers([markerOneOptions, markerTwoOptions]); - List getClearMarkerList = await viewController.getMarkers(); - - expect(clearMarkerList.length, 2); - expect(clearMarkerList.first!.options.infoWindow.title, 'Helsinki Office'); - expect(clearMarkerList.last!.options.infoWindow.title, 'Oulu Office'); - expect(getClearMarkerList.length, 3); - expect(getClearMarkerList.first!.options.infoWindow.title, 'Jyväskylä'); - expect(getClearMarkerList.last!.options.infoWindow.title, 'Oulu Office'); - - /// Remove the middle marker and test the order stays. - await viewController.removeMarkers([getClearMarkerList[1]!]); - - getClearMarkerList = await viewController.getMarkers(); - expect(getClearMarkerList.length, 2); - expect(getClearMarkerList.first!.options.infoWindow.title, 'Jyväskylä'); - expect(getClearMarkerList.last!.options.infoWindow.title, 'Oulu Office'); - - /// Test clearMarkers() function works. - await viewController.clearMarkers(); - - getClearMarkerList = await viewController.getMarkers(); - expect(getClearMarkerList, isEmpty); - - /// Test clear() function clears also markers. - clearMarkerList = await viewController - .addMarkers([markerOneOptions, markerTwoOptions]); - getClearMarkerList = await viewController.getMarkers(); - expect(clearMarkerList.length, 2); - expect(getClearMarkerList.length, 2); - - await viewController.clear(); - getClearMarkerList = await viewController.getMarkers(); - expect(getClearMarkerList, isEmpty); }); patrol('Test polylines', (PatrolIntegrationTester $) async { - /// The events are not tested because there's currently no reliable way to trigger them. - void onPolylineClicked(String event) { - debugPrint('Polyline clicked event: $event.'); - } - - /// Set up navigation and test setting the callback function. - final GoogleNavigationViewController viewController = - await startNavigationWithoutDestination($, - onPolylineClicked: onPolylineClicked); - - await viewController.addPolylines( - [ - const PolylineOptions( + for (final TestMapType testMapType in testMapTypes) { + /// The events are not tested because there's currently no reliable way to trigger them. + void onPolylineClicked(String event) { + debugPrint('Polyline clicked event: $event.'); + } + + /// Get viewController for the test type (navigation map or regular map). + final GoogleMapViewController viewController = + await getMapViewControllerForTestMapType($, + testMapType: testMapType, onPolylineClicked: onPolylineClicked); + + await viewController.addPolylines( + [ + const PolylineOptions( + points: [ + LatLng(latitude: 60.186492, longitude: 24.929471), + LatLng(latitude: 60.286492, longitude: 25.929471) + ], + clickable: true, + geodesic: true, + strokeColor: Colors.red, + strokeWidth: 5.0, + ), + ], + ); + + /// Test that received polylines match the ones that were added. + final List polylines = await viewController.getPolylines(); + expect(polylines.length, 1); + expect(polylines[0]!.options.points!.first.latitude, + closeTo(60.186492, 0.01)); + expect(polylines[0]!.options.points!.first.longitude, + closeTo(24.929471, 0.01)); + expect( + polylines[0]!.options.points![1].latitude, closeTo(60.286492, 0.01)); + expect( + polylines[0]!.options.points![1].longitude, closeTo(25.929471, 0.01)); + expect(polylines[0]!.options.clickable, true); + expect(polylines[0]!.options.geodesic, true); + expect(polylines[0]!.options.strokeColor!.value, Colors.red.value); + expect(polylines[0]!.options.strokeWidth, 5.0); + + /// iOS doesn't have strokeJointTypes + if (Platform.isIOS) { + expect(polylines[0]!.options.strokeJointType, null); + } else if (Platform.isAndroid) { + expect(polylines[0]!.options.strokeJointType, + StrokeJointType.defaultJoint); + } + expect(polylines[0]!.options.strokePattern, null); + expect(polylines[0]!.options.visible, true); + expect(polylines[0]!.options.zIndex, 0); + expect(polylines[0]!.options.spans, []); + + await viewController.clearPolylines(); + + /// Test updating polylines + await viewController.addPolylines( + [ + const PolylineOptions( + points: [ + LatLng(latitude: 60.186492, longitude: 24.929471), + LatLng(latitude: 60.286492, longitude: 25.929471), + ], + ) + ], + ); + + /// Test that polylines were ceated with default values. + final List receivedPolylines = + await viewController.getPolylines(); + expect(receivedPolylines.length, 1); + expect(receivedPolylines[0]!.options.geodesic, false); + expect(receivedPolylines[0]!.options.clickable, false); + expect( + receivedPolylines[0]!.options.strokeColor!.value, Colors.black.value); + expect(receivedPolylines[0]!.options.strokeWidth, 10.0); + + /// iOS doesn't have strokeJointTypes + if (Platform.isIOS) { + expect(polylines[0]!.options.strokeJointType, null); + } else if (Platform.isAndroid) { + expect(polylines[0]!.options.strokeJointType, + StrokeJointType.defaultJoint); + } + expect(receivedPolylines[0]!.options.strokePattern, null); + expect(receivedPolylines[0]!.options.visible, true); + expect(receivedPolylines[0]!.options.zIndex, 0); + expect(receivedPolylines[0]!.options.spans, []); + + final Polyline updatedPolyline = Polyline( + polylineId: receivedPolylines[0]!.polylineId, + options: const PolylineOptions( points: [ LatLng(latitude: 60.186492, longitude: 24.929471), LatLng(latitude: 60.286492, longitude: 25.929471) ], clickable: true, geodesic: true, - strokeColor: Colors.red, - strokeWidth: 5.0, ), - ], - ); - - /// Test that received polylines match the ones that were added. - final List polylines = await viewController.getPolylines(); - expect(polylines.length, 1); - expect( - polylines[0]!.options.points!.first.latitude, closeTo(60.186492, 0.01)); - expect(polylines[0]!.options.points!.first.longitude, - closeTo(24.929471, 0.01)); - expect(polylines[0]!.options.points![1].latitude, closeTo(60.286492, 0.01)); - expect( - polylines[0]!.options.points![1].longitude, closeTo(25.929471, 0.01)); - expect(polylines[0]!.options.clickable, true); - expect(polylines[0]!.options.geodesic, true); - expect(polylines[0]!.options.strokeColor!.value, Colors.red.value); - expect(polylines[0]!.options.strokeWidth, 5.0); - - /// iOS doesn't have strokeJointTypes - if (Platform.isIOS) { - expect(polylines[0]!.options.strokeJointType, null); - } else if (Platform.isAndroid) { - expect( - polylines[0]!.options.strokeJointType, StrokeJointType.defaultJoint); - } - expect(polylines[0]!.options.strokePattern, null); - expect(polylines[0]!.options.visible, true); - expect(polylines[0]!.options.zIndex, 0); - expect(polylines[0]!.options.spans, []); - - await viewController.clearPolylines(); - - /// Test updating polylines - await viewController.addPolylines( - [ - const PolylineOptions( - points: [ - LatLng(latitude: 60.186492, longitude: 24.929471), - LatLng(latitude: 60.286492, longitude: 25.929471), - ], - ) - ], - ); - - /// Test that polylines were ceated with default values. - final List receivedPolylines = - await viewController.getPolylines(); - expect(receivedPolylines.length, 1); - expect(receivedPolylines[0]!.options.geodesic, false); - expect(receivedPolylines[0]!.options.clickable, false); - expect( - receivedPolylines[0]!.options.strokeColor!.value, Colors.black.value); - expect(receivedPolylines[0]!.options.strokeWidth, 10.0); - - /// iOS doesn't have strokeJointTypes - if (Platform.isIOS) { - expect(polylines[0]!.options.strokeJointType, null); - } else if (Platform.isAndroid) { - expect( - polylines[0]!.options.strokeJointType, StrokeJointType.defaultJoint); - } - expect(receivedPolylines[0]!.options.strokePattern, null); - expect(receivedPolylines[0]!.options.visible, true); - expect(receivedPolylines[0]!.options.zIndex, 0); - expect(receivedPolylines[0]!.options.spans, []); - - final Polyline updatedPolyline = Polyline( - polylineId: receivedPolylines[0]!.polylineId, - options: const PolylineOptions( - points: [ - LatLng(latitude: 60.186492, longitude: 24.929471), - LatLng(latitude: 60.286492, longitude: 25.929471) + ); + + await viewController.updatePolylines([updatedPolyline]); + + final List receivedPolylines2 = + await viewController.getPolylines(); + expect(receivedPolylines2.length, 1); + expect(receivedPolylines2[0]!.options.geodesic, true); + expect(receivedPolylines2[0]!.options.clickable, true); + + await viewController.clearPolylines(); + + /// Test deleting polylines. + await viewController.addPolylines( + [ + const PolylineOptions( + points: [ + LatLng(latitude: 60.186492, longitude: 24.929471), + LatLng(latitude: 60.286492, longitude: 25.929471), + ], + ), + const PolylineOptions( + points: [ + LatLng(latitude: 61.186492, longitude: 22.929471), + LatLng(latitude: 61.286492, longitude: 22.929471), + ], + ) ], - clickable: true, - geodesic: true, - ), - ); + ); - await viewController.updatePolylines([updatedPolyline]); + final List receivedPolylines3 = + await viewController.getPolylines(); + expect(receivedPolylines3.length, 2); - final List receivedPolylines2 = - await viewController.getPolylines(); - expect(receivedPolylines2.length, 1); - expect(receivedPolylines2[0]!.options.geodesic, true); - expect(receivedPolylines2[0]!.options.clickable, true); - - await viewController.clearPolylines(); - - /// Test deleting polylines. - await viewController.addPolylines( - [ - const PolylineOptions( - points: [ - LatLng(latitude: 60.186492, longitude: 24.929471), - LatLng(latitude: 60.286492, longitude: 25.929471), - ], - ), - const PolylineOptions( - points: [ - LatLng(latitude: 61.186492, longitude: 22.929471), - LatLng(latitude: 61.286492, longitude: 22.929471), - ], - ) - ], - ); - - final List receivedPolylines3 = - await viewController.getPolylines(); - expect(receivedPolylines3.length, 2); - - await viewController.removePolylines([receivedPolylines3[0]!]); - - final List receivedPolylines4 = - await viewController.getPolylines(); - expect(receivedPolylines4.length, 1); - - /// Test that right polyline was removed. - expect( - receivedPolylines4[0]!.polylineId, receivedPolylines3[1]!.polylineId); - - /// Test that trying to remove or update a polyline that doesn't exist - /// throws error. - try { await viewController.removePolylines([receivedPolylines3[0]!]); - fail( - 'Expected removePolylines() to fail with PolylineNotFoundException.'); - } on PolylineNotFoundException catch (e) { - expect(e, isNotNull); - } - try { - await viewController.updatePolylines([receivedPolylines3[0]!]); - fail('Expected updatePolylines to fail with PolylineNotFoundException.'); - } on PolylineNotFoundException catch (e) { - expect(e, isNotNull); - } - await viewController.clearPolylines(); + final List receivedPolylines4 = + await viewController.getPolylines(); + expect(receivedPolylines4.length, 1); - /// Test clearning all polylines. - await viewController.addPolylines( - [ - const PolylineOptions( - points: [ - LatLng(latitude: 60.186492, longitude: 24.929471), - LatLng(latitude: 60.286492, longitude: 25.929471), - ], - ), - const PolylineOptions( - points: [ - LatLng(latitude: 61.186492, longitude: 22.929471), - LatLng(latitude: 61.286492, longitude: 22.929471), - ], - ) - ], - ); - - final List receivedPolylines5 = - await viewController.getPolylines(); - expect(receivedPolylines5.length, 2); - - await viewController.clearPolylines(); - - final List receivedPolylines6 = - await viewController.getPolylines(); - expect(receivedPolylines6.length, 0); - - /// Test clearing all polylines with clear(). - await viewController.addPolylines( - [ - const PolylineOptions( - points: [ - LatLng(latitude: 60.186492, longitude: 24.929471), - LatLng(latitude: 60.286492, longitude: 25.929471), - ], - ), - const PolylineOptions( - points: [ - LatLng(latitude: 61.186492, longitude: 22.929471), - LatLng(latitude: 61.286492, longitude: 22.929471), - ], - ) - ], - ); + /// Test that right polyline was removed. + expect( + receivedPolylines4[0]!.polylineId, receivedPolylines3[1]!.polylineId); + + /// Test that trying to remove or update a polyline that doesn't exist + /// throws error. + try { + await viewController + .removePolylines([receivedPolylines3[0]!]); + fail( + 'Expected removePolylines() to fail with PolylineNotFoundException.'); + } on PolylineNotFoundException catch (e) { + expect(e, isNotNull); + } + try { + await viewController + .updatePolylines([receivedPolylines3[0]!]); + fail( + 'Expected updatePolylines to fail with PolylineNotFoundException.'); + } on PolylineNotFoundException catch (e) { + expect(e, isNotNull); + } + + await viewController.clearPolylines(); + + /// Test clearning all polylines. + await viewController.addPolylines( + [ + const PolylineOptions( + points: [ + LatLng(latitude: 60.186492, longitude: 24.929471), + LatLng(latitude: 60.286492, longitude: 25.929471), + ], + ), + const PolylineOptions( + points: [ + LatLng(latitude: 61.186492, longitude: 22.929471), + LatLng(latitude: 61.286492, longitude: 22.929471), + ], + ) + ], + ); + + final List receivedPolylines5 = + await viewController.getPolylines(); + expect(receivedPolylines5.length, 2); + + await viewController.clearPolylines(); + + final List receivedPolylines6 = + await viewController.getPolylines(); + expect(receivedPolylines6.length, 0); + + /// Test clearing all polylines with clear(). + await viewController.addPolylines( + [ + const PolylineOptions( + points: [ + LatLng(latitude: 60.186492, longitude: 24.929471), + LatLng(latitude: 60.286492, longitude: 25.929471), + ], + ), + const PolylineOptions( + points: [ + LatLng(latitude: 61.186492, longitude: 22.929471), + LatLng(latitude: 61.286492, longitude: 22.929471), + ], + ) + ], + ); - final List receivedPolylines7 = - await viewController.getPolylines(); - expect(receivedPolylines7.length, 2); + final List receivedPolylines7 = + await viewController.getPolylines(); + expect(receivedPolylines7.length, 2); - await viewController.clear(); + await viewController.clear(); - final List receivedPolylines8 = - await viewController.getPolylines(); - expect(receivedPolylines8.length, 0); + final List receivedPolylines8 = + await viewController.getPolylines(); + expect(receivedPolylines8.length, 0); + } }); patrol('Polygon tests', (PatrolIntegrationTester $) async { - void onPolygonClicked(String event) { - /// The events are not tested because there's currently no reliable way to trigger them. - debugPrint('Polygon clicked event: $event.'); - } - - /// Set up navigation and test setting up the callback listener. - final GoogleNavigationViewController viewController = - await startNavigationWithoutDestination($, - onPolygonClicked: onPolygonClicked); - - /// Creates square, 4 coordinates, from top left and bottom right coordinates. - List createSquare(LatLng topLeft, LatLng bottomRight) { - return [ - topLeft, - LatLng(latitude: topLeft.latitude, longitude: bottomRight.longitude), - bottomRight, - LatLng(latitude: bottomRight.latitude, longitude: topLeft.longitude) + // This value is used to track the cirlcle offset for circle ids during each iteration for each test map type. + int polygonStartIndex = 0; + for (final TestMapType testMapType in testMapTypes) { + void onPolygonClicked(String event) { + /// The events are not tested because there's currently no reliable way to trigger them. + debugPrint('Polygon clicked event: $event.'); + } + + /// Get viewController for the test type (navigation map or regular map). + final GoogleMapViewController viewController = + await getMapViewControllerForTestMapType($, + testMapType: testMapType, onPolygonClicked: onPolygonClicked); + + /// Creates square, 4 coordinates, from top left and bottom right coordinates. + List createSquare(LatLng topLeft, LatLng bottomRight) { + return [ + topLeft, + LatLng(latitude: topLeft.latitude, longitude: bottomRight.longitude), + bottomRight, + LatLng(latitude: bottomRight.latitude, longitude: topLeft.longitude) + ]; + } + + // Add square polygon on the current camera position. + final CameraPosition position = await viewController.getCameraPosition(); + + // Calculate suitable offset for coordinates from the current zoom level. + final double offset = (30.0 - position.zoom) * 0.04; + + /// Creates list of 2 coordinates, for two opposite corners of the square. + /// Each point is offset away from the center point. + final LatLng topLeft = LatLng( + latitude: position.target.latitude + offset, + longitude: position.target.longitude - offset); + final LatLng bottomRight = LatLng( + latitude: position.target.latitude - offset, + longitude: position.target.longitude + offset); + + final List points = createSquare(topLeft, bottomRight); + + // Get min and max coordinates from the existing polygon. + final double minLatitude = + points.map((LatLng e) => e.latitude).reduce(min); + final double maxLatitude = + points.map((LatLng e) => e.latitude).reduce(max); + final double minLongitude = + points.map((LatLng e) => e.longitude).reduce(min); + final double maxLongitude = + points.map((LatLng e) => e.longitude).reduce(max); + final double width = maxLatitude - minLatitude; + + // Create hole that is 40% of the total rectangle width, + // hole will be 10% of width away from the bottom right corner. + final LatLng holeTopLeft = LatLng( + latitude: minLatitude + (width * 0.1), + longitude: minLongitude + (width * 0.1)); + final LatLng holeBottomRight = LatLng( + latitude: minLatitude + (width * 0.4), + longitude: minLongitude + (width * 0.4)); + final List hole1 = createSquare(holeTopLeft, holeBottomRight); + + // Create hole that is 40% of the total rectangle width, + // hole will be 10% of width away from the top left corner. + final LatLng holeTopLeft2 = LatLng( + latitude: maxLatitude - (width * 0.1), + longitude: maxLongitude - (width * 0.1)); + final LatLng holeBottomRight2 = LatLng( + latitude: maxLatitude - (width * 0.4), + longitude: maxLongitude - (width * 0.4)); + final List hole2 = createSquare(holeTopLeft2, holeBottomRight2); + final List> holes = >[hole1, hole2]; + + final PolygonOptions options = + PolygonOptions(points: points, holes: holes); + final List polygons = + await viewController.addPolygons([options]); + List getPolygons = await viewController.getPolygons(); + + /// There's automatically extra LatLng point added on Android if the + /// last LatLng value of the list doesn't match the first one. + if (Platform.isAndroid) { + getPolygons[0]!.options.points.removeLast(); + getPolygons[0]!.options.holes[0].removeLast(); + getPolygons[0]!.options.holes[1].removeLast(); + } + final List polygonList = [ + polygons[0]!, + getPolygons[0]! ]; - } - - // Add square polygon on the current camera position. - final CameraPosition position = await viewController.getCameraPosition(); - - // Calculate suitable offset for coordinates from the current zoom level. - final double offset = (30.0 - position.zoom) * 0.04; - - /// Creates list of 2 coordinates, for two opposite corners of the square. - /// Each point is offset away from the center point. - final LatLng topLeft = LatLng( - latitude: position.target.latitude + offset, - longitude: position.target.longitude - offset); - final LatLng bottomRight = LatLng( - latitude: position.target.latitude - offset, - longitude: position.target.longitude + offset); - - final List points = createSquare(topLeft, bottomRight); - - // Get min and max coordinates from the existing polygon. - final double minLatitude = points.map((LatLng e) => e.latitude).reduce(min); - final double maxLatitude = points.map((LatLng e) => e.latitude).reduce(max); - final double minLongitude = - points.map((LatLng e) => e.longitude).reduce(min); - final double maxLongitude = - points.map((LatLng e) => e.longitude).reduce(max); - final double width = maxLatitude - minLatitude; - - // Create hole that is 40% of the total rectangle width, - // hole will be 10% of width away from the bottom right corner. - final LatLng holeTopLeft = LatLng( - latitude: minLatitude + (width * 0.1), - longitude: minLongitude + (width * 0.1)); - final LatLng holeBottomRight = LatLng( - latitude: minLatitude + (width * 0.4), - longitude: minLongitude + (width * 0.4)); - final List hole1 = createSquare(holeTopLeft, holeBottomRight); - - // Create hole that is 40% of the total rectangle width, - // hole will be 10% of width away from the top left corner. - final LatLng holeTopLeft2 = LatLng( - latitude: maxLatitude - (width * 0.1), - longitude: maxLongitude - (width * 0.1)); - final LatLng holeBottomRight2 = LatLng( - latitude: maxLatitude - (width * 0.4), - longitude: maxLongitude - (width * 0.4)); - final List hole2 = createSquare(holeTopLeft2, holeBottomRight2); - final List> holes = >[hole1, hole2]; - - final PolygonOptions options = PolygonOptions(points: points, holes: holes); - final List polygons = - await viewController.addPolygons([options]); - List getPolygons = await viewController.getPolygons(); - - /// There's automatically extra LatLng point added on Android if the - /// last LatLng value of the list doesn't match the first one. - if (Platform.isAndroid) { - getPolygons[0]!.options.points.removeLast(); - getPolygons[0]!.options.holes[0].removeLast(); - getPolygons[0]!.options.holes[1].removeLast(); - } - final List polygonList = [polygons[0]!, getPolygons[0]!]; - - /// Test PolygonOptions default values against addPolygons and getPolygons responses. - for (final Polygon polygon in polygonList) { - expect(polygon.polygonId, 'Polygon_0'); - expect(polygon.options.points, options.points); - expect(polygon.options.holes, options.holes); - - // Default values. - expect(polygon.options.clickable, false); - expect(polygon.options.fillColor, Colors.black); - expect(polygon.options.geodesic, false); - expect(polygon.options.strokeColor, Colors.black); - expect(polygon.options.strokeWidth, 10); - expect(polygon.options.visible, true); - expect(polygon.options.zIndex, 0); - } - final LatLng updatedTopLeft = LatLng( - latitude: topLeft.latitude + 1, longitude: topLeft.longitude + 1); - final LatLng updatedBottomRight = LatLng( - latitude: bottomRight.latitude + 1, - longitude: bottomRight.longitude + 1); - final LatLng updatedHoleTopLeft = LatLng( - latitude: holeTopLeft.latitude + 1, - longitude: holeTopLeft.longitude + 1); - final LatLng updatedHoleBottomRight = LatLng( - latitude: holeBottomRight.latitude + 1, - longitude: holeBottomRight.longitude + 1); - final LatLng updatedHoleTopLeft2 = LatLng( - latitude: holeTopLeft.latitude + 1, - longitude: holeTopLeft.longitude + 1); - final LatLng updatedHoleBottomRight2 = LatLng( - latitude: holeBottomRight2.latitude + 1, - longitude: holeBottomRight2.longitude + 1); - - final List updatedPoints = - createSquare(updatedTopLeft, updatedBottomRight); - final List updatedHole = - createSquare(updatedHoleTopLeft, updatedHoleBottomRight); - final List updatedHole2 = - createSquare(updatedHoleTopLeft2, updatedHoleBottomRight2); - final List> updatedHoles = >[ - updatedHole, - updatedHole2 - ]; - - /// New polygon options with non-default values. - final PolygonOptions updatedOptions = PolygonOptions( - points: updatedPoints, - holes: updatedHoles, - clickable: true, - fillColor: Colors.white, - geodesic: true, - strokeColor: Colors.white, - strokeWidth: 15, - visible: false, - zIndex: 1, - ); - - final Polygon updatedPolygon = - polygons.first!.copyWith(options: updatedOptions); - - /// Update polygons with new options and check polygon is updated - /// and not duplicated. - final List updatedPolygons = - await viewController.updatePolygons([updatedPolygon]); - expect(updatedPolygons.length, 1); - - /// Get updated polygons. - getPolygons = await viewController.getPolygons(); - expect(getPolygons.length, 1); - - /// There's automatically extra LatLng point added on Android if the - /// last LatLng value of the list doesn't match the first one. - if (Platform.isAndroid) { - getPolygons[0]!.options.points.removeLast(); - getPolygons[0]!.options.holes[0].removeLast(); - getPolygons[0]!.options.holes[1].removeLast(); - } + /// Test PolygonOptions default values against addPolygons and getPolygons responses. + for (final Polygon polygon in polygonList) { + expect(polygon.polygonId, 'Polygon_$polygonStartIndex'); + expect(polygon.options.points, options.points); + expect(polygon.options.holes, options.holes); + + // Default values. + expect(polygon.options.clickable, false); + expect(polygon.options.fillColor, Colors.black); + expect(polygon.options.geodesic, false); + expect(polygon.options.strokeColor, Colors.black); + expect(polygon.options.strokeWidth, 10); + expect(polygon.options.visible, true); + expect(polygon.options.zIndex, 0); + } + + final LatLng updatedTopLeft = LatLng( + latitude: topLeft.latitude + 1, longitude: topLeft.longitude + 1); + final LatLng updatedBottomRight = LatLng( + latitude: bottomRight.latitude + 1, + longitude: bottomRight.longitude + 1); + final LatLng updatedHoleTopLeft = LatLng( + latitude: holeTopLeft.latitude + 1, + longitude: holeTopLeft.longitude + 1); + final LatLng updatedHoleBottomRight = LatLng( + latitude: holeBottomRight.latitude + 1, + longitude: holeBottomRight.longitude + 1); + final LatLng updatedHoleTopLeft2 = LatLng( + latitude: holeTopLeft.latitude + 1, + longitude: holeTopLeft.longitude + 1); + final LatLng updatedHoleBottomRight2 = LatLng( + latitude: holeBottomRight2.latitude + 1, + longitude: holeBottomRight2.longitude + 1); + + final List updatedPoints = + createSquare(updatedTopLeft, updatedBottomRight); + final List updatedHole = + createSquare(updatedHoleTopLeft, updatedHoleBottomRight); + final List updatedHole2 = + createSquare(updatedHoleTopLeft2, updatedHoleBottomRight2); + final List> updatedHoles = >[ + updatedHole, + updatedHole2 + ]; - final List updatedPolygonList = [ - updatedPolygons[0]!, - getPolygons[0]! - ]; - - /// Test PolygonOptions updated values against updatePolygons and getPolygons responses. - for (final Polygon updatedPolygon in updatedPolygonList) { - expect(updatedPolygon.polygonId, 'Polygon_0'); - expect(updatedPolygon.options.points, updatedOptions.points); - expect(updatedPolygon.options.holes, updatedOptions.holes); - expect(updatedPolygon.options.clickable, updatedOptions.clickable); - expect(updatedPolygon.options.fillColor, updatedOptions.fillColor); - expect(updatedPolygon.options.geodesic, updatedOptions.geodesic); - expect(updatedPolygon.options.strokeColor, updatedOptions.strokeColor); - expect(updatedPolygon.options.strokeWidth, updatedOptions.strokeWidth); - expect(updatedPolygon.options.visible, updatedOptions.visible); - expect(updatedPolygon.options.zIndex, updatedOptions.zIndex); - } + /// New polygon options with non-default values. + final PolygonOptions updatedOptions = PolygonOptions( + points: updatedPoints, + holes: updatedHoles, + clickable: true, + fillColor: Colors.white, + geodesic: true, + strokeColor: Colors.white, + strokeWidth: 15, + visible: false, + zIndex: 1, + ); + + final Polygon updatedPolygon = + polygons.first!.copyWith(options: updatedOptions); + + /// Update polygons with new options and check polygon is updated + /// and not duplicated. + final List updatedPolygons = + await viewController.updatePolygons([updatedPolygon]); + expect(updatedPolygons.length, 1); + + /// Get updated polygons. + getPolygons = await viewController.getPolygons(); + expect(getPolygons.length, 1); + + /// There's automatically extra LatLng point added on Android if the + /// last LatLng value of the list doesn't match the first one. + if (Platform.isAndroid) { + getPolygons[0]!.options.points.removeLast(); + getPolygons[0]!.options.holes[0].removeLast(); + getPolygons[0]!.options.holes[1].removeLast(); + } + + final List updatedPolygonList = [ + updatedPolygons[0]!, + getPolygons[0]! + ]; - /// Add a second polygon with the updated options and test order - /// and custom options. - final List polygons2 = - await viewController.addPolygons([updatedOptions]); - expect(polygons2.length, 1); - expect(polygons2[0]!.polygonId, 'Polygon_1'); - - getPolygons = await viewController.getPolygons(); - expect(getPolygons.length, 2); - expect(getPolygons[0]!.polygonId, 'Polygon_0'); - expect(getPolygons[1]!.polygonId, 'Polygon_1'); - - final List polygonList2 = [ - polygons2[0]!, - getPolygons[1]!, - ]; - - for (final Polygon polygon in polygonList2) { - expect(polygon.options.clickable, updatedOptions.clickable); - expect(polygon.options.fillColor, updatedOptions.fillColor); - expect(polygon.options.geodesic, updatedOptions.geodesic); - expect(polygon.options.strokeColor, updatedOptions.strokeColor); - expect(polygon.options.strokeWidth, updatedOptions.strokeWidth); - expect(polygon.options.visible, updatedOptions.visible); - expect(polygon.options.zIndex, updatedOptions.zIndex); - } + /// Test PolygonOptions updated values against updatePolygons and getPolygons responses. + for (final Polygon updatedPolygon in updatedPolygonList) { + expect(updatedPolygon.polygonId, 'Polygon_$polygonStartIndex'); + expect(updatedPolygon.options.points, updatedOptions.points); + expect(updatedPolygon.options.holes, updatedOptions.holes); + expect(updatedPolygon.options.clickable, updatedOptions.clickable); + expect(updatedPolygon.options.fillColor, updatedOptions.fillColor); + expect(updatedPolygon.options.geodesic, updatedOptions.geodesic); + expect(updatedPolygon.options.strokeColor, updatedOptions.strokeColor); + expect(updatedPolygon.options.strokeWidth, updatedOptions.strokeWidth); + expect(updatedPolygon.options.visible, updatedOptions.visible); + expect(updatedPolygon.options.zIndex, updatedOptions.zIndex); + } + + /// Add a second polygon with the updated options and test order + /// and custom options. + final List polygons2 = + await viewController.addPolygons([updatedOptions]); + expect(polygons2.length, 1); + expect(polygons2[0]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); + + getPolygons = await viewController.getPolygons(); + expect(getPolygons.length, 2); + expect(getPolygons[0]!.polygonId, 'Polygon_$polygonStartIndex'); + expect(getPolygons[1]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); + + final List polygonList2 = [ + polygons2[0]!, + getPolygons[1]!, + ]; - /// Add third polygon with original options. - final List polygons3 = - await viewController.addPolygons([options]); - expect(polygons3.length, 1); - expect(polygons3[0]!.polygonId, 'Polygon_2'); - - getPolygons = await viewController.getPolygons(); - expect(getPolygons.length, 3); - expect(getPolygons[0]!.polygonId, 'Polygon_0'); - expect(getPolygons[1]!.polygonId, 'Polygon_1'); - expect(getPolygons[2]!.polygonId, 'Polygon_2'); - - /// Test removing the first polygon. - await viewController.removePolygons([getPolygons.first!]); - - getPolygons = await viewController.getPolygons(); - expect(getPolygons.length, 2); - expect(getPolygons[0]!.polygonId, 'Polygon_1'); - expect(getPolygons[1]!.polygonId, 'Polygon_2'); - - /// Test removing the last polygon. - await viewController.removePolygons([getPolygons.last!]); - - getPolygons = await viewController.getPolygons(); - expect(getPolygons.length, 1); - expect(getPolygons[0]!.polygonId, 'Polygon_1'); - - /// Add multiple polygons to test clearPolygons(). - final List polygons4 = await viewController - .addPolygons([updatedOptions, options, options]); - - expect(polygons4.length, 3); - expect(polygons4[0]!.polygonId, 'Polygon_3'); - expect(polygons4[1]!.polygonId, 'Polygon_4'); - expect(polygons4[2]!.polygonId, 'Polygon_5'); - - getPolygons = await viewController.getPolygons(); - expect(getPolygons.length, 4); - expect(getPolygons[0]!.polygonId, 'Polygon_1'); - expect(getPolygons[1]!.polygonId, 'Polygon_3'); - expect(getPolygons[2]!.polygonId, 'Polygon_4'); - expect(getPolygons[3]!.polygonId, 'Polygon_5'); - - /// Test clearPolygons(). - await viewController.clearPolygons(); - getPolygons = await viewController.getPolygons(); - expect(getPolygons, isEmpty); - - /// Add polygons to test clear(). - final List polygons5 = - await viewController.addPolygons([ - updatedOptions, - options, - options, - updatedOptions, - options, - ]); - - expect(polygons5.length, 5); - - getPolygons = await viewController.getPolygons(); - expect(getPolygons.length, 5); - - /// Test that trying to remove or update a polyline that doesn't exist - /// throws error. - try { - await viewController.removePolygons([updatedPolygon]); - fail('Expected removePolylines() to fail with PolygonNotFoundException.'); - } on PolygonNotFoundException catch (e) { - expect(e, isNotNull); - } - try { - await viewController.updatePolygons([updatedPolygon]); - fail('Expected updatePolylines() to fail with PolygonNotFoundException'); - } on PolygonNotFoundException catch (e) { - expect(e, isNotNull); + for (final Polygon polygon in polygonList2) { + expect(polygon.options.clickable, updatedOptions.clickable); + expect(polygon.options.fillColor, updatedOptions.fillColor); + expect(polygon.options.geodesic, updatedOptions.geodesic); + expect(polygon.options.strokeColor, updatedOptions.strokeColor); + expect(polygon.options.strokeWidth, updatedOptions.strokeWidth); + expect(polygon.options.visible, updatedOptions.visible); + expect(polygon.options.zIndex, updatedOptions.zIndex); + } + + /// Add third polygon with original options. + final List polygons3 = + await viewController.addPolygons([options]); + expect(polygons3.length, 1); + expect(polygons3[0]!.polygonId, 'Polygon_${polygonStartIndex + 2}'); + + getPolygons = await viewController.getPolygons(); + expect(getPolygons.length, 3); + expect(getPolygons[0]!.polygonId, 'Polygon_$polygonStartIndex'); + expect(getPolygons[1]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); + expect(getPolygons[2]!.polygonId, 'Polygon_${polygonStartIndex + 2}'); + + /// Test removing the first polygon. + await viewController.removePolygons([getPolygons.first!]); + + getPolygons = await viewController.getPolygons(); + expect(getPolygons.length, 2); + expect(getPolygons[0]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); + expect(getPolygons[1]!.polygonId, 'Polygon_${polygonStartIndex + 2}'); + + /// Test removing the last polygon. + await viewController.removePolygons([getPolygons.last!]); + + getPolygons = await viewController.getPolygons(); + expect(getPolygons.length, 1); + expect(getPolygons[0]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); + + /// Add multiple polygons to test clearPolygons(). + final List polygons4 = await viewController + .addPolygons([updatedOptions, options, options]); + + expect(polygons4.length, 3); + expect(polygons4[0]!.polygonId, 'Polygon_${polygonStartIndex + 3}'); + expect(polygons4[1]!.polygonId, 'Polygon_${polygonStartIndex + 4}'); + expect(polygons4[2]!.polygonId, 'Polygon_${polygonStartIndex + 5}'); + + getPolygons = await viewController.getPolygons(); + expect(getPolygons.length, 4); + expect(getPolygons[0]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); + expect(getPolygons[1]!.polygonId, 'Polygon_${polygonStartIndex + 3}'); + expect(getPolygons[2]!.polygonId, 'Polygon_${polygonStartIndex + 4}'); + expect(getPolygons[3]!.polygonId, 'Polygon_${polygonStartIndex + 5}'); + + /// Test clearPolygons(). + await viewController.clearPolygons(); + getPolygons = await viewController.getPolygons(); + expect(getPolygons, isEmpty); + + /// Add polygons to test clear(). + final List polygons5 = + await viewController.addPolygons([ + updatedOptions, + options, + options, + updatedOptions, + options, + ]); + + expect(polygons5.length, 5); + + getPolygons = await viewController.getPolygons(); + expect(getPolygons.length, 5); + + /// Test that trying to remove or update a polyline that doesn't exist + /// throws error. + try { + await viewController.removePolygons([updatedPolygon]); + fail( + 'Expected removePolylines() to fail with PolygonNotFoundException.'); + } on PolygonNotFoundException catch (e) { + expect(e, isNotNull); + } + try { + await viewController.updatePolygons([updatedPolygon]); + fail( + 'Expected updatePolylines() to fail with PolygonNotFoundException'); + } on PolygonNotFoundException catch (e) { + expect(e, isNotNull); + } + + /// Test clear() removes all polygons. + await viewController.clear(); + + getPolygons = await viewController.getPolygons(); + expect(getPolygons, isEmpty); + polygonStartIndex += 11; } - - /// Test clear() removes all polygons. - await viewController.clear(); - - getPolygons = await viewController.getPolygons(); - expect(getPolygons, isEmpty); }); patrol('Circle tests', (PatrolIntegrationTester $) async { - void onCircleClicked(String event) { - /// The events are not tested because there's currently no reliable way to trigger them. - debugPrint('Circle clicked event: $event.'); - } - - /// Set up navigation and test setting up the callback functions. - final GoogleNavigationViewController viewController = - await startNavigationWithoutDestination($, - onCircleClicked: onCircleClicked); - - // Add circle on the current camera position. - final CameraPosition position = await viewController.getCameraPosition(); - - final CircleOptions options = - CircleOptions(position: position.target, radius: 5000); - final List circles = - await viewController.addCircles([options]); - List getCircles = await viewController.getCircles(); - - final List circleList = [circles[0]!, getCircles[0]!]; - - /// Test CircleOptions default values against addCircles and getCircles responses. - for (final Circle circle in circleList) { - expect(circle.circleId, 'Circle_0'); - expect(circle.options.position, options.position); - expect(circle.options.radius, options.radius); - - // Default values. - expect(circle.options.clickable, false); - expect(circle.options.fillColor, Colors.black); - expect(circle.options.strokeColor, Colors.black); - expect(circle.options.strokeWidth, 10); - expect(circle.options.strokePattern, circle.options.strokePattern); - expect(circle.options.visible, true); - expect(circle.options.zIndex, 0); - } - - final LatLng updatedPosition = LatLng( - latitude: position.target.latitude + 1, - longitude: position.target.longitude + 1); - - /// New circle options with non-default values. - final CircleOptions updatedOptions = CircleOptions( - position: updatedPosition, - radius: 50000, - clickable: true, - fillColor: Colors.white, - strokeColor: Colors.white, - strokeWidth: 15, - visible: false, - zIndex: 1, - ); - - final Circle updatedCircle = - circles.first!.copyWith(options: updatedOptions); - - /// Update circles with new options and check circle is updated - /// and not duplicated. - final List updatedCircles = - await viewController.updateCircles([updatedCircle]); - expect(updatedCircles.length, 1); - - /// Get updated circles. - getCircles = await viewController.getCircles(); - expect(getCircles.length, 1); - - final List updatedCircleList = [ - updatedCircles[0]!, - getCircles[0]! - ]; - - /// Test CircleOptions updated values against updateCircles and getCircles responses. - for (final Circle updatedCircle in updatedCircleList) { - expect(updatedCircle.circleId, 'Circle_0'); - expect(updatedCircle.options.position, updatedOptions.position); - expect(updatedCircle.options.radius, updatedOptions.radius); - expect(updatedCircle.options.clickable, updatedOptions.clickable); - expect(updatedCircle.options.fillColor, updatedOptions.fillColor); - expect(updatedCircle.options.strokeColor, updatedOptions.strokeColor); - expect(updatedCircle.options.strokeWidth, updatedOptions.strokeWidth); - expect(updatedCircle.options.strokePattern, updatedOptions.strokePattern); - expect(updatedCircle.options.visible, updatedOptions.visible); - expect(updatedCircle.options.zIndex, updatedOptions.zIndex); - } + // This value is used to track the cirlcle offset for circle ids during each iteration for each test map type. + int circleStartIndex = 0; + for (final TestMapType testMapType in testMapTypes) { + void onCircleClicked(String event) { + /// The events are not tested because there's currently no reliable way to trigger them. + debugPrint('Circle clicked event: $event.'); + } + + /// Get viewController for the test type (navigation map or regular map). + final GoogleMapViewController viewController = + await getMapViewControllerForTestMapType($, + testMapType: testMapType, onCircleClicked: onCircleClicked); + + // Add circle on the current camera position. + final CameraPosition position = await viewController.getCameraPosition(); + + final CircleOptions options = + CircleOptions(position: position.target, radius: 5000); + final List circles = + await viewController.addCircles([options]); + List getCircles = await viewController.getCircles(); + + final List circleList = [circles[0]!, getCircles[0]!]; + + /// Test CircleOptions default values against addCircles and getCircles responses. + for (final Circle circle in circleList) { + expect(circle.circleId, 'Circle_$circleStartIndex'); + expect(circle.options.position, options.position); + expect(circle.options.radius, options.radius); + + // Default values. + expect(circle.options.clickable, false); + expect(circle.options.fillColor, Colors.black); + expect(circle.options.strokeColor, Colors.black); + expect(circle.options.strokeWidth, 10); + expect(circle.options.strokePattern, circle.options.strokePattern); + expect(circle.options.visible, true); + expect(circle.options.zIndex, 0); + } + + final LatLng updatedPosition = LatLng( + latitude: position.target.latitude + 1, + longitude: position.target.longitude + 1); + + /// New circle options with non-default values. + final CircleOptions updatedOptions = CircleOptions( + position: updatedPosition, + radius: 50000, + clickable: true, + fillColor: Colors.white, + strokeColor: Colors.white, + strokeWidth: 15, + visible: false, + zIndex: 1, + ); + + final Circle updatedCircle = + circles.first!.copyWith(options: updatedOptions); + + /// Update circles with new options and check circle is updated + /// and not duplicated. + final List updatedCircles = + await viewController.updateCircles([updatedCircle]); + expect(updatedCircles.length, 1); + + /// Get updated circles. + getCircles = await viewController.getCircles(); + expect(getCircles.length, 1); + + final List updatedCircleList = [ + updatedCircles[0]!, + getCircles[0]! + ]; - /// Add a second circle with the updated options and test order - /// and custom options. - final List circles2 = - await viewController.addCircles([updatedOptions]); - expect(circles2.length, 1); - expect(circles2[0]!.circleId, 'Circle_1'); - - getCircles = await viewController.getCircles(); - expect(getCircles.length, 2); - expect(getCircles[0]!.circleId, 'Circle_0'); - expect(getCircles[1]!.circleId, 'Circle_1'); - - final List circleList2 = [ - circles2[0]!, - getCircles[1]!, - ]; - - for (final Circle circle in circleList2) { - expect(circle.options.position, updatedOptions.position); - expect(circle.options.radius, updatedOptions.radius); - expect(circle.options.clickable, updatedOptions.clickable); - expect(circle.options.fillColor, updatedOptions.fillColor); - expect(circle.options.strokePattern, updatedOptions.strokePattern); - expect(circle.options.strokeColor, updatedOptions.strokeColor); - expect(circle.options.strokeWidth, updatedOptions.strokeWidth); - expect(circle.options.visible, updatedOptions.visible); - expect(circle.options.zIndex, updatedOptions.zIndex); - } + /// Test CircleOptions updated values against updateCircles and getCircles responses. + for (final Circle updatedCircle in updatedCircleList) { + expect(updatedCircle.circleId, 'Circle_$circleStartIndex'); + expect(updatedCircle.options.position, updatedOptions.position); + expect(updatedCircle.options.radius, updatedOptions.radius); + expect(updatedCircle.options.clickable, updatedOptions.clickable); + expect(updatedCircle.options.fillColor, updatedOptions.fillColor); + expect(updatedCircle.options.strokeColor, updatedOptions.strokeColor); + expect(updatedCircle.options.strokeWidth, updatedOptions.strokeWidth); + expect( + updatedCircle.options.strokePattern, updatedOptions.strokePattern); + expect(updatedCircle.options.visible, updatedOptions.visible); + expect(updatedCircle.options.zIndex, updatedOptions.zIndex); + } + + /// Add a second circle with the updated options and test order + /// and custom options. + final List circles2 = + await viewController.addCircles([updatedOptions]); + expect(circles2.length, 1); + expect(circles2[0]!.circleId, 'Circle_${circleStartIndex + 1}'); + + getCircles = await viewController.getCircles(); + expect(getCircles.length, 2); + expect(getCircles[0]!.circleId, 'Circle_$circleStartIndex'); + expect(getCircles[1]!.circleId, 'Circle_${circleStartIndex + 1}'); + + final List circleList2 = [ + circles2[0]!, + getCircles[1]!, + ]; - /// Add third circle with original options. - final List circles3 = - await viewController.addCircles([options]); - expect(circles3.length, 1); - expect(circles3[0]!.circleId, 'Circle_2'); - - getCircles = await viewController.getCircles(); - expect(getCircles.length, 3); - expect(getCircles[0]!.circleId, 'Circle_0'); - expect(getCircles[1]!.circleId, 'Circle_1'); - expect(getCircles[2]!.circleId, 'Circle_2'); - - /// Test removing the first circle. - await viewController.removeCircles([getCircles.first!]); - - getCircles = await viewController.getCircles(); - expect(getCircles.length, 2); - expect(getCircles[0]!.circleId, 'Circle_1'); - expect(getCircles[1]!.circleId, 'Circle_2'); - - /// Test removing the last circle. - await viewController.removeCircles([getCircles.last!]); - - getCircles = await viewController.getCircles(); - expect(getCircles.length, 1); - expect(getCircles[0]!.circleId, 'Circle_1'); - - /// Add multiple circles to test clearCircles(). - final List circles4 = await viewController - .addCircles([updatedOptions, options, options]); - - expect(circles4.length, 3); - expect(circles4[0]!.circleId, 'Circle_3'); - expect(circles4[1]!.circleId, 'Circle_4'); - expect(circles4[2]!.circleId, 'Circle_5'); - - getCircles = await viewController.getCircles(); - expect(getCircles.length, 4); - expect(getCircles[0]!.circleId, 'Circle_1'); - expect(getCircles[1]!.circleId, 'Circle_3'); - expect(getCircles[2]!.circleId, 'Circle_4'); - expect(getCircles[3]!.circleId, 'Circle_5'); - - /// Test clearCircles(). - await viewController.clearCircles(); - getCircles = await viewController.getCircles(); - expect(getCircles, isEmpty); - - /// Add circles to test clear(). - final List circles5 = - await viewController.addCircles([ - updatedOptions, - options, - options, - updatedOptions, - options, - ]); - - expect(circles5.length, 5); - - getCircles = await viewController.getCircles(); - expect(getCircles.length, 5); - - /// Test clear() removes all circles. - await viewController.clear(); - - getCircles = await viewController.getCircles(); - expect(getCircles, isEmpty); - - /// Test CircleNotFoundException error on removeCircles(). - try { - await viewController.removeCircles([updatedCircle]); - fail('Expected PlatformException'); - } on CircleNotFoundException catch (e) { - expect(e, isNotNull); + for (final Circle circle in circleList2) { + expect(circle.options.position, updatedOptions.position); + expect(circle.options.radius, updatedOptions.radius); + expect(circle.options.clickable, updatedOptions.clickable); + expect(circle.options.fillColor, updatedOptions.fillColor); + expect(circle.options.strokePattern, updatedOptions.strokePattern); + expect(circle.options.strokeColor, updatedOptions.strokeColor); + expect(circle.options.strokeWidth, updatedOptions.strokeWidth); + expect(circle.options.visible, updatedOptions.visible); + expect(circle.options.zIndex, updatedOptions.zIndex); + } + + /// Add third circle with original options. + final List circles3 = + await viewController.addCircles([options]); + expect(circles3.length, 1); + expect(circles3[0]!.circleId, 'Circle_${circleStartIndex + 2}'); + + getCircles = await viewController.getCircles(); + expect(getCircles.length, 3); + expect(getCircles[0]!.circleId, 'Circle_$circleStartIndex'); + expect(getCircles[1]!.circleId, 'Circle_${circleStartIndex + 1}'); + expect(getCircles[2]!.circleId, 'Circle_${circleStartIndex + 2}'); + + /// Test removing the first circle. + await viewController.removeCircles([getCircles.first!]); + + getCircles = await viewController.getCircles(); + expect(getCircles.length, 2); + expect(getCircles[0]!.circleId, 'Circle_${circleStartIndex + 1}'); + expect(getCircles[1]!.circleId, 'Circle_${circleStartIndex + 2}'); + + /// Test removing the last circle. + await viewController.removeCircles([getCircles.last!]); + + getCircles = await viewController.getCircles(); + expect(getCircles.length, 1); + expect(getCircles[0]!.circleId, 'Circle_${circleStartIndex + 1}'); + + /// Add multiple circles to test clearCircles(). + final List circles4 = await viewController + .addCircles([updatedOptions, options, options]); + + expect(circles4.length, 3); + expect(circles4[0]!.circleId, 'Circle_${circleStartIndex + 3}'); + expect(circles4[1]!.circleId, 'Circle_${circleStartIndex + 4}'); + expect(circles4[2]!.circleId, 'Circle_${circleStartIndex + 5}'); + + getCircles = await viewController.getCircles(); + expect(getCircles.length, 4); + expect(getCircles[0]!.circleId, 'Circle_${circleStartIndex + 1}'); + expect(getCircles[1]!.circleId, 'Circle_${circleStartIndex + 3}'); + expect(getCircles[2]!.circleId, 'Circle_${circleStartIndex + 4}'); + expect(getCircles[3]!.circleId, 'Circle_${circleStartIndex + 5}'); + + /// Test clearCircles(). + await viewController.clearCircles(); + getCircles = await viewController.getCircles(); + expect(getCircles, isEmpty); + + /// Add circles to test clear(). + final List circles5 = + await viewController.addCircles([ + updatedOptions, + options, + options, + updatedOptions, + options, + ]); + + expect(circles5.length, 5); + + getCircles = await viewController.getCircles(); + expect(getCircles.length, 5); + + /// Test clear() removes all circles. + await viewController.clear(); + + getCircles = await viewController.getCircles(); + expect(getCircles, isEmpty); + + /// Test CircleNotFoundException error on removeCircles(). + try { + await viewController.removeCircles([updatedCircle]); + fail('Expected PlatformException'); + } on CircleNotFoundException catch (e) { + expect(e, isNotNull); + } + circleStartIndex += 11; } }); } From bc7af6ba81d211a56b0e2eb116d30675aa6f3837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Tue, 29 Oct 2024 15:43:29 +0800 Subject: [PATCH 16/18] refactor: refactor tests and view handling --- example/integration_test/shared.dart | 4 +- .../t01_initialization_test.dart | 77 +++++++++++++++++++ .../integration_test/t02_session_test.dart | 16 +++- lib/src/google_maps_map_view_controller.dart | 2 +- .../google_navigation_flutter_android.dart | 5 +- lib/src/google_navigation_flutter_ios.dart | 5 +- ...navigation_flutter_platform_interface.dart | 4 +- lib/src/method_channel/common_view_api.dart | 2 +- 8 files changed, 98 insertions(+), 17 deletions(-) diff --git a/example/integration_test/shared.dart b/example/integration_test/shared.dart index c6648c4..04800c9 100644 --- a/example/integration_test/shared.dart +++ b/example/integration_test/shared.dart @@ -131,8 +131,10 @@ Future checkTermsAndConditionsAcceptance( await $.pumpAndSettle(); // Tap accept or cancel. - if (Platform.isAndroid || Platform.isIOS) { + if (Platform.isAndroid) { await $.native.tap(Selector(text: "Got It")); + } else if (Platform.isIOS) { + await $.native.tap(Selector(text: "OK")); } else { fail('Unsupported platform: ${Platform.operatingSystem}'); } diff --git a/example/integration_test/t01_initialization_test.dart b/example/integration_test/t01_initialization_test.dart index a731ebe..29a1503 100644 --- a/example/integration_test/t01_initialization_test.dart +++ b/example/integration_test/t01_initialization_test.dart @@ -265,4 +265,81 @@ void main() { expect(await controller.getMaxZoomPreference(), maxZoomPreference); expect(await controller.isNavigationUIEnabled(), true); }); + + patrol('C03 - Test Maps initialization without navigation', + (PatrolIntegrationTester $) async { + final Completer viewControllerCompleter = + Completer(); + + const CameraPosition cameraPosition = + CameraPosition(target: LatLng(latitude: 65, longitude: 25.5), zoom: 12); + const MapType mapType = MapType.satellite; + const bool compassEnabled = false; + const bool rotateGesturesEnabled = false; + const bool scrollGesturesEnabled = false; + const bool tiltGesturesEnabled = false; + const bool zoomGesturesEnabled = false; + const bool scrollGesturesEnabledDuringRotateOrZoom = false; + const bool mapToolbarEnabled = false; + const bool zoomControlsEnabled = false; + const double minZoomPreference = 5.0; + const double maxZoomPreference = 18.0; + + /// Display navigation view. + final Key key = GlobalKey(); + await pumpMapView( + $, + GoogleMapsMapView( + key: key, + onViewCreated: (GoogleMapViewController controller) { + controller.setMyLocationEnabled(true); + viewControllerCompleter.complete(controller); + }, + initialCameraPosition: cameraPosition, + initialMapType: mapType, + initialCompassEnabled: compassEnabled, + initialRotateGesturesEnabled: rotateGesturesEnabled, + initialScrollGesturesEnabled: scrollGesturesEnabled, + initialTiltGesturesEnabled: tiltGesturesEnabled, + initialZoomGesturesEnabled: zoomGesturesEnabled, + initialScrollGesturesEnabledDuringRotateOrZoom: + scrollGesturesEnabledDuringRotateOrZoom, + initialMapToolbarEnabled: mapToolbarEnabled, + initialZoomControlsEnabled: zoomControlsEnabled, + initialMinZoomPreference: minZoomPreference, + initialMaxZoomPreference: maxZoomPreference, + ), + ); + + final GoogleMapViewController controller = + await viewControllerCompleter.future; + final CameraPosition cameraOut = await controller.getCameraPosition(); + + expect(cameraOut.target.latitude, + closeTo(cameraPosition.target.latitude, 0.1)); + expect(cameraOut.target.longitude, + closeTo(cameraPosition.target.longitude, 0.1)); + expect(cameraOut.zoom, closeTo(cameraPosition.zoom, 0.1)); + expect(await controller.getMapType(), mapType); + expect(await controller.settings.isCompassEnabled(), compassEnabled); + expect(await controller.settings.isRotateGesturesEnabled(), + rotateGesturesEnabled); + expect(await controller.settings.isScrollGesturesEnabled(), + scrollGesturesEnabled); + expect( + await controller.settings.isTiltGesturesEnabled(), tiltGesturesEnabled); + expect( + await controller.settings.isZoomGesturesEnabled(), zoomGesturesEnabled); + expect( + await controller.settings.isScrollGesturesEnabledDuringRotateOrZoom(), + scrollGesturesEnabledDuringRotateOrZoom); + if (Platform.isAndroid) { + expect( + await controller.settings.isMapToolbarEnabled(), mapToolbarEnabled); + expect(await controller.settings.isZoomControlsEnabled(), + zoomControlsEnabled); + } + expect(await controller.getMinZoomPreference(), minZoomPreference); + expect(await controller.getMaxZoomPreference(), maxZoomPreference); + }); } diff --git a/example/integration_test/t02_session_test.dart b/example/integration_test/t02_session_test.dart index 9aedc79..5c0b5fc 100644 --- a/example/integration_test/t02_session_test.dart +++ b/example/integration_test/t02_session_test.dart @@ -49,9 +49,11 @@ void main() { 'test_company_name', ); - // Tap got it. - if (Platform.isAndroid || Platform.isIOS) { - await $.native.tap(Selector(text: 'Got It')); + // Tap ok. + if (Platform.isAndroid) { + await $.native.tap(Selector(text: "Got It")); + } else if (Platform.isIOS) { + await $.native.tap(Selector(text: "OK")); } else { fail('Unsupported platform: ${Platform.operatingSystem}'); } @@ -96,7 +98,13 @@ void main() { shouldOnlyShowDriverAwarenessDisclaimer: true); // Accept driver awareness disclaimer. - await $.native.tap(Selector(text: 'Got It')); + if (Platform.isAndroid) { + await $.native.tap(Selector(text: "Got It")); + } else if (Platform.isIOS) { + await $.native.tap(Selector(text: "OK")); + } else { + fail('Unsupported platform: ${Platform.operatingSystem}'); + } // Check that the results match. await tosAccepted.then((bool accept) { diff --git a/lib/src/google_maps_map_view_controller.dart b/lib/src/google_maps_map_view_controller.dart index 20d5498..fa1604b 100644 --- a/lib/src/google_maps_map_view_controller.dart +++ b/lib/src/google_maps_map_view_controller.dart @@ -21,7 +21,7 @@ class GoogleMapViewController { /// Basic constructor. /// /// Don't create this directly, but access through - /// [GoogleMapsBaseMapView.onViewCreated] callback. + /// [GoogleMapsMapView.onViewCreated] callback. GoogleMapViewController(this._viewId) : settings = NavigationViewUISettings(_viewId); diff --git a/lib/src/google_navigation_flutter_android.dart b/lib/src/google_navigation_flutter_android.dart index 2608a55..49c5b88 100644 --- a/lib/src/google_navigation_flutter_android.dart +++ b/lib/src/google_navigation_flutter_android.dart @@ -25,10 +25,7 @@ import 'method_channel/method_channel.dart'; /// Google Maps Navigation Platform Android specific functionalities. /// @nodoc class GoogleMapsNavigationAndroid extends GoogleMapsNavigationPlatform - with - CommonNavigationSessionAPI, - CommonNavigationViewAPI, - CommonImageRegistryAPI { + with CommonNavigationSessionAPI, CommonMapViewAPI, CommonImageRegistryAPI { /// Registers the Android implementation of GoogleMapsNavigationPlatform. static void registerWith() { GoogleMapsNavigationPlatform.instance = GoogleMapsNavigationAndroid(); diff --git a/lib/src/google_navigation_flutter_ios.dart b/lib/src/google_navigation_flutter_ios.dart index fe4740b..8e56513 100644 --- a/lib/src/google_navigation_flutter_ios.dart +++ b/lib/src/google_navigation_flutter_ios.dart @@ -24,10 +24,7 @@ import 'method_channel/method_channel.dart'; /// Google Maps Navigation Platform iOS specific functionalities. /// @nodoc class GoogleMapsNavigationIOS extends GoogleMapsNavigationPlatform - with - CommonNavigationSessionAPI, - CommonNavigationViewAPI, - CommonImageRegistryAPI { + with CommonNavigationSessionAPI, CommonMapViewAPI, CommonImageRegistryAPI { /// Registers the iOS implementation of GoogleMapsNavigationPlatform. static void registerWith() { GoogleMapsNavigationPlatform.instance = GoogleMapsNavigationIOS(); diff --git a/lib/src/google_navigation_flutter_platform_interface.dart b/lib/src/google_navigation_flutter_platform_interface.dart index 92f8726..ec7e3da 100644 --- a/lib/src/google_navigation_flutter_platform_interface.dart +++ b/lib/src/google_navigation_flutter_platform_interface.dart @@ -40,7 +40,7 @@ enum MapViewType { abstract class GoogleMapsNavigationPlatform extends PlatformInterface with NavigationSessionAPIInterface, - NavigationViewAPIInterface, + MapViewAPIInterface, ImageRegistryAPIInterface { /// Constructs a GoogleMapsNavigationPlatform. GoogleMapsNavigationPlatform() : super(token: _token); @@ -245,7 +245,7 @@ abstract mixin class NavigationSessionAPIInterface { /// API interface for actions of the navigation view. /// @nodoc -abstract mixin class NavigationViewAPIInterface { +abstract mixin class MapViewAPIInterface { /// Awaits the platform view to be ready for communication. Future awaitMapReady({required int viewId}); diff --git a/lib/src/method_channel/common_view_api.dart b/lib/src/method_channel/common_view_api.dart index 06a43a8..342dc46 100644 --- a/lib/src/method_channel/common_view_api.dart +++ b/lib/src/method_channel/common_view_api.dart @@ -23,7 +23,7 @@ import 'method_channel.dart'; /// @nodoc /// Class that handles map view and navigation view communications. -mixin CommonNavigationViewAPI on NavigationViewAPIInterface { +mixin CommonMapViewAPI on MapViewAPIInterface { final MapViewApi _viewApi = MapViewApi(); bool _viewApiHasBeenSetUp = false; final StreamController<_ViewIdEventWrapper> _viewEventStreamController = From 67f6ce34b5e1cf77aedc4902dd7a0fae3b8b3138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Tue, 29 Oct 2024 17:04:24 +0800 Subject: [PATCH 17/18] refactor: refactoring and minor fixes --- .../navigation/GoogleMapsBaseMapView.kt | 26 +++++++++++++++++++ .../navigation/GoogleMapsNavigationPlugin.kt | 6 ++--- .../navigation/GoogleMapsNavigationView.kt | 26 ------------------- .../GoogleMapsViewMessageHandler.kt | 2 +- dartdoc_options.yaml | 2 +- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt index 13127ce..9a8ca22 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt @@ -902,4 +902,30 @@ abstract class GoogleMapsBaseMapView( _circles.forEach { controller -> controller.remove() } _circles.clear() } + + fun registerOnCameraChangedListener() { + getMap().setOnCameraMoveStartedListener { reason -> + val event = + when (reason) { + GoogleMap.OnCameraMoveStartedListener.REASON_API_ANIMATION, + GoogleMap.OnCameraMoveStartedListener.REASON_DEVELOPER_ANIMATION -> + CameraEventTypeDto.MOVESTARTEDBYAPI + GoogleMap.OnCameraMoveStartedListener.REASON_GESTURE -> CameraEventTypeDto.MOVESTARTEDBYGESTURE + else -> { + // This should not happen, added that the compiler does not complain. + throw RuntimeException("Unknown camera move started reason: $reason") + } + } + val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) + viewEventApi.onCameraChanged(viewId.toLong(), event, position) {} + } + getMap().setOnCameraMoveListener { + val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) + viewEventApi.onCameraChanged(viewId.toLong(), CameraEventTypeDto.ONCAMERAMOVE, position) {} + } + getMap().setOnCameraIdleListener { + val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) + viewEventApi.onCameraChanged(viewId.toLong(), CameraEventTypeDto.ONCAMERAIDLE, position) {} + } + } } diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt index 4f63fe5..07e8677 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationPlugin.kt @@ -27,7 +27,7 @@ class GoogleMapsNavigationPlugin : FlutterPlugin, ActivityAware { private lateinit var viewRegistry: GoogleMapsViewRegistry private lateinit var viewMessageHandler: GoogleMapsViewMessageHandler private lateinit var imageRegistryMessageHandler: GoogleMapsImageRegistryMessageHandler - private lateinit var navigationViewEventApi: ViewEventApi + private lateinit var viewEventApi: ViewEventApi private lateinit var _binding: FlutterPlugin.FlutterPluginBinding private lateinit var lifecycle: Lifecycle private lateinit var imageRegistry: ImageRegistry @@ -39,7 +39,7 @@ class GoogleMapsNavigationPlugin : FlutterPlugin, ActivityAware { MapViewApi.setUp(binding.binaryMessenger, viewMessageHandler) imageRegistryMessageHandler = GoogleMapsImageRegistryMessageHandler(imageRegistry) ImageRegistryApi.setUp(binding.binaryMessenger, imageRegistryMessageHandler) - navigationViewEventApi = ViewEventApi(binding.binaryMessenger) + viewEventApi = ViewEventApi(binding.binaryMessenger) _binding = binding binding.applicationContext.registerComponentCallbacks(viewRegistry) } @@ -52,7 +52,7 @@ class GoogleMapsNavigationPlugin : FlutterPlugin, ActivityAware { } override fun onAttachedToActivity(binding: ActivityPluginBinding) { - val factory = GoogleMapsViewFactory(viewRegistry, navigationViewEventApi, imageRegistry) + val factory = GoogleMapsViewFactory(viewRegistry, viewEventApi, imageRegistry) _binding.platformViewRegistry.registerViewFactory("google_navigation_flutter", factory) GoogleMapsNavigationSessionManager.createInstance(_binding.binaryMessenger) val inspectorHandler = GoogleMapsNavigationInspectorHandler(viewRegistry) diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt index 46f16e2..1e29ecb 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt @@ -231,30 +231,4 @@ internal constructor( invalidateViewAfterMapLoad() _navigationView.showRouteOverview() } - - fun registerOnCameraChangedListener() { - getMap().setOnCameraMoveStartedListener { reason -> - val event = - when (reason) { - OnCameraMoveStartedListener.REASON_API_ANIMATION, - OnCameraMoveStartedListener.REASON_DEVELOPER_ANIMATION -> - CameraEventTypeDto.MOVESTARTEDBYAPI - OnCameraMoveStartedListener.REASON_GESTURE -> CameraEventTypeDto.MOVESTARTEDBYGESTURE - else -> { - // This should not happen, added that the compiler does not complain. - throw RuntimeException("Unknown camera move started reason: $reason") - } - } - val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) - viewEventApi.onCameraChanged(viewId.toLong(), event, position) {} - } - getMap().setOnCameraMoveListener { - val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) - viewEventApi.onCameraChanged(viewId.toLong(), CameraEventTypeDto.ONCAMERAMOVE, position) {} - } - getMap().setOnCameraIdleListener { - val position = Convert.convertCameraPositionToDto(getMap().cameraPosition) - viewEventApi.onCameraChanged(viewId.toLong(), CameraEventTypeDto.ONCAMERAIDLE, position) {} - } - } } diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt index e93f872..a77c661 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsViewMessageHandler.kt @@ -473,6 +473,6 @@ class GoogleMapsViewMessageHandler(private val viewRegistry: GoogleMapsViewRegis } override fun registerOnCameraChangedListener(viewId: Long) { - getNavigationView(viewId.toInt()).registerOnCameraChangedListener() + getView(viewId.toInt()).registerOnCameraChangedListener() } } diff --git a/dartdoc_options.yaml b/dartdoc_options.yaml index f52b430..9e49135 100644 --- a/dartdoc_options.yaml +++ b/dartdoc_options.yaml @@ -26,7 +26,7 @@ dartdoc: "Image Registry": markdown: doc/image-registry.md name: Image Registry - categoryOrder: ["Map View", "Navigation", "Navigation View", "Image Registry"] + categoryOrder: ["Navigation", "Navigation View", "Map View", "Image Registry"] showUndocumentedCategories: true nodoc: ['**/*.g.dart'] From d2fb7318740e68dc9bdb8b30753c81c088894f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20V=C3=A4limaa?= Date: Tue, 29 Oct 2024 17:52:28 +0800 Subject: [PATCH 18/18] test: refactor integration tests --- .../navigation/GoogleMapsBaseMapView.kt | 3 +- .../navigation/GoogleMapsNavigationView.kt | 1 - example/integration_test/t06_map_test.dart | 46 ++++--- ...8_marker_polygon_polyline_circle_test.dart | 120 +++++++++--------- 4 files changed, 86 insertions(+), 84 deletions(-) diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt index 9a8ca22..686a971 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsBaseMapView.kt @@ -910,7 +910,8 @@ abstract class GoogleMapsBaseMapView( GoogleMap.OnCameraMoveStartedListener.REASON_API_ANIMATION, GoogleMap.OnCameraMoveStartedListener.REASON_DEVELOPER_ANIMATION -> CameraEventTypeDto.MOVESTARTEDBYAPI - GoogleMap.OnCameraMoveStartedListener.REASON_GESTURE -> CameraEventTypeDto.MOVESTARTEDBYGESTURE + GoogleMap.OnCameraMoveStartedListener.REASON_GESTURE -> + CameraEventTypeDto.MOVESTARTEDBYGESTURE else -> { // This should not happen, added that the compiler does not complain. throw RuntimeException("Unknown camera move started reason: $reason") diff --git a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt index 1e29ecb..baf79f3 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/navigation/GoogleMapsNavigationView.kt @@ -20,7 +20,6 @@ import android.content.Context import android.content.res.Configuration import android.view.View import com.google.android.gms.maps.CameraUpdateFactory -import com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener import com.google.android.gms.maps.GoogleMapOptions import com.google.android.libraries.navigation.NavigationView import io.flutter.plugin.platform.PlatformView diff --git a/example/integration_test/t06_map_test.dart b/example/integration_test/t06_map_test.dart index dd3b0a6..ebf34fa 100644 --- a/example/integration_test/t06_map_test.dart +++ b/example/integration_test/t06_map_test.dart @@ -26,8 +26,9 @@ import 'package:flutter/material.dart'; import 'shared.dart'; void main() { - patrol('Test map types', (PatrolIntegrationTester $) async { - for (final TestMapType testMapType in testMapTypes) { + for (final TestMapType testMapType in testMapTypes) { + patrol('Test map types (${testMapType.name})', + (PatrolIntegrationTester $) async { /// Get viewController for the test type (navigation map or regular map). GoogleMapViewController viewController = await getMapViewControllerForTestMapType($, testMapType: testMapType); @@ -46,12 +47,12 @@ void main() { await viewController.setMapType(mapType: type); expect(await viewController.getMapType(), type); } - } - }); + }); + } - patrol('Test platform view creation params', - (PatrolIntegrationTester $) async { - for (final TestMapType testMapType in testMapTypes) { + for (final TestMapType testMapType in testMapTypes) { + patrol('Test platform view creation params (${testMapType.name})', + (PatrolIntegrationTester $) async { final Completer controllerCompleter = Completer(); @@ -118,11 +119,12 @@ void main() { expect(await controller.settings.isZoomControlsEnabled(), false); expect(await controller.settings.isMapToolbarEnabled(), false); } - } - }); + }); + } - patrol('Test map UI settings', (PatrolIntegrationTester $) async { - for (final TestMapType testMapType in testMapTypes) { + for (final TestMapType testMapType in testMapTypes) { + patrol('Test map UI settings (${testMapType.name})', + (PatrolIntegrationTester $) async { /// The events are not tested because there's currently no reliable way to trigger them. void onMyLocationButtonClicked(MyLocationButtonClickedEvent event) { debugPrint('My location button clicked event: currently $event'); @@ -245,11 +247,12 @@ void main() { expect(e, const TypeMatcher()); } } - } - }); + }); + } - patrol('Test map style', (PatrolIntegrationTester $) async { - for (final TestMapType testMapType in testMapTypes) { + for (final TestMapType testMapType in testMapTypes) { + patrol('Test map style (${testMapType.name})', + (PatrolIntegrationTester $) async { /// Get viewController for the test type (navigation map or regular map). GoogleMapViewController viewController = await getMapViewControllerForTestMapType($, testMapType: testMapType); @@ -268,11 +271,12 @@ void main() { } on MapStyleException catch (e) { expect(e, isNotNull); } - } - }); + }); + } - patrol('Test min max zoom level', (PatrolIntegrationTester $) async { - for (final TestMapType testMapType in testMapTypes) { + for (final TestMapType testMapType in testMapTypes) { + patrol('Test min max zoom level (${testMapType.name})', + (PatrolIntegrationTester $) async { /// For some reason the functionality works on Android example app, but it doesn't work /// during the testing. Will skip Android testing for now. final Completer viewControllerCompleter = @@ -359,6 +363,6 @@ void main() { // Expect the same values. The actual zoom level will be limited by the map. expect(newMinZoomPreference, 0.0); expect(newMaxZoomPreference, 50.0); - } - }); + }); + } } diff --git a/example/integration_test/t08_marker_polygon_polyline_circle_test.dart b/example/integration_test/t08_marker_polygon_polyline_circle_test.dart index 975f3df..9cd7a28 100644 --- a/example/integration_test/t08_marker_polygon_polyline_circle_test.dart +++ b/example/integration_test/t08_marker_polygon_polyline_circle_test.dart @@ -28,8 +28,9 @@ import 'package:flutter/services.dart' show rootBundle; import 'shared.dart'; void main() { - patrol('Marker tests', (PatrolIntegrationTester $) async { - for (final TestMapType testMapType in testMapTypes) { + for (final TestMapType testMapType in testMapTypes) { + patrol('Marker tests (${testMapType.name})', + (PatrolIntegrationTester $) async { void onMarkerClicked(String event) { debugPrint('Marker clicked event: $event.'); } @@ -269,11 +270,12 @@ void main() { await viewController.clear(); getClearMarkerList = await viewController.getMarkers(); expect(getClearMarkerList, isEmpty); - } - }); + }); + } - patrol('Test polylines', (PatrolIntegrationTester $) async { - for (final TestMapType testMapType in testMapTypes) { + for (final TestMapType testMapType in testMapTypes) { + patrol('Test polylines (${testMapType.name})', + (PatrolIntegrationTester $) async { /// The events are not tested because there's currently no reliable way to trigger them. void onPolylineClicked(String event) { debugPrint('Polyline clicked event: $event.'); @@ -493,13 +495,12 @@ void main() { final List receivedPolylines8 = await viewController.getPolylines(); expect(receivedPolylines8.length, 0); - } - }); + }); + } - patrol('Polygon tests', (PatrolIntegrationTester $) async { - // This value is used to track the cirlcle offset for circle ids during each iteration for each test map type. - int polygonStartIndex = 0; - for (final TestMapType testMapType in testMapTypes) { + for (final TestMapType testMapType in testMapTypes) { + patrol('Polygon tests (${testMapType.name})', + (PatrolIntegrationTester $) async { void onPolygonClicked(String event) { /// The events are not tested because there's currently no reliable way to trigger them. debugPrint('Polygon clicked event: $event.'); @@ -589,7 +590,7 @@ void main() { /// Test PolygonOptions default values against addPolygons and getPolygons responses. for (final Polygon polygon in polygonList) { - expect(polygon.polygonId, 'Polygon_$polygonStartIndex'); + expect(polygon.polygonId, 'Polygon_0'); expect(polygon.options.points, options.points); expect(polygon.options.holes, options.holes); @@ -673,7 +674,7 @@ void main() { /// Test PolygonOptions updated values against updatePolygons and getPolygons responses. for (final Polygon updatedPolygon in updatedPolygonList) { - expect(updatedPolygon.polygonId, 'Polygon_$polygonStartIndex'); + expect(updatedPolygon.polygonId, 'Polygon_0'); expect(updatedPolygon.options.points, updatedOptions.points); expect(updatedPolygon.options.holes, updatedOptions.holes); expect(updatedPolygon.options.clickable, updatedOptions.clickable); @@ -690,12 +691,12 @@ void main() { final List polygons2 = await viewController.addPolygons([updatedOptions]); expect(polygons2.length, 1); - expect(polygons2[0]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); + expect(polygons2[0]!.polygonId, 'Polygon_1'); getPolygons = await viewController.getPolygons(); expect(getPolygons.length, 2); - expect(getPolygons[0]!.polygonId, 'Polygon_$polygonStartIndex'); - expect(getPolygons[1]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); + expect(getPolygons[0]!.polygonId, 'Polygon_0'); + expect(getPolygons[1]!.polygonId, 'Polygon_1'); final List polygonList2 = [ polygons2[0]!, @@ -716,44 +717,44 @@ void main() { final List polygons3 = await viewController.addPolygons([options]); expect(polygons3.length, 1); - expect(polygons3[0]!.polygonId, 'Polygon_${polygonStartIndex + 2}'); + expect(polygons3[0]!.polygonId, 'Polygon_2'); getPolygons = await viewController.getPolygons(); expect(getPolygons.length, 3); - expect(getPolygons[0]!.polygonId, 'Polygon_$polygonStartIndex'); - expect(getPolygons[1]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); - expect(getPolygons[2]!.polygonId, 'Polygon_${polygonStartIndex + 2}'); + expect(getPolygons[0]!.polygonId, 'Polygon_0'); + expect(getPolygons[1]!.polygonId, 'Polygon_1'); + expect(getPolygons[2]!.polygonId, 'Polygon_2'); /// Test removing the first polygon. await viewController.removePolygons([getPolygons.first!]); getPolygons = await viewController.getPolygons(); expect(getPolygons.length, 2); - expect(getPolygons[0]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); - expect(getPolygons[1]!.polygonId, 'Polygon_${polygonStartIndex + 2}'); + expect(getPolygons[0]!.polygonId, 'Polygon_1'); + expect(getPolygons[1]!.polygonId, 'Polygon_2'); /// Test removing the last polygon. await viewController.removePolygons([getPolygons.last!]); getPolygons = await viewController.getPolygons(); expect(getPolygons.length, 1); - expect(getPolygons[0]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); + expect(getPolygons[0]!.polygonId, 'Polygon_1'); /// Add multiple polygons to test clearPolygons(). final List polygons4 = await viewController .addPolygons([updatedOptions, options, options]); expect(polygons4.length, 3); - expect(polygons4[0]!.polygonId, 'Polygon_${polygonStartIndex + 3}'); - expect(polygons4[1]!.polygonId, 'Polygon_${polygonStartIndex + 4}'); - expect(polygons4[2]!.polygonId, 'Polygon_${polygonStartIndex + 5}'); + expect(polygons4[0]!.polygonId, 'Polygon_3'); + expect(polygons4[1]!.polygonId, 'Polygon_4'); + expect(polygons4[2]!.polygonId, 'Polygon_5'); getPolygons = await viewController.getPolygons(); expect(getPolygons.length, 4); - expect(getPolygons[0]!.polygonId, 'Polygon_${polygonStartIndex + 1}'); - expect(getPolygons[1]!.polygonId, 'Polygon_${polygonStartIndex + 3}'); - expect(getPolygons[2]!.polygonId, 'Polygon_${polygonStartIndex + 4}'); - expect(getPolygons[3]!.polygonId, 'Polygon_${polygonStartIndex + 5}'); + expect(getPolygons[0]!.polygonId, 'Polygon_1'); + expect(getPolygons[1]!.polygonId, 'Polygon_3'); + expect(getPolygons[2]!.polygonId, 'Polygon_4'); + expect(getPolygons[3]!.polygonId, 'Polygon_5'); /// Test clearPolygons(). await viewController.clearPolygons(); @@ -797,14 +798,12 @@ void main() { getPolygons = await viewController.getPolygons(); expect(getPolygons, isEmpty); - polygonStartIndex += 11; - } - }); - - patrol('Circle tests', (PatrolIntegrationTester $) async { - // This value is used to track the cirlcle offset for circle ids during each iteration for each test map type. - int circleStartIndex = 0; - for (final TestMapType testMapType in testMapTypes) { + }); + } + + for (final TestMapType testMapType in testMapTypes) { + patrol('Circle tests (${testMapType.name})', + (PatrolIntegrationTester $) async { void onCircleClicked(String event) { /// The events are not tested because there's currently no reliable way to trigger them. debugPrint('Circle clicked event: $event.'); @@ -828,7 +827,7 @@ void main() { /// Test CircleOptions default values against addCircles and getCircles responses. for (final Circle circle in circleList) { - expect(circle.circleId, 'Circle_$circleStartIndex'); + expect(circle.circleId, 'Circle_0'); expect(circle.options.position, options.position); expect(circle.options.radius, options.radius); @@ -878,7 +877,7 @@ void main() { /// Test CircleOptions updated values against updateCircles and getCircles responses. for (final Circle updatedCircle in updatedCircleList) { - expect(updatedCircle.circleId, 'Circle_$circleStartIndex'); + expect(updatedCircle.circleId, 'Circle_0'); expect(updatedCircle.options.position, updatedOptions.position); expect(updatedCircle.options.radius, updatedOptions.radius); expect(updatedCircle.options.clickable, updatedOptions.clickable); @@ -896,12 +895,12 @@ void main() { final List circles2 = await viewController.addCircles([updatedOptions]); expect(circles2.length, 1); - expect(circles2[0]!.circleId, 'Circle_${circleStartIndex + 1}'); + expect(circles2[0]!.circleId, 'Circle_1'); getCircles = await viewController.getCircles(); expect(getCircles.length, 2); - expect(getCircles[0]!.circleId, 'Circle_$circleStartIndex'); - expect(getCircles[1]!.circleId, 'Circle_${circleStartIndex + 1}'); + expect(getCircles[0]!.circleId, 'Circle_0'); + expect(getCircles[1]!.circleId, 'Circle_1'); final List circleList2 = [ circles2[0]!, @@ -924,44 +923,44 @@ void main() { final List circles3 = await viewController.addCircles([options]); expect(circles3.length, 1); - expect(circles3[0]!.circleId, 'Circle_${circleStartIndex + 2}'); + expect(circles3[0]!.circleId, 'Circle_2'); getCircles = await viewController.getCircles(); expect(getCircles.length, 3); - expect(getCircles[0]!.circleId, 'Circle_$circleStartIndex'); - expect(getCircles[1]!.circleId, 'Circle_${circleStartIndex + 1}'); - expect(getCircles[2]!.circleId, 'Circle_${circleStartIndex + 2}'); + expect(getCircles[0]!.circleId, 'Circle_0'); + expect(getCircles[1]!.circleId, 'Circle_1'); + expect(getCircles[2]!.circleId, 'Circle_2'); /// Test removing the first circle. await viewController.removeCircles([getCircles.first!]); getCircles = await viewController.getCircles(); expect(getCircles.length, 2); - expect(getCircles[0]!.circleId, 'Circle_${circleStartIndex + 1}'); - expect(getCircles[1]!.circleId, 'Circle_${circleStartIndex + 2}'); + expect(getCircles[0]!.circleId, 'Circle_1'); + expect(getCircles[1]!.circleId, 'Circle_2'); /// Test removing the last circle. await viewController.removeCircles([getCircles.last!]); getCircles = await viewController.getCircles(); expect(getCircles.length, 1); - expect(getCircles[0]!.circleId, 'Circle_${circleStartIndex + 1}'); + expect(getCircles[0]!.circleId, 'Circle_1'); /// Add multiple circles to test clearCircles(). final List circles4 = await viewController .addCircles([updatedOptions, options, options]); expect(circles4.length, 3); - expect(circles4[0]!.circleId, 'Circle_${circleStartIndex + 3}'); - expect(circles4[1]!.circleId, 'Circle_${circleStartIndex + 4}'); - expect(circles4[2]!.circleId, 'Circle_${circleStartIndex + 5}'); + expect(circles4[0]!.circleId, 'Circle_3'); + expect(circles4[1]!.circleId, 'Circle_4'); + expect(circles4[2]!.circleId, 'Circle_5'); getCircles = await viewController.getCircles(); expect(getCircles.length, 4); - expect(getCircles[0]!.circleId, 'Circle_${circleStartIndex + 1}'); - expect(getCircles[1]!.circleId, 'Circle_${circleStartIndex + 3}'); - expect(getCircles[2]!.circleId, 'Circle_${circleStartIndex + 4}'); - expect(getCircles[3]!.circleId, 'Circle_${circleStartIndex + 5}'); + expect(getCircles[0]!.circleId, 'Circle_1'); + expect(getCircles[1]!.circleId, 'Circle_3'); + expect(getCircles[2]!.circleId, 'Circle_4'); + expect(getCircles[3]!.circleId, 'Circle_5'); /// Test clearCircles(). await viewController.clearCircles(); @@ -996,7 +995,6 @@ void main() { } on CircleNotFoundException catch (e) { expect(e, isNotNull); } - circleStartIndex += 11; - } - }); + }); + } }