[google_maps_flutter] Define clang module for iOS, fix analyzer warnings (#2182)

diff --git a/packages/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/CHANGELOG.md
index 2c83c64..6ea0469 100644
--- a/packages/google_maps_flutter/CHANGELOG.md
+++ b/packages/google_maps_flutter/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.5.21+11
+
+* Define clang module for iOS, fix analyzer warnings.
+
 ## 0.5.21+10
 
 * Cast error.code to unsigned long to avoid using NSInteger as %ld format warnings.
diff --git a/packages/google_maps_flutter/example/ios/Runner/AppDelegate.m b/packages/google_maps_flutter/example/ios/Runner/AppDelegate.m
index 893deae..6896c5c 100644
--- a/packages/google_maps_flutter/example/ios/Runner/AppDelegate.m
+++ b/packages/google_maps_flutter/example/ios/Runner/AppDelegate.m
@@ -1,6 +1,7 @@
-#include "AppDelegate.h"
-#include "GeneratedPluginRegistrant.h"
-#import "GoogleMaps/GoogleMaps.h"
+#import "AppDelegate.h"
+#import "GeneratedPluginRegistrant.h"
+
+@import GoogleMaps;
 
 @implementation AppDelegate
 
diff --git a/packages/google_maps_flutter/ios/Classes/GoogleMapCircleController.m b/packages/google_maps_flutter/ios/Classes/GoogleMapCircleController.m
index 92e9512..6688d4d 100644
--- a/packages/google_maps_flutter/ios/Classes/GoogleMapCircleController.m
+++ b/packages/google_maps_flutter/ios/Classes/GoogleMapCircleController.m
@@ -73,17 +73,17 @@
 static void InterpretCircleOptions(NSDictionary* data, id<FLTGoogleMapCircleOptionsSink> sink,
                                    NSObject<FlutterPluginRegistrar>* registrar) {
   NSNumber* consumeTapEvents = data[@"consumeTapEvents"];
-  if (consumeTapEvents) {
+  if (consumeTapEvents != nil) {
     [sink setConsumeTapEvents:ToBool(consumeTapEvents)];
   }
 
   NSNumber* visible = data[@"visible"];
-  if (visible) {
+  if (visible != nil) {
     [sink setVisible:ToBool(visible)];
   }
 
   NSNumber* zIndex = data[@"zIndex"];
-  if (zIndex) {
+  if (zIndex != nil) {
     [sink setZIndex:ToInt(zIndex)];
   }
 
@@ -93,22 +93,22 @@
   }
 
   NSNumber* radius = data[@"radius"];
-  if (radius) {
+  if (radius != nil) {
     [sink setRadius:ToDistance(radius)];
   }
 
   NSNumber* strokeColor = data[@"strokeColor"];
-  if (strokeColor) {
+  if (strokeColor != nil) {
     [sink setStrokeColor:ToColor(strokeColor)];
   }
 
   NSNumber* strokeWidth = data[@"strokeWidth"];
-  if (strokeWidth) {
+  if (strokeWidth != nil) {
     [sink setStrokeWidth:ToInt(strokeWidth)];
   }
 
   NSNumber* fillColor = data[@"fillColor"];
-  if (fillColor) {
+  if (fillColor != nil) {
     [sink setFillColor:ToColor(fillColor)];
   }
 }
diff --git a/packages/google_maps_flutter/ios/Classes/GoogleMapController.h b/packages/google_maps_flutter/ios/Classes/GoogleMapController.h
index 339f789..a94a248 100644
--- a/packages/google_maps_flutter/ios/Classes/GoogleMapController.h
+++ b/packages/google_maps_flutter/ios/Classes/GoogleMapController.h
@@ -13,7 +13,7 @@
 
 // Defines map UI options writable from Flutter.
 @protocol FLTGoogleMapOptionsSink
-- (void)setCameraTargetBounds:(GMSCoordinateBounds *)bounds;
+- (void)setCameraTargetBounds:(nullable GMSCoordinateBounds *)bounds;
 - (void)setCompassEnabled:(BOOL)enabled;
 - (void)setIndoorEnabled:(BOOL)enabled;
 - (void)setTrafficEnabled:(BOOL)enabled;
@@ -27,7 +27,7 @@
 - (void)setZoomGesturesEnabled:(BOOL)enabled;
 - (void)setMyLocationEnabled:(BOOL)enabled;
 - (void)setMyLocationButtonEnabled:(BOOL)enabled;
-- (NSString *)setMapStyle:(NSString *)mapStyle;
+- (nullable NSString *)setMapStyle:(NSString *)mapStyle;
 @end
 
 // Defines map overlay controllable from Flutter.
@@ -35,13 +35,13 @@
     : NSObject <GMSMapViewDelegate, FLTGoogleMapOptionsSink, FlutterPlatformView>
 - (instancetype)initWithFrame:(CGRect)frame
                viewIdentifier:(int64_t)viewId
-                    arguments:(id _Nullable)args
+                    arguments:(nullable id)args
                     registrar:(NSObject<FlutterPluginRegistrar> *)registrar;
 - (void)showAtX:(CGFloat)x Y:(CGFloat)y;
 - (void)hide;
 - (void)animateWithCameraUpdate:(GMSCameraUpdate *)cameraUpdate;
 - (void)moveWithCameraUpdate:(GMSCameraUpdate *)cameraUpdate;
-- (GMSCameraPosition *)cameraPosition;
+- (nullable GMSCameraPosition *)cameraPosition;
 @end
 
 // Allows the engine to create new Google Map instances.
@@ -49,4 +49,4 @@
 - (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar;
 @end
 
-NS_ASSUME_NONNULL_END
\ No newline at end of file
+NS_ASSUME_NONNULL_END
diff --git a/packages/google_maps_flutter/ios/Classes/GoogleMapController.m b/packages/google_maps_flutter/ios/Classes/GoogleMapController.m
index 70a278a..ce85887 100644
--- a/packages/google_maps_flutter/ios/Classes/GoogleMapController.m
+++ b/packages/google_maps_flutter/ios/Classes/GoogleMapController.m
@@ -65,7 +65,7 @@
                viewIdentifier:(int64_t)viewId
                     arguments:(id _Nullable)args
                     registrar:(NSObject<FlutterPluginRegistrar>*)registrar {
-  if ([super init]) {
+  if (self = [super init]) {
     _viewId = viewId;
 
     GMSCameraPosition* camera = ToOptionalCameraPosition(args[@"initialCameraPosition"]);
@@ -543,7 +543,7 @@
     [sink setCameraTargetBounds:ToOptionalBounds(cameraTargetBounds)];
   }
   NSNumber* compassEnabled = data[@"compassEnabled"];
-  if (compassEnabled) {
+  if (compassEnabled != nil) {
     [sink setCompassEnabled:ToBool(compassEnabled)];
   }
   id indoorEnabled = data[@"indoorEnabled"];
@@ -574,31 +574,31 @@
   }
 
   NSNumber* rotateGesturesEnabled = data[@"rotateGesturesEnabled"];
-  if (rotateGesturesEnabled) {
+  if (rotateGesturesEnabled != nil) {
     [sink setRotateGesturesEnabled:ToBool(rotateGesturesEnabled)];
   }
   NSNumber* scrollGesturesEnabled = data[@"scrollGesturesEnabled"];
-  if (scrollGesturesEnabled) {
+  if (scrollGesturesEnabled != nil) {
     [sink setScrollGesturesEnabled:ToBool(scrollGesturesEnabled)];
   }
   NSNumber* tiltGesturesEnabled = data[@"tiltGesturesEnabled"];
-  if (tiltGesturesEnabled) {
+  if (tiltGesturesEnabled != nil) {
     [sink setTiltGesturesEnabled:ToBool(tiltGesturesEnabled)];
   }
   NSNumber* trackCameraPosition = data[@"trackCameraPosition"];
-  if (trackCameraPosition) {
+  if (trackCameraPosition != nil) {
     [sink setTrackCameraPosition:ToBool(trackCameraPosition)];
   }
   NSNumber* zoomGesturesEnabled = data[@"zoomGesturesEnabled"];
-  if (zoomGesturesEnabled) {
+  if (zoomGesturesEnabled != nil) {
     [sink setZoomGesturesEnabled:ToBool(zoomGesturesEnabled)];
   }
   NSNumber* myLocationEnabled = data[@"myLocationEnabled"];
-  if (myLocationEnabled) {
+  if (myLocationEnabled != nil) {
     [sink setMyLocationEnabled:ToBool(myLocationEnabled)];
   }
   NSNumber* myLocationButtonEnabled = data[@"myLocationButtonEnabled"];
-  if (myLocationButtonEnabled) {
+  if (myLocationButtonEnabled != nil) {
     [sink setMyLocationButtonEnabled:ToBool(myLocationButtonEnabled)];
   }
 }
diff --git a/packages/google_maps_flutter/ios/Classes/GoogleMapMarkerController.m b/packages/google_maps_flutter/ios/Classes/GoogleMapMarkerController.m
index 2f0d4a9..76a420f 100644
--- a/packages/google_maps_flutter/ios/Classes/GoogleMapMarkerController.m
+++ b/packages/google_maps_flutter/ios/Classes/GoogleMapMarkerController.m
@@ -95,7 +95,7 @@
 static void InterpretMarkerOptions(NSDictionary* data, id<FLTGoogleMapMarkerOptionsSink> sink,
                                    NSObject<FlutterPluginRegistrar>* registrar) {
   NSNumber* alpha = data[@"alpha"];
-  if (alpha) {
+  if (alpha != nil) {
     [sink setAlpha:ToFloat(alpha)];
   }
   NSArray* anchor = data[@"anchor"];
@@ -103,7 +103,7 @@
     [sink setAnchor:ToPoint(anchor)];
   }
   NSNumber* draggable = data[@"draggable"];
-  if (draggable) {
+  if (draggable != nil) {
     [sink setDraggable:ToBool(draggable)];
   }
   NSArray* icon = data[@"icon"];
@@ -112,11 +112,11 @@
     [sink setIcon:image];
   }
   NSNumber* flat = data[@"flat"];
-  if (flat) {
+  if (flat != nil) {
     [sink setFlat:ToBool(flat)];
   }
   NSNumber* consumeTapEvents = data[@"consumeTapEvents"];
-  if (consumeTapEvents) {
+  if (consumeTapEvents != nil) {
     [sink setConsumeTapEvents:ToBool(consumeTapEvents)];
   }
   InterpretInfoWindow(sink, data);
@@ -125,15 +125,15 @@
     [sink setPosition:ToLocation(position)];
   }
   NSNumber* rotation = data[@"rotation"];
-  if (rotation) {
+  if (rotation != nil) {
     [sink setRotation:ToDouble(rotation)];
   }
   NSNumber* visible = data[@"visible"];
-  if (visible) {
+  if (visible != nil) {
     [sink setVisible:ToBool(visible)];
   }
   NSNumber* zIndex = data[@"zIndex"];
-  if (zIndex) {
+  if (zIndex != nil) {
     [sink setZIndex:ToInt(zIndex)];
   }
 }
diff --git a/packages/google_maps_flutter/ios/Classes/GoogleMapPolygonController.m b/packages/google_maps_flutter/ios/Classes/GoogleMapPolygonController.m
index 4bc4f17..678d40e 100644
--- a/packages/google_maps_flutter/ios/Classes/GoogleMapPolygonController.m
+++ b/packages/google_maps_flutter/ios/Classes/GoogleMapPolygonController.m
@@ -70,17 +70,17 @@
 static void InterpretPolygonOptions(NSDictionary* data, id<FLTGoogleMapPolygonOptionsSink> sink,
                                     NSObject<FlutterPluginRegistrar>* registrar) {
   NSNumber* consumeTapEvents = data[@"consumeTapEvents"];
-  if (consumeTapEvents) {
+  if (consumeTapEvents != nil) {
     [sink setConsumeTapEvents:ToBool(consumeTapEvents)];
   }
 
   NSNumber* visible = data[@"visible"];
-  if (visible) {
+  if (visible != nil) {
     [sink setVisible:ToBool(visible)];
   }
 
   NSNumber* zIndex = data[@"zIndex"];
-  if (zIndex) {
+  if (zIndex != nil) {
     [sink setZIndex:ToInt(zIndex)];
   }
 
@@ -90,17 +90,17 @@
   }
 
   NSNumber* fillColor = data[@"fillColor"];
-  if (fillColor) {
+  if (fillColor != nil) {
     [sink setFillColor:ToColor(fillColor)];
   }
 
   NSNumber* strokeColor = data[@"strokeColor"];
-  if (strokeColor) {
+  if (strokeColor != nil) {
     [sink setStrokeColor:ToColor(strokeColor)];
   }
 
   NSNumber* strokeWidth = data[@"strokeWidth"];
-  if (strokeWidth) {
+  if (strokeWidth != nil) {
     [sink setStrokeWidth:ToInt(strokeWidth)];
   }
 }
diff --git a/packages/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m b/packages/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m
index f593210..b701a5f 100644
--- a/packages/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m
+++ b/packages/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m
@@ -67,17 +67,17 @@
 static void InterpretPolylineOptions(NSDictionary* data, id<FLTGoogleMapPolylineOptionsSink> sink,
                                      NSObject<FlutterPluginRegistrar>* registrar) {
   NSNumber* consumeTapEvents = data[@"consumeTapEvents"];
-  if (consumeTapEvents) {
+  if (consumeTapEvents != nil) {
     [sink setConsumeTapEvents:ToBool(consumeTapEvents)];
   }
 
   NSNumber* visible = data[@"visible"];
-  if (visible) {
+  if (visible != nil) {
     [sink setVisible:ToBool(visible)];
   }
 
   NSNumber* zIndex = data[@"zIndex"];
-  if (zIndex) {
+  if (zIndex != nil) {
     [sink setZIndex:ToInt(zIndex)];
   }
 
@@ -87,12 +87,12 @@
   }
 
   NSNumber* strokeColor = data[@"color"];
-  if (strokeColor) {
+  if (strokeColor != nil) {
     [sink setColor:ToColor(strokeColor)];
   }
 
   NSNumber* strokeWidth = data[@"width"];
-  if (strokeWidth) {
+  if (strokeWidth != nil) {
     [sink setStrokeWidth:ToInt(strokeWidth)];
   }
 }
diff --git a/packages/google_maps_flutter/ios/google_maps_flutter.podspec b/packages/google_maps_flutter/ios/google_maps_flutter.podspec
index 4235dcf..c8fb83b 100644
--- a/packages/google_maps_flutter/ios/google_maps_flutter.podspec
+++ b/packages/google_maps_flutter/ios/google_maps_flutter.podspec
@@ -16,7 +16,7 @@
   s.public_header_files = 'Classes/**/*.h'
   s.dependency 'Flutter'
   s.dependency 'GoogleMaps'
-  s.compiler_flags = '-fno-modules'
   s.static_framework = true
-  s.ios.deployment_target = '8.0'
+  s.platform = :ios, '8.0'
+  s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
 end
diff --git a/packages/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/pubspec.yaml
index 3fed14e..fc683bb 100644
--- a/packages/google_maps_flutter/pubspec.yaml
+++ b/packages/google_maps_flutter/pubspec.yaml
@@ -2,7 +2,7 @@
 description: A Flutter plugin for integrating Google Maps in iOS and Android applications.
 author: Flutter Team <flutter-dev@googlegroups.com>
 homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter
-version: 0.5.21+10
+version: 0.5.21+11
 
 dependencies:
   flutter:
diff --git a/script/lint_darwin_plugins.sh b/script/lint_darwin_plugins.sh
index 94041c7..84c5f2a 100755
--- a/script/lint_darwin_plugins.sh
+++ b/script/lint_darwin_plugins.sh
@@ -70,16 +70,8 @@
     return
   fi
 
-  # TODO: These packages have linter errors. Remove plugins from this list as linter issues are fixed.
-  local skipped_packages=(
-    'google_maps_flutter'
-  )
-
   local failure_count=0
-  for package_name in "$@"; do
-    if [[ "${skipped_packages[*]}" =~ "${package_name}" ]]; then
-      continue
-    fi      
+  for package_name in "$@"; do   
     lint_package "${package_name}"
     failure_count+="$?"
   done