Skip to content

Commit 796afa3

Browse files
[google_maps_flutter] Update Android for non-nullable generics (#7990)
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
1 parent 02b20bf commit 796afa3

File tree

7 files changed

+122
-149
lines changed

7 files changed

+122
-149
lines changed

packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.14.11
2+
3+
* Updates internal Pigeon API to use newer features.
4+
15
## 2.14.10
26

37
* Adds 'PlatformBitmap' type.

packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
// Autogenerated from Pigeon (v22.4.0), do not edit directly.
4+
// Autogenerated from Pigeon (v22.6.0), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

77
package io.flutter.plugins.googlemaps;

packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,9 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform {
750750
}
751751

752752
static PlatformPolygon _platformPolygonFromPolygon(Polygon polygon) {
753-
final List<PlatformLatLng?> points =
753+
final List<PlatformLatLng> points =
754754
polygon.points.map(_platformLatLngFromLatLng).toList();
755-
final List<List<PlatformLatLng?>?> holes =
755+
final List<List<PlatformLatLng>> holes =
756756
polygon.holes.map((List<LatLng> hole) {
757757
return hole.map(_platformLatLngFromLatLng).toList();
758758
}).toList();
@@ -771,9 +771,9 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform {
771771
}
772772

773773
static PlatformPolyline _platformPolylineFromPolyline(Polyline polyline) {
774-
final List<PlatformLatLng?> points =
774+
final List<PlatformLatLng> points =
775775
polyline.points.map(_platformLatLngFromLatLng).toList();
776-
final List<PlatformPatternItem?> pattern =
776+
final List<PlatformPatternItem> pattern =
777777
polyline.patterns.map(platformPatternItemFromPatternItem).toList();
778778
return PlatformPolyline(
779779
polylineId: polyline.polylineId.value,

packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
// Autogenerated from Pigeon (v22.4.0), do not edit directly.
4+
// Autogenerated from Pigeon (v22.6.0), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66
// 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
77

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

410410
Object encode() {
411411
return <Object?>[
@@ -416,7 +416,7 @@ class PlatformHeatmap {
416416
static PlatformHeatmap decode(Object result) {
417417
result as List<Object?>;
418418
return PlatformHeatmap(
419-
json: (result[0] as Map<Object?, Object?>?)!.cast<String?, Object?>(),
419+
json: (result[0] as Map<Object?, Object?>?)!.cast<String, Object?>(),
420420
);
421421
}
422422
}
@@ -607,9 +607,9 @@ class PlatformPolygon {
607607

608608
bool geodesic;
609609

610-
List<PlatformLatLng?> points;
610+
List<PlatformLatLng> points;
611611

612-
List<List<PlatformLatLng?>?> holes;
612+
List<List<PlatformLatLng>> holes;
613613

614614
bool visible;
615615

@@ -641,8 +641,8 @@ class PlatformPolygon {
641641
consumesTapEvents: result[1]! as bool,
642642
fillColor: result[2]! as int,
643643
geodesic: result[3]! as bool,
644-
points: (result[4] as List<Object?>?)!.cast<PlatformLatLng?>(),
645-
holes: (result[5] as List<Object?>?)!.cast<List<PlatformLatLng?>?>(),
644+
points: (result[4] as List<Object?>?)!.cast<PlatformLatLng>(),
645+
holes: (result[5] as List<Object?>?)!.cast<List<PlatformLatLng>>(),
646646
visible: result[6]! as bool,
647647
strokeColor: result[7]! as int,
648648
strokeWidth: result[8]! as int,
@@ -680,9 +680,9 @@ class PlatformPolyline {
680680
PlatformJointType jointType;
681681

682682
/// The pattern data, as a list of pattern items.
683-
List<PlatformPatternItem?> patterns;
683+
List<PlatformPatternItem> patterns;
684684

685-
List<PlatformLatLng?> points;
685+
List<PlatformLatLng> points;
686686

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

978978
PlatformLatLngBounds bounds;
979979

980-
List<String?> markerIds;
980+
List<String> markerIds;
981981

982982
Object encode() {
983983
return <Object?>[
@@ -994,7 +994,7 @@ class PlatformCluster {
994994
clusterManagerId: result[0]! as String,
995995
position: result[1]! as PlatformLatLng,
996996
bounds: result[2]! as PlatformLatLngBounds,
997-
markerIds: (result[3] as List<Object?>?)!.cast<String?>(),
997+
markerIds: (result[3] as List<Object?>?)!.cast<String>(),
998998
);
999999
}
10001000
}
@@ -1042,19 +1042,19 @@ class PlatformMapViewCreationParams {
10421042

10431043
PlatformMapConfiguration mapConfiguration;
10441044

1045-
List<PlatformCircle?> initialCircles;
1045+
List<PlatformCircle> initialCircles;
10461046

1047-
List<PlatformMarker?> initialMarkers;
1047+
List<PlatformMarker> initialMarkers;
10481048

1049-
List<PlatformPolygon?> initialPolygons;
1049+
List<PlatformPolygon> initialPolygons;
10501050

1051-
List<PlatformPolyline?> initialPolylines;
1051+
List<PlatformPolyline> initialPolylines;
10521052

1053-
List<PlatformHeatmap?> initialHeatmaps;
1053+
List<PlatformHeatmap> initialHeatmaps;
10541054

1055-
List<PlatformTileOverlay?> initialTileOverlays;
1055+
List<PlatformTileOverlay> initialTileOverlays;
10561056

1057-
List<PlatformClusterManager?> initialClusterManagers;
1057+
List<PlatformClusterManager> initialClusterManagers;
10581058

10591059
Object encode() {
10601060
return <Object?>[
@@ -1075,16 +1075,15 @@ class PlatformMapViewCreationParams {
10751075
return PlatformMapViewCreationParams(
10761076
initialCameraPosition: result[0]! as PlatformCameraPosition,
10771077
mapConfiguration: result[1]! as PlatformMapConfiguration,
1078-
initialCircles: (result[2] as List<Object?>?)!.cast<PlatformCircle?>(),
1079-
initialMarkers: (result[3] as List<Object?>?)!.cast<PlatformMarker?>(),
1080-
initialPolygons: (result[4] as List<Object?>?)!.cast<PlatformPolygon?>(),
1081-
initialPolylines:
1082-
(result[5] as List<Object?>?)!.cast<PlatformPolyline?>(),
1083-
initialHeatmaps: (result[6] as List<Object?>?)!.cast<PlatformHeatmap?>(),
1078+
initialCircles: (result[2] as List<Object?>?)!.cast<PlatformCircle>(),
1079+
initialMarkers: (result[3] as List<Object?>?)!.cast<PlatformMarker>(),
1080+
initialPolygons: (result[4] as List<Object?>?)!.cast<PlatformPolygon>(),
1081+
initialPolylines: (result[5] as List<Object?>?)!.cast<PlatformPolyline>(),
1082+
initialHeatmaps: (result[6] as List<Object?>?)!.cast<PlatformHeatmap>(),
10841083
initialTileOverlays:
1085-
(result[7] as List<Object?>?)!.cast<PlatformTileOverlay?>(),
1084+
(result[7] as List<Object?>?)!.cast<PlatformTileOverlay>(),
10861085
initialClusterManagers:
1087-
(result[8] as List<Object?>?)!.cast<PlatformClusterManager?>(),
1086+
(result[8] as List<Object?>?)!.cast<PlatformClusterManager>(),
10881087
);
10891088
}
10901089
}
@@ -1850,8 +1849,8 @@ class MapsApi {
18501849
}
18511850

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

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

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

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

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

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

20082007
/// Updates the set of tile overlays on the map.
2009-
Future<void> updateTileOverlays(List<PlatformTileOverlay?> toAdd,
2010-
List<PlatformTileOverlay?> toChange, List<String?> idsToRemove) async {
2008+
Future<void> updateTileOverlays(List<PlatformTileOverlay> toAdd,
2009+
List<PlatformTileOverlay> toChange, List<String> idsToRemove) async {
20112010
final String pigeonVar_channelName =
20122011
'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$pigeonVar_messageChannelSuffix';
20132012
final BasicMessageChannel<Object?> pigeonVar_channel =
@@ -3385,7 +3384,7 @@ class MapsInspectorApi {
33853384
}
33863385
}
33873386

3388-
Future<List<PlatformCluster?>> getClusters(String clusterManagerId) async {
3387+
Future<List<PlatformCluster>> getClusters(String clusterManagerId) async {
33893388
final String pigeonVar_channelName =
33903389
'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$pigeonVar_messageChannelSuffix';
33913390
final BasicMessageChannel<Object?> pigeonVar_channel =
@@ -3411,7 +3410,7 @@ class MapsInspectorApi {
34113410
);
34123411
} else {
34133412
return (pigeonVar_replyList[0] as List<Object?>?)!
3414-
.cast<PlatformCluster?>();
3413+
.cast<PlatformCluster>();
34153414
}
34163415
}
34173416
}

0 commit comments

Comments
 (0)