diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md index faa4b3b62a9..532ebd289c6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 2.15.3 +* Fixes new analysis warnings. * Updates minimum supported SDK version to Flutter 3.27/Dart 3.6. ## 2.15.2 diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FGMImageUtils.h b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FGMImageUtils.h index 8aa1bcb6793..d88da5ff3d0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FGMImageUtils.h +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FGMImageUtils.h @@ -9,8 +9,9 @@ NS_ASSUME_NONNULL_BEGIN /// Creates a UIImage from Pigeon bitmap. -UIImage *FGMIconFromBitmap(FGMPlatformBitmap *platformBitmap, - NSObject *registrar, CGFloat screenScale); +UIImage *_Nullable FGMIconFromBitmap(FGMPlatformBitmap *platformBitmap, + NSObject *registrar, + CGFloat screenScale); /// Returns a BOOL indicating whether image is considered scalable with the given scale factor from /// size. BOOL FGMIsScalableWithScaleFactorFromSize(CGSize originalSize, CGSize targetSize); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FGMImageUtils.m b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FGMImageUtils.m index 3830ea28f60..9b5c1f8ec53 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FGMImageUtils.m +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FGMImageUtils.m @@ -191,18 +191,18 @@ UIImage *scaledImageWithWidthHeight(UIImage *image, NSNumber *width, NSNumber *height, CGFloat screenScale) { - if (!width && !height) { + if ((width == nil) && (height == nil)) { return image; } - CGFloat targetWidth = width ? width.doubleValue : image.size.width; - CGFloat targetHeight = height ? height.doubleValue : image.size.height; + CGFloat targetWidth = width == nil ? image.size.width : width.doubleValue; + CGFloat targetHeight = height == nil ? image.size.height : height.doubleValue; - if (width && !height) { + if ((width != nil) && (height == nil)) { // Calculate height based on aspect ratio if only width is provided. double aspectRatio = image.size.height / image.size.width; targetHeight = round(targetWidth * aspectRatio); - } else if (!width && height) { + } else if ((width == nil) && (height != nil)) { // Calculate width based on aspect ratio if only height is provided. double aspectRatio = image.size.width / image.size.height; targetWidth = round(targetHeight * aspectRatio); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m index 6844a67fb9b..5e10afdccf2 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m @@ -436,19 +436,19 @@ - (void)interpretMapConfiguration:(FGMPlatformMapConfiguration *)config { : nil]; } NSNumber *compassEnabled = config.compassEnabled; - if (compassEnabled) { + if (compassEnabled != nil) { [self setCompassEnabled:compassEnabled.boolValue]; } NSNumber *indoorEnabled = config.indoorViewEnabled; - if (indoorEnabled) { + if (indoorEnabled != nil) { [self setIndoorEnabled:indoorEnabled.boolValue]; } NSNumber *trafficEnabled = config.trafficEnabled; - if (trafficEnabled) { + if (trafficEnabled != nil) { [self setTrafficEnabled:trafficEnabled.boolValue]; } NSNumber *buildingsEnabled = config.buildingsEnabled; - if (buildingsEnabled) { + if (buildingsEnabled != nil) { [self setBuildingsEnabled:buildingsEnabled.boolValue]; } FGMPlatformMapTypeBox *mapType = config.mapType; @@ -457,8 +457,8 @@ - (void)interpretMapConfiguration:(FGMPlatformMapConfiguration *)config { } FGMPlatformZoomRange *zoomData = config.minMaxZoomPreference; if (zoomData) { - float minZoom = zoomData.min ? zoomData.min.floatValue : kGMSMinZoomLevel; - float maxZoom = zoomData.max ? zoomData.max.floatValue : kGMSMaxZoomLevel; + float minZoom = zoomData.min != nil ? zoomData.min.floatValue : kGMSMinZoomLevel; + float maxZoom = zoomData.max != nil ? zoomData.max.floatValue : kGMSMaxZoomLevel; [self setMinZoom:minZoom maxZoom:maxZoom]; } FGMPlatformEdgeInsets *padding = config.padding; @@ -467,31 +467,31 @@ - (void)interpretMapConfiguration:(FGMPlatformMapConfiguration *)config { } NSNumber *rotateGesturesEnabled = config.rotateGesturesEnabled; - if (rotateGesturesEnabled) { + if (rotateGesturesEnabled != nil) { [self setRotateGesturesEnabled:rotateGesturesEnabled.boolValue]; } NSNumber *scrollGesturesEnabled = config.scrollGesturesEnabled; - if (scrollGesturesEnabled) { + if (scrollGesturesEnabled != nil) { [self setScrollGesturesEnabled:scrollGesturesEnabled.boolValue]; } NSNumber *tiltGesturesEnabled = config.tiltGesturesEnabled; - if (tiltGesturesEnabled) { + if (tiltGesturesEnabled != nil) { [self setTiltGesturesEnabled:tiltGesturesEnabled.boolValue]; } NSNumber *trackCameraPosition = config.trackCameraPosition; - if (trackCameraPosition) { + if (trackCameraPosition != nil) { [self setTrackCameraPosition:trackCameraPosition.boolValue]; } NSNumber *zoomGesturesEnabled = config.zoomGesturesEnabled; - if (zoomGesturesEnabled) { + if (zoomGesturesEnabled != nil) { [self setZoomGesturesEnabled:zoomGesturesEnabled.boolValue]; } NSNumber *myLocationEnabled = config.myLocationEnabled; - if (myLocationEnabled) { + if (myLocationEnabled != nil) { [self setMyLocationEnabled:myLocationEnabled.boolValue]; } NSNumber *myLocationButtonEnabled = config.myLocationButtonEnabled; - if (myLocationButtonEnabled) { + if (myLocationButtonEnabled != nil) { [self setMyLocationButtonEnabled:myLocationButtonEnabled.boolValue]; } NSString *style = config.style; @@ -665,7 +665,8 @@ - (void)animateCameraWithUpdate:(nonnull FGMPlatformCameraUpdate *)cameraUpdate details:nil]; return; } - FGMCATransactionWrapper *transaction = durationMilliseconds ? self.transactionWrapper : nil; + FGMCATransactionWrapper *transaction = + durationMilliseconds != nil ? self.transactionWrapper : nil; [transaction begin]; [transaction setAnimationDuration:[durationMilliseconds doubleValue] / 1000]; [self.controller.mapView animateWithCameraUpdate:update]; diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml index 08ef36c1402..f7397a4ddc3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_ios description: iOS implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.15.2 +version: 2.15.3 environment: sdk: ^3.6.0