Skip to content

Commit 53a0563

Browse files
[google_maps_flutter] Update iOS Pigeon for non-nullable generics (#7792)
Updates the Pigeon definition to uses non-nullable generics now that it's possible. Allows removing a force-unwrap now that the correct type is expressed in the definition. Part of flutter/flutter#155891
1 parent 0da80be commit 53a0563

File tree

8 files changed

+839
-835
lines changed

8 files changed

+839
-835
lines changed

packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.13.1
2+
3+
* Updates Pigeon for non-nullable collection type support.
4+
15
## 2.13.0
26

37
* Updates map configuration and platform view creation parameters to use Pigeon.

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.h

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 (v20.0.2), do not edit directly.
4+
// Autogenerated from Pigeon (v22.4.2), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

77
#import <Foundation/Foundation.h>

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.m

Lines changed: 51 additions & 51 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 (v20.0.2), do not edit directly.
4+
// Autogenerated from Pigeon (v22.4.2), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

77
#import "messages.g.h"
@@ -761,52 +761,52 @@ @interface FGMMessagesPigeonCodecReader : FlutterStandardReader
761761
@implementation FGMMessagesPigeonCodecReader
762762
- (nullable id)readValueOfType:(UInt8)type {
763763
switch (type) {
764-
case 129:
765-
return [FGMPlatformCameraPosition fromList:[self readValue]];
764+
case 129: {
765+
NSNumber *enumAsNumber = [self readValue];
766+
return enumAsNumber == nil
767+
? nil
768+
: [[FGMPlatformMapTypeBox alloc] initWithValue:[enumAsNumber integerValue]];
769+
}
766770
case 130:
767-
return [FGMPlatformCameraUpdate fromList:[self readValue]];
771+
return [FGMPlatformCameraPosition fromList:[self readValue]];
768772
case 131:
769-
return [FGMPlatformCircle fromList:[self readValue]];
773+
return [FGMPlatformCameraUpdate fromList:[self readValue]];
770774
case 132:
771-
return [FGMPlatformHeatmap fromList:[self readValue]];
775+
return [FGMPlatformCircle fromList:[self readValue]];
772776
case 133:
773-
return [FGMPlatformCluster fromList:[self readValue]];
777+
return [FGMPlatformHeatmap fromList:[self readValue]];
774778
case 134:
775-
return [FGMPlatformClusterManager fromList:[self readValue]];
779+
return [FGMPlatformCluster fromList:[self readValue]];
776780
case 135:
777-
return [FGMPlatformMarker fromList:[self readValue]];
781+
return [FGMPlatformClusterManager fromList:[self readValue]];
778782
case 136:
779-
return [FGMPlatformPolygon fromList:[self readValue]];
783+
return [FGMPlatformMarker fromList:[self readValue]];
780784
case 137:
781-
return [FGMPlatformPolyline fromList:[self readValue]];
785+
return [FGMPlatformPolygon fromList:[self readValue]];
782786
case 138:
783-
return [FGMPlatformTile fromList:[self readValue]];
787+
return [FGMPlatformPolyline fromList:[self readValue]];
784788
case 139:
785-
return [FGMPlatformTileOverlay fromList:[self readValue]];
789+
return [FGMPlatformTile fromList:[self readValue]];
786790
case 140:
787-
return [FGMPlatformEdgeInsets fromList:[self readValue]];
791+
return [FGMPlatformTileOverlay fromList:[self readValue]];
788792
case 141:
789-
return [FGMPlatformLatLng fromList:[self readValue]];
793+
return [FGMPlatformEdgeInsets fromList:[self readValue]];
790794
case 142:
791-
return [FGMPlatformLatLngBounds fromList:[self readValue]];
795+
return [FGMPlatformLatLng fromList:[self readValue]];
792796
case 143:
793-
return [FGMPlatformCameraTargetBounds fromList:[self readValue]];
797+
return [FGMPlatformLatLngBounds fromList:[self readValue]];
794798
case 144:
795-
return [FGMPlatformMapViewCreationParams fromList:[self readValue]];
799+
return [FGMPlatformCameraTargetBounds fromList:[self readValue]];
796800
case 145:
797-
return [FGMPlatformMapConfiguration fromList:[self readValue]];
801+
return [FGMPlatformMapViewCreationParams fromList:[self readValue]];
798802
case 146:
799-
return [FGMPlatformPoint fromList:[self readValue]];
803+
return [FGMPlatformMapConfiguration fromList:[self readValue]];
800804
case 147:
801-
return [FGMPlatformTileLayer fromList:[self readValue]];
805+
return [FGMPlatformPoint fromList:[self readValue]];
802806
case 148:
807+
return [FGMPlatformTileLayer fromList:[self readValue]];
808+
case 149:
803809
return [FGMPlatformZoomRange fromList:[self readValue]];
804-
case 149: {
805-
NSNumber *enumAsNumber = [self readValue];
806-
return enumAsNumber == nil
807-
? nil
808-
: [[FGMPlatformMapTypeBox alloc] initWithValue:[enumAsNumber integerValue]];
809-
}
810810
default:
811811
return [super readValueOfType:type];
812812
}
@@ -817,70 +817,70 @@ @interface FGMMessagesPigeonCodecWriter : FlutterStandardWriter
817817
@end
818818
@implementation FGMMessagesPigeonCodecWriter
819819
- (void)writeValue:(id)value {
820-
if ([value isKindOfClass:[FGMPlatformCameraPosition class]]) {
820+
if ([value isKindOfClass:[FGMPlatformMapTypeBox class]]) {
821+
FGMPlatformMapTypeBox *box = (FGMPlatformMapTypeBox *)value;
821822
[self writeByte:129];
822-
[self writeValue:[value toList]];
823-
} else if ([value isKindOfClass:[FGMPlatformCameraUpdate class]]) {
823+
[self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])];
824+
} else if ([value isKindOfClass:[FGMPlatformCameraPosition class]]) {
824825
[self writeByte:130];
825826
[self writeValue:[value toList]];
826-
} else if ([value isKindOfClass:[FGMPlatformCircle class]]) {
827+
} else if ([value isKindOfClass:[FGMPlatformCameraUpdate class]]) {
827828
[self writeByte:131];
828829
[self writeValue:[value toList]];
829-
} else if ([value isKindOfClass:[FGMPlatformHeatmap class]]) {
830+
} else if ([value isKindOfClass:[FGMPlatformCircle class]]) {
830831
[self writeByte:132];
831832
[self writeValue:[value toList]];
832-
} else if ([value isKindOfClass:[FGMPlatformCluster class]]) {
833+
} else if ([value isKindOfClass:[FGMPlatformHeatmap class]]) {
833834
[self writeByte:133];
834835
[self writeValue:[value toList]];
835-
} else if ([value isKindOfClass:[FGMPlatformClusterManager class]]) {
836+
} else if ([value isKindOfClass:[FGMPlatformCluster class]]) {
836837
[self writeByte:134];
837838
[self writeValue:[value toList]];
838-
} else if ([value isKindOfClass:[FGMPlatformMarker class]]) {
839+
} else if ([value isKindOfClass:[FGMPlatformClusterManager class]]) {
839840
[self writeByte:135];
840841
[self writeValue:[value toList]];
841-
} else if ([value isKindOfClass:[FGMPlatformPolygon class]]) {
842+
} else if ([value isKindOfClass:[FGMPlatformMarker class]]) {
842843
[self writeByte:136];
843844
[self writeValue:[value toList]];
844-
} else if ([value isKindOfClass:[FGMPlatformPolyline class]]) {
845+
} else if ([value isKindOfClass:[FGMPlatformPolygon class]]) {
845846
[self writeByte:137];
846847
[self writeValue:[value toList]];
847-
} else if ([value isKindOfClass:[FGMPlatformTile class]]) {
848+
} else if ([value isKindOfClass:[FGMPlatformPolyline class]]) {
848849
[self writeByte:138];
849850
[self writeValue:[value toList]];
850-
} else if ([value isKindOfClass:[FGMPlatformTileOverlay class]]) {
851+
} else if ([value isKindOfClass:[FGMPlatformTile class]]) {
851852
[self writeByte:139];
852853
[self writeValue:[value toList]];
853-
} else if ([value isKindOfClass:[FGMPlatformEdgeInsets class]]) {
854+
} else if ([value isKindOfClass:[FGMPlatformTileOverlay class]]) {
854855
[self writeByte:140];
855856
[self writeValue:[value toList]];
856-
} else if ([value isKindOfClass:[FGMPlatformLatLng class]]) {
857+
} else if ([value isKindOfClass:[FGMPlatformEdgeInsets class]]) {
857858
[self writeByte:141];
858859
[self writeValue:[value toList]];
859-
} else if ([value isKindOfClass:[FGMPlatformLatLngBounds class]]) {
860+
} else if ([value isKindOfClass:[FGMPlatformLatLng class]]) {
860861
[self writeByte:142];
861862
[self writeValue:[value toList]];
862-
} else if ([value isKindOfClass:[FGMPlatformCameraTargetBounds class]]) {
863+
} else if ([value isKindOfClass:[FGMPlatformLatLngBounds class]]) {
863864
[self writeByte:143];
864865
[self writeValue:[value toList]];
865-
} else if ([value isKindOfClass:[FGMPlatformMapViewCreationParams class]]) {
866+
} else if ([value isKindOfClass:[FGMPlatformCameraTargetBounds class]]) {
866867
[self writeByte:144];
867868
[self writeValue:[value toList]];
868-
} else if ([value isKindOfClass:[FGMPlatformMapConfiguration class]]) {
869+
} else if ([value isKindOfClass:[FGMPlatformMapViewCreationParams class]]) {
869870
[self writeByte:145];
870871
[self writeValue:[value toList]];
871-
} else if ([value isKindOfClass:[FGMPlatformPoint class]]) {
872+
} else if ([value isKindOfClass:[FGMPlatformMapConfiguration class]]) {
872873
[self writeByte:146];
873874
[self writeValue:[value toList]];
874-
} else if ([value isKindOfClass:[FGMPlatformTileLayer class]]) {
875+
} else if ([value isKindOfClass:[FGMPlatformPoint class]]) {
875876
[self writeByte:147];
876877
[self writeValue:[value toList]];
877-
} else if ([value isKindOfClass:[FGMPlatformZoomRange class]]) {
878+
} else if ([value isKindOfClass:[FGMPlatformTileLayer class]]) {
878879
[self writeByte:148];
879880
[self writeValue:[value toList]];
880-
} else if ([value isKindOfClass:[FGMPlatformMapTypeBox class]]) {
881-
FGMPlatformMapTypeBox *box = (FGMPlatformMapTypeBox *)value;
881+
} else if ([value isKindOfClass:[FGMPlatformZoomRange class]]) {
882882
[self writeByte:149];
883-
[self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])];
883+
[self writeValue:[value toList]];
884884
} else {
885885
[super writeValue:value];
886886
}

packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_map_inspector_ios.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ class GoogleMapsInspectorIOS extends GoogleMapsInspectorPlatform {
137137
}) async {
138138
return (await _inspectorProvider(mapId)!
139139
.getClusters(clusterManagerId.value))
140-
// See comment in messages.dart for why the force unwrap is okay.
141-
.map((PlatformCluster? cluster) =>
142-
GoogleMapsFlutterIOS.clusterFromPlatformCluster(cluster!))
140+
.map((PlatformCluster cluster) =>
141+
GoogleMapsFlutterIOS.clusterFromPlatformCluster(cluster))
143142
.toList();
144143
}
145144
}

0 commit comments

Comments
 (0)