Skip to content

Commit 0834c76

Browse files
jmagmanPark Sung Min
authored and
Park Sung Min
committed
[google_maps_flutter] Define clang module for iOS, fix analyzer warnings (flutter#2182)
1 parent e29766e commit 0834c76

11 files changed

+51
-54
lines changed

packages/google_maps_flutter/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.21+11
2+
3+
* Define clang module for iOS, fix analyzer warnings.
4+
15
## 0.5.21+10
26

37
* Cast error.code to unsigned long to avoid using NSInteger as %ld format warnings.

packages/google_maps_flutter/example/ios/Runner/AppDelegate.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#include "AppDelegate.h"
2-
#include "GeneratedPluginRegistrant.h"
3-
#import "GoogleMaps/GoogleMaps.h"
1+
#import "AppDelegate.h"
2+
#import "GeneratedPluginRegistrant.h"
3+
4+
@import GoogleMaps;
45

56
@implementation AppDelegate
67

packages/google_maps_flutter/ios/Classes/GoogleMapCircleController.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ static CLLocationDistance ToDistance(NSNumber* data) {
7373
static void InterpretCircleOptions(NSDictionary* data, id<FLTGoogleMapCircleOptionsSink> sink,
7474
NSObject<FlutterPluginRegistrar>* registrar) {
7575
NSNumber* consumeTapEvents = data[@"consumeTapEvents"];
76-
if (consumeTapEvents) {
76+
if (consumeTapEvents != nil) {
7777
[sink setConsumeTapEvents:ToBool(consumeTapEvents)];
7878
}
7979

8080
NSNumber* visible = data[@"visible"];
81-
if (visible) {
81+
if (visible != nil) {
8282
[sink setVisible:ToBool(visible)];
8383
}
8484

8585
NSNumber* zIndex = data[@"zIndex"];
86-
if (zIndex) {
86+
if (zIndex != nil) {
8787
[sink setZIndex:ToInt(zIndex)];
8888
}
8989

@@ -93,22 +93,22 @@ static void InterpretCircleOptions(NSDictionary* data, id<FLTGoogleMapCircleOpti
9393
}
9494

9595
NSNumber* radius = data[@"radius"];
96-
if (radius) {
96+
if (radius != nil) {
9797
[sink setRadius:ToDistance(radius)];
9898
}
9999

100100
NSNumber* strokeColor = data[@"strokeColor"];
101-
if (strokeColor) {
101+
if (strokeColor != nil) {
102102
[sink setStrokeColor:ToColor(strokeColor)];
103103
}
104104

105105
NSNumber* strokeWidth = data[@"strokeWidth"];
106-
if (strokeWidth) {
106+
if (strokeWidth != nil) {
107107
[sink setStrokeWidth:ToInt(strokeWidth)];
108108
}
109109

110110
NSNumber* fillColor = data[@"fillColor"];
111-
if (fillColor) {
111+
if (fillColor != nil) {
112112
[sink setFillColor:ToColor(fillColor)];
113113
}
114114
}

packages/google_maps_flutter/ios/Classes/GoogleMapController.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
1313

1414
// Defines map UI options writable from Flutter.
1515
@protocol FLTGoogleMapOptionsSink
16-
- (void)setCameraTargetBounds:(GMSCoordinateBounds *)bounds;
16+
- (void)setCameraTargetBounds:(nullable GMSCoordinateBounds *)bounds;
1717
- (void)setCompassEnabled:(BOOL)enabled;
1818
- (void)setIndoorEnabled:(BOOL)enabled;
1919
- (void)setTrafficEnabled:(BOOL)enabled;
@@ -27,26 +27,26 @@ NS_ASSUME_NONNULL_BEGIN
2727
- (void)setZoomGesturesEnabled:(BOOL)enabled;
2828
- (void)setMyLocationEnabled:(BOOL)enabled;
2929
- (void)setMyLocationButtonEnabled:(BOOL)enabled;
30-
- (NSString *)setMapStyle:(NSString *)mapStyle;
30+
- (nullable NSString *)setMapStyle:(NSString *)mapStyle;
3131
@end
3232

3333
// Defines map overlay controllable from Flutter.
3434
@interface FLTGoogleMapController
3535
: NSObject <GMSMapViewDelegate, FLTGoogleMapOptionsSink, FlutterPlatformView>
3636
- (instancetype)initWithFrame:(CGRect)frame
3737
viewIdentifier:(int64_t)viewId
38-
arguments:(id _Nullable)args
38+
arguments:(nullable id)args
3939
registrar:(NSObject<FlutterPluginRegistrar> *)registrar;
4040
- (void)showAtX:(CGFloat)x Y:(CGFloat)y;
4141
- (void)hide;
4242
- (void)animateWithCameraUpdate:(GMSCameraUpdate *)cameraUpdate;
4343
- (void)moveWithCameraUpdate:(GMSCameraUpdate *)cameraUpdate;
44-
- (GMSCameraPosition *)cameraPosition;
44+
- (nullable GMSCameraPosition *)cameraPosition;
4545
@end
4646

4747
// Allows the engine to create new Google Map instances.
4848
@interface FLTGoogleMapFactory : NSObject <FlutterPlatformViewFactory>
4949
- (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar;
5050
@end
5151

52-
NS_ASSUME_NONNULL_END
52+
NS_ASSUME_NONNULL_END

packages/google_maps_flutter/ios/Classes/GoogleMapController.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ - (instancetype)initWithFrame:(CGRect)frame
6565
viewIdentifier:(int64_t)viewId
6666
arguments:(id _Nullable)args
6767
registrar:(NSObject<FlutterPluginRegistrar>*)registrar {
68-
if ([super init]) {
68+
if (self = [super init]) {
6969
_viewId = viewId;
7070

7171
GMSCameraPosition* camera = ToOptionalCameraPosition(args[@"initialCameraPosition"]);
@@ -543,7 +543,7 @@ static void InterpretMapOptions(NSDictionary* data, id<FLTGoogleMapOptionsSink>
543543
[sink setCameraTargetBounds:ToOptionalBounds(cameraTargetBounds)];
544544
}
545545
NSNumber* compassEnabled = data[@"compassEnabled"];
546-
if (compassEnabled) {
546+
if (compassEnabled != nil) {
547547
[sink setCompassEnabled:ToBool(compassEnabled)];
548548
}
549549
id indoorEnabled = data[@"indoorEnabled"];
@@ -574,31 +574,31 @@ static void InterpretMapOptions(NSDictionary* data, id<FLTGoogleMapOptionsSink>
574574
}
575575

576576
NSNumber* rotateGesturesEnabled = data[@"rotateGesturesEnabled"];
577-
if (rotateGesturesEnabled) {
577+
if (rotateGesturesEnabled != nil) {
578578
[sink setRotateGesturesEnabled:ToBool(rotateGesturesEnabled)];
579579
}
580580
NSNumber* scrollGesturesEnabled = data[@"scrollGesturesEnabled"];
581-
if (scrollGesturesEnabled) {
581+
if (scrollGesturesEnabled != nil) {
582582
[sink setScrollGesturesEnabled:ToBool(scrollGesturesEnabled)];
583583
}
584584
NSNumber* tiltGesturesEnabled = data[@"tiltGesturesEnabled"];
585-
if (tiltGesturesEnabled) {
585+
if (tiltGesturesEnabled != nil) {
586586
[sink setTiltGesturesEnabled:ToBool(tiltGesturesEnabled)];
587587
}
588588
NSNumber* trackCameraPosition = data[@"trackCameraPosition"];
589-
if (trackCameraPosition) {
589+
if (trackCameraPosition != nil) {
590590
[sink setTrackCameraPosition:ToBool(trackCameraPosition)];
591591
}
592592
NSNumber* zoomGesturesEnabled = data[@"zoomGesturesEnabled"];
593-
if (zoomGesturesEnabled) {
593+
if (zoomGesturesEnabled != nil) {
594594
[sink setZoomGesturesEnabled:ToBool(zoomGesturesEnabled)];
595595
}
596596
NSNumber* myLocationEnabled = data[@"myLocationEnabled"];
597-
if (myLocationEnabled) {
597+
if (myLocationEnabled != nil) {
598598
[sink setMyLocationEnabled:ToBool(myLocationEnabled)];
599599
}
600600
NSNumber* myLocationButtonEnabled = data[@"myLocationButtonEnabled"];
601-
if (myLocationButtonEnabled) {
601+
if (myLocationButtonEnabled != nil) {
602602
[sink setMyLocationButtonEnabled:ToBool(myLocationButtonEnabled)];
603603
}
604604
}

packages/google_maps_flutter/ios/Classes/GoogleMapMarkerController.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ static CLLocationCoordinate2D ToLocation(NSArray* data) {
9595
static void InterpretMarkerOptions(NSDictionary* data, id<FLTGoogleMapMarkerOptionsSink> sink,
9696
NSObject<FlutterPluginRegistrar>* registrar) {
9797
NSNumber* alpha = data[@"alpha"];
98-
if (alpha) {
98+
if (alpha != nil) {
9999
[sink setAlpha:ToFloat(alpha)];
100100
}
101101
NSArray* anchor = data[@"anchor"];
102102
if (anchor) {
103103
[sink setAnchor:ToPoint(anchor)];
104104
}
105105
NSNumber* draggable = data[@"draggable"];
106-
if (draggable) {
106+
if (draggable != nil) {
107107
[sink setDraggable:ToBool(draggable)];
108108
}
109109
NSArray* icon = data[@"icon"];
@@ -112,11 +112,11 @@ static void InterpretMarkerOptions(NSDictionary* data, id<FLTGoogleMapMarkerOpti
112112
[sink setIcon:image];
113113
}
114114
NSNumber* flat = data[@"flat"];
115-
if (flat) {
115+
if (flat != nil) {
116116
[sink setFlat:ToBool(flat)];
117117
}
118118
NSNumber* consumeTapEvents = data[@"consumeTapEvents"];
119-
if (consumeTapEvents) {
119+
if (consumeTapEvents != nil) {
120120
[sink setConsumeTapEvents:ToBool(consumeTapEvents)];
121121
}
122122
InterpretInfoWindow(sink, data);
@@ -125,15 +125,15 @@ static void InterpretMarkerOptions(NSDictionary* data, id<FLTGoogleMapMarkerOpti
125125
[sink setPosition:ToLocation(position)];
126126
}
127127
NSNumber* rotation = data[@"rotation"];
128-
if (rotation) {
128+
if (rotation != nil) {
129129
[sink setRotation:ToDouble(rotation)];
130130
}
131131
NSNumber* visible = data[@"visible"];
132-
if (visible) {
132+
if (visible != nil) {
133133
[sink setVisible:ToBool(visible)];
134134
}
135135
NSNumber* zIndex = data[@"zIndex"];
136-
if (zIndex) {
136+
if (zIndex != nil) {
137137
[sink setZIndex:ToInt(zIndex)];
138138
}
139139
}

packages/google_maps_flutter/ios/Classes/GoogleMapPolygonController.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ - (void)setStrokeWidth:(CGFloat)width {
7070
static void InterpretPolygonOptions(NSDictionary* data, id<FLTGoogleMapPolygonOptionsSink> sink,
7171
NSObject<FlutterPluginRegistrar>* registrar) {
7272
NSNumber* consumeTapEvents = data[@"consumeTapEvents"];
73-
if (consumeTapEvents) {
73+
if (consumeTapEvents != nil) {
7474
[sink setConsumeTapEvents:ToBool(consumeTapEvents)];
7575
}
7676

7777
NSNumber* visible = data[@"visible"];
78-
if (visible) {
78+
if (visible != nil) {
7979
[sink setVisible:ToBool(visible)];
8080
}
8181

8282
NSNumber* zIndex = data[@"zIndex"];
83-
if (zIndex) {
83+
if (zIndex != nil) {
8484
[sink setZIndex:ToInt(zIndex)];
8585
}
8686

@@ -90,17 +90,17 @@ static void InterpretPolygonOptions(NSDictionary* data, id<FLTGoogleMapPolygonOp
9090
}
9191

9292
NSNumber* fillColor = data[@"fillColor"];
93-
if (fillColor) {
93+
if (fillColor != nil) {
9494
[sink setFillColor:ToColor(fillColor)];
9595
}
9696

9797
NSNumber* strokeColor = data[@"strokeColor"];
98-
if (strokeColor) {
98+
if (strokeColor != nil) {
9999
[sink setStrokeColor:ToColor(strokeColor)];
100100
}
101101

102102
NSNumber* strokeWidth = data[@"strokeWidth"];
103-
if (strokeWidth) {
103+
if (strokeWidth != nil) {
104104
[sink setStrokeWidth:ToInt(strokeWidth)];
105105
}
106106
}

packages/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ - (void)setStrokeWidth:(CGFloat)width {
6767
static void InterpretPolylineOptions(NSDictionary* data, id<FLTGoogleMapPolylineOptionsSink> sink,
6868
NSObject<FlutterPluginRegistrar>* registrar) {
6969
NSNumber* consumeTapEvents = data[@"consumeTapEvents"];
70-
if (consumeTapEvents) {
70+
if (consumeTapEvents != nil) {
7171
[sink setConsumeTapEvents:ToBool(consumeTapEvents)];
7272
}
7373

7474
NSNumber* visible = data[@"visible"];
75-
if (visible) {
75+
if (visible != nil) {
7676
[sink setVisible:ToBool(visible)];
7777
}
7878

7979
NSNumber* zIndex = data[@"zIndex"];
80-
if (zIndex) {
80+
if (zIndex != nil) {
8181
[sink setZIndex:ToInt(zIndex)];
8282
}
8383

@@ -87,12 +87,12 @@ static void InterpretPolylineOptions(NSDictionary* data, id<FLTGoogleMapPolyline
8787
}
8888

8989
NSNumber* strokeColor = data[@"color"];
90-
if (strokeColor) {
90+
if (strokeColor != nil) {
9191
[sink setColor:ToColor(strokeColor)];
9292
}
9393

9494
NSNumber* strokeWidth = data[@"width"];
95-
if (strokeWidth) {
95+
if (strokeWidth != nil) {
9696
[sink setStrokeWidth:ToInt(strokeWidth)];
9797
}
9898
}

packages/google_maps_flutter/ios/google_maps_flutter.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A new flutter plugin project.
1616
s.public_header_files = 'Classes/**/*.h'
1717
s.dependency 'Flutter'
1818
s.dependency 'GoogleMaps'
19-
s.compiler_flags = '-fno-modules'
2019
s.static_framework = true
21-
s.ios.deployment_target = '8.0'
20+
s.platform = :ios, '8.0'
21+
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
2222
end

packages/google_maps_flutter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_maps_flutter
22
description: A Flutter plugin for integrating Google Maps in iOS and Android applications.
33
author: Flutter Team <[email protected]>
44
homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter
5-
version: 0.5.21+10
5+
version: 0.5.21+11
66

77
dependencies:
88
flutter:

script/lint_darwin_plugins.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,8 @@ function lint_packages() {
7070
return
7171
fi
7272

73-
# TODO: These packages have linter errors. Remove plugins from this list as linter issues are fixed.
74-
local skipped_packages=(
75-
'google_maps_flutter'
76-
)
77-
7873
local failure_count=0
79-
for package_name in "$@"; do
80-
if [[ "${skipped_packages[*]}" =~ "${package_name}" ]]; then
81-
continue
82-
fi
74+
for package_name in "$@"; do
8375
lint_package "${package_name}"
8476
failure_count+="$?"
8577
done

0 commit comments

Comments
 (0)