diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.h b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.h index f96bd244504d..fa8ea9117533 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.h +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.h @@ -31,4 +31,13 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithRegistrar:(NSObject *)registrar; @end +/// Implementation of the Pigeon maps API. +/// +/// This is a separate object from the maps controller because the Pigeon API registration keeps a +/// strong reference to the implementor, but as the FlutterPlatformView, the lifetime of the +/// FLTGoogleMapController instance is what needs to trigger Pigeon unregistration, so can't be +/// the target of the registration. +@interface FGMMapCallHandler : NSObject +@end + NS_ASSUME_NONNULL_END 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 f796fe6eff71..d658782a4fae 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 @@ -64,21 +64,12 @@ - (instancetype)initWithRegistrar:(NSObject *)registrar #pragma mark - -/// Implementation of the Pigeon maps API. -/// -/// This is a separate object from the maps controller because the Pigeon API registration keeps a -/// strong reference to the implementor, but as the FlutterPlatformView, the lifetime of the -/// FLTGoogleMapController instance is what needs to trigger Pigeon unregistration, so can't be -/// the target of the registration. -@interface FGMMapCallHandler : NSObject +/// Private declarations of the FGMMapCallHandler. +@interface FGMMapCallHandler () - (instancetype)initWithMapController:(nonnull FLTGoogleMapController *)controller messenger:(NSObject *)messenger pigeonSuffix:(NSString *)suffix; -@end -/// Private declarations. -// This is separate in case the above is made public in the future (e.g., for unit testing). -@interface FGMMapCallHandler () /// The map controller this inspector corresponds to. @property(nonatomic, weak) FLTGoogleMapController *controller; /// The messenger this instance was registered with by Pigeon. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController_Test.h b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController_Test.h index 466ad0926679..d136d90effa6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController_Test.h +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController_Test.h @@ -4,11 +4,14 @@ #import #import + #import "FGMCATransactionWrapper.h" +#import "GoogleMapController.h" NS_ASSUME_NONNULL_BEGIN -@interface FGMMapCallHandler : NSObject +/// Exposes internal properties of FGMMapCallHandler for unit testing. +@interface FGMMapCallHandler (Test) /// Transaction wrapper for CATransaction to allow mocking in tests. @property(nonatomic, strong) id transactionWrapper;