Skip to content

Commit

Permalink
[google_maps_flutter] Update Android for non-nullable generics (#7990)
Browse files Browse the repository at this point in the history
Now that Pigeon supports non-nullable generics, update the Pigeon definition to remove all the unnecessary nullability in generics.

This is largely a no-op for non-test code because these types are mostly for passing from Dart to Java, and Java doesn't support non-nullable generics so nothing changes on the native side.

Part of flutter/flutter#155891
  • Loading branch information
stuartmorgan authored Nov 1, 2024
1 parent 02b20bf commit 796afa3
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 149 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.14.11

* Updates internal Pigeon API to use newer features.

## 2.14.10

* Adds 'PlatformBitmap' type.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v22.4.0), do not edit directly.
// Autogenerated from Pigeon (v22.6.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon

package io.flutter.plugins.googlemaps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,9 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform {
}

static PlatformPolygon _platformPolygonFromPolygon(Polygon polygon) {
final List<PlatformLatLng?> points =
final List<PlatformLatLng> points =
polygon.points.map(_platformLatLngFromLatLng).toList();
final List<List<PlatformLatLng?>?> holes =
final List<List<PlatformLatLng>> holes =
polygon.holes.map((List<LatLng> hole) {
return hole.map(_platformLatLngFromLatLng).toList();
}).toList();
Expand All @@ -771,9 +771,9 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform {
}

static PlatformPolyline _platformPolylineFromPolyline(Polyline polyline) {
final List<PlatformLatLng?> points =
final List<PlatformLatLng> points =
polyline.points.map(_platformLatLngFromLatLng).toList();
final List<PlatformPatternItem?> pattern =
final List<PlatformPatternItem> pattern =
polyline.patterns.map(platformPatternItemFromPatternItem).toList();
return PlatformPolyline(
polylineId: polyline.polylineId.value,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v22.4.0), do not edit directly.
// Autogenerated from Pigeon (v22.6.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

Expand Down Expand Up @@ -405,7 +405,7 @@ class PlatformHeatmap {
/// The heatmap data, as JSON. This should only be set from
/// Heatmap.toJson, and the native code must interpret it according to the
/// internal implementation details of that method.
Map<String?, Object?> json;
Map<String, Object?> json;

Object encode() {
return <Object?>[
Expand All @@ -416,7 +416,7 @@ class PlatformHeatmap {
static PlatformHeatmap decode(Object result) {
result as List<Object?>;
return PlatformHeatmap(
json: (result[0] as Map<Object?, Object?>?)!.cast<String?, Object?>(),
json: (result[0] as Map<Object?, Object?>?)!.cast<String, Object?>(),
);
}
}
Expand Down Expand Up @@ -607,9 +607,9 @@ class PlatformPolygon {

bool geodesic;

List<PlatformLatLng?> points;
List<PlatformLatLng> points;

List<List<PlatformLatLng?>?> holes;
List<List<PlatformLatLng>> holes;

bool visible;

Expand Down Expand Up @@ -641,8 +641,8 @@ class PlatformPolygon {
consumesTapEvents: result[1]! as bool,
fillColor: result[2]! as int,
geodesic: result[3]! as bool,
points: (result[4] as List<Object?>?)!.cast<PlatformLatLng?>(),
holes: (result[5] as List<Object?>?)!.cast<List<PlatformLatLng?>?>(),
points: (result[4] as List<Object?>?)!.cast<PlatformLatLng>(),
holes: (result[5] as List<Object?>?)!.cast<List<PlatformLatLng>>(),
visible: result[6]! as bool,
strokeColor: result[7]! as int,
strokeWidth: result[8]! as int,
Expand Down Expand Up @@ -680,9 +680,9 @@ class PlatformPolyline {
PlatformJointType jointType;

/// The pattern data, as a list of pattern items.
List<PlatformPatternItem?> patterns;
List<PlatformPatternItem> patterns;

List<PlatformLatLng?> points;
List<PlatformLatLng> points;

/// The cap at the start and end vertex of a polyline.
/// See https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/Cap.
Expand Down Expand Up @@ -721,8 +721,8 @@ class PlatformPolyline {
color: result[2]! as int,
geodesic: result[3]! as bool,
jointType: result[4]! as PlatformJointType,
patterns: (result[5] as List<Object?>?)!.cast<PlatformPatternItem?>(),
points: (result[6] as List<Object?>?)!.cast<PlatformLatLng?>(),
patterns: (result[5] as List<Object?>?)!.cast<PlatformPatternItem>(),
points: (result[6] as List<Object?>?)!.cast<PlatformLatLng>(),
startCap: result[7]! as PlatformCap,
endCap: result[8]! as PlatformCap,
visible: result[9]! as bool,
Expand Down Expand Up @@ -977,7 +977,7 @@ class PlatformCluster {

PlatformLatLngBounds bounds;

List<String?> markerIds;
List<String> markerIds;

Object encode() {
return <Object?>[
Expand All @@ -994,7 +994,7 @@ class PlatformCluster {
clusterManagerId: result[0]! as String,
position: result[1]! as PlatformLatLng,
bounds: result[2]! as PlatformLatLngBounds,
markerIds: (result[3] as List<Object?>?)!.cast<String?>(),
markerIds: (result[3] as List<Object?>?)!.cast<String>(),
);
}
}
Expand Down Expand Up @@ -1042,19 +1042,19 @@ class PlatformMapViewCreationParams {

PlatformMapConfiguration mapConfiguration;

List<PlatformCircle?> initialCircles;
List<PlatformCircle> initialCircles;

List<PlatformMarker?> initialMarkers;
List<PlatformMarker> initialMarkers;

List<PlatformPolygon?> initialPolygons;
List<PlatformPolygon> initialPolygons;

List<PlatformPolyline?> initialPolylines;
List<PlatformPolyline> initialPolylines;

List<PlatformHeatmap?> initialHeatmaps;
List<PlatformHeatmap> initialHeatmaps;

List<PlatformTileOverlay?> initialTileOverlays;
List<PlatformTileOverlay> initialTileOverlays;

List<PlatformClusterManager?> initialClusterManagers;
List<PlatformClusterManager> initialClusterManagers;

Object encode() {
return <Object?>[
Expand All @@ -1075,16 +1075,15 @@ class PlatformMapViewCreationParams {
return PlatformMapViewCreationParams(
initialCameraPosition: result[0]! as PlatformCameraPosition,
mapConfiguration: result[1]! as PlatformMapConfiguration,
initialCircles: (result[2] as List<Object?>?)!.cast<PlatformCircle?>(),
initialMarkers: (result[3] as List<Object?>?)!.cast<PlatformMarker?>(),
initialPolygons: (result[4] as List<Object?>?)!.cast<PlatformPolygon?>(),
initialPolylines:
(result[5] as List<Object?>?)!.cast<PlatformPolyline?>(),
initialHeatmaps: (result[6] as List<Object?>?)!.cast<PlatformHeatmap?>(),
initialCircles: (result[2] as List<Object?>?)!.cast<PlatformCircle>(),
initialMarkers: (result[3] as List<Object?>?)!.cast<PlatformMarker>(),
initialPolygons: (result[4] as List<Object?>?)!.cast<PlatformPolygon>(),
initialPolylines: (result[5] as List<Object?>?)!.cast<PlatformPolyline>(),
initialHeatmaps: (result[6] as List<Object?>?)!.cast<PlatformHeatmap>(),
initialTileOverlays:
(result[7] as List<Object?>?)!.cast<PlatformTileOverlay?>(),
(result[7] as List<Object?>?)!.cast<PlatformTileOverlay>(),
initialClusterManagers:
(result[8] as List<Object?>?)!.cast<PlatformClusterManager?>(),
(result[8] as List<Object?>?)!.cast<PlatformClusterManager>(),
);
}
}
Expand Down Expand Up @@ -1850,8 +1849,8 @@ class MapsApi {
}

/// Updates the set of circles on the map.
Future<void> updateCircles(List<PlatformCircle?> toAdd,
List<PlatformCircle?> toChange, List<String?> idsToRemove) async {
Future<void> updateCircles(List<PlatformCircle> toAdd,
List<PlatformCircle> toChange, List<String> idsToRemove) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel =
Expand All @@ -1876,8 +1875,8 @@ class MapsApi {
}

/// Updates the set of heatmaps on the map.
Future<void> updateHeatmaps(List<PlatformHeatmap?> toAdd,
List<PlatformHeatmap?> toChange, List<String?> idsToRemove) async {
Future<void> updateHeatmaps(List<PlatformHeatmap> toAdd,
List<PlatformHeatmap> toChange, List<String> idsToRemove) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel =
Expand All @@ -1903,7 +1902,7 @@ class MapsApi {

/// Updates the set of custer managers for clusters on the map.
Future<void> updateClusterManagers(
List<PlatformClusterManager?> toAdd, List<String?> idsToRemove) async {
List<PlatformClusterManager> toAdd, List<String> idsToRemove) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel =
Expand All @@ -1928,8 +1927,8 @@ class MapsApi {
}

/// Updates the set of markers on the map.
Future<void> updateMarkers(List<PlatformMarker?> toAdd,
List<PlatformMarker?> toChange, List<String?> idsToRemove) async {
Future<void> updateMarkers(List<PlatformMarker> toAdd,
List<PlatformMarker> toChange, List<String> idsToRemove) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel =
Expand All @@ -1954,8 +1953,8 @@ class MapsApi {
}

/// Updates the set of polygonss on the map.
Future<void> updatePolygons(List<PlatformPolygon?> toAdd,
List<PlatformPolygon?> toChange, List<String?> idsToRemove) async {
Future<void> updatePolygons(List<PlatformPolygon> toAdd,
List<PlatformPolygon> toChange, List<String> idsToRemove) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel =
Expand All @@ -1980,8 +1979,8 @@ class MapsApi {
}

/// Updates the set of polylines on the map.
Future<void> updatePolylines(List<PlatformPolyline?> toAdd,
List<PlatformPolyline?> toChange, List<String?> idsToRemove) async {
Future<void> updatePolylines(List<PlatformPolyline> toAdd,
List<PlatformPolyline> toChange, List<String> idsToRemove) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel =
Expand All @@ -2006,8 +2005,8 @@ class MapsApi {
}

/// Updates the set of tile overlays on the map.
Future<void> updateTileOverlays(List<PlatformTileOverlay?> toAdd,
List<PlatformTileOverlay?> toChange, List<String?> idsToRemove) async {
Future<void> updateTileOverlays(List<PlatformTileOverlay> toAdd,
List<PlatformTileOverlay> toChange, List<String> idsToRemove) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel =
Expand Down Expand Up @@ -3385,7 +3384,7 @@ class MapsInspectorApi {
}
}

Future<List<PlatformCluster?>> getClusters(String clusterManagerId) async {
Future<List<PlatformCluster>> getClusters(String clusterManagerId) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel =
Expand All @@ -3411,7 +3410,7 @@ class MapsInspectorApi {
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<PlatformCluster?>();
.cast<PlatformCluster>();
}
}
}
Loading

0 comments on commit 796afa3

Please sign in to comment.