From eaa1388b11ac3ee6143ad782e573b9b9e314bc4b Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Mon, 19 Nov 2018 16:30:39 -0800 Subject: [PATCH] Reconfigure Cirrus to use clang 7 (#905) clang-format 5.0 formats ObjC files differently than newer versions, which results in the CI failing the format check for PRs formatted locally with a recent clang version. The latest clang version available on the Ubuntu repositories for the Cirrus machines is 7, upgrading to that seems to be consistent with what I locally get with clang-format 8.0. This PR also reformats all files with the new clang style. --- .cirrus.yml | 6 +- .../ios/Classes/AndroidAlarmManagerPlugin.h | 2 +- .../ios/Classes/AndroidIntentPlugin.h | 2 +- packages/battery/ios/Classes/BatteryPlugin.h | 2 +- packages/battery/ios/Classes/BatteryPlugin.m | 2 +- packages/camera/ios/Classes/CameraPlugin.h | 2 +- packages/camera/ios/Classes/CameraPlugin.m | 33 ++++--- .../ios/Classes/CloudFirestorePlugin.h | 2 +- .../ios/Classes/CloudFirestorePlugin.m | 33 ++++--- .../ios/Classes/CloudFunctionsPlugin.h | 2 +- .../ios/Classes/CloudFunctionsPlugin.m | 5 +- .../ios/Classes/ConnectivityPlugin.h | 2 +- .../ios/Classes/ConnectivityPlugin.m | 2 +- .../ios/Classes/DeviceInfoPlugin.h | 2 +- .../firebase_admob/ios/Classes/FLTMobileAd.h | 4 +- .../ios/Classes/FLTRequestFactory.m | 4 +- .../ios/Classes/FLTRewardedVideoAdWrapper.m | 2 +- .../ios/Classes/FirebaseAdMobPlugin.h | 5 +- .../ios/Classes/FirebaseAdMobPlugin.m | 7 +- .../ios/Classes/FirebaseAnalyticsPlugin.h | 2 +- .../ios/Classes/FirebaseAuthPlugin.h | 2 +- .../ios/Classes/FirebaseAuthPlugin.m | 97 ++++++++++--------- .../ios/Classes/FirebaseCorePlugin.h | 2 +- .../ios/Classes/FirebaseDatabasePlugin.h | 2 +- .../ios/Classes/FirebaseDatabasePlugin.m | 94 +++++++++--------- .../ios/Classes/FirebaseDynamicLinksPlugin.h | 2 +- .../ios/Classes/FirebaseDynamicLinksPlugin.m | 4 +- .../ios/Classes/FirebaseMessagingPlugin.h | 2 +- .../ios/Classes/FirebaseMessagingPlugin.m | 2 +- .../ios/Classes/FaceDetector.m | 40 ++++---- .../ios/Classes/FirebaseMlVisionPlugin.h | 12 +-- .../ios/Classes/TextRecognizer.m | 2 +- .../ios/Classes/FirebasePerformancePlugin.h | 2 +- .../ios/Classes/FirebaseRemoteConfigPlugin.h | 2 +- .../ios/Classes/FirebaseRemoteConfigPlugin.m | 5 +- .../ios/Classes/FirebaseStoragePlugin.h | 2 +- .../ios/Classes/FirebaseStoragePlugin.m | 2 +- .../ios/Classes/GoogleMapController.h | 4 +- .../ios/Classes/GoogleMapController.m | 4 +- .../ios/Classes/GoogleMapMarkerController.h | 2 +- .../ios/Classes/GoogleMapsPlugin.h | 2 +- .../ios/Classes/GoogleSignInPlugin.h | 2 +- .../ios/Classes/GoogleSignInPlugin.m | 11 ++- .../ios/Classes/ImagePickerPlugin.h | 2 +- .../ios/Classes/ImagePickerPlugin.m | 2 +- .../ios/Classes/InAppPurchasePlugin.h | 2 +- .../local_auth/ios/Classes/LocalAuthPlugin.h | 2 +- .../ios/Classes/LocationBackgroundPlugin.h | 3 +- .../ios/Classes/LocationBackgroundPlugin.m | 4 +- .../ios/Classes/PackageInfoPlugin.h | 2 +- .../ios/Classes/PathProviderPlugin.h | 2 +- .../ios/Classes/QuickActionsPlugin.h | 2 +- packages/sensors/ios/Classes/SensorsPlugin.h | 8 +- packages/share/ios/Classes/SharePlugin.h | 2 +- packages/share/ios/Classes/SharePlugin.m | 5 +- .../ios/Classes/SharedPreferencesPlugin.h | 2 +- .../ios/Classes/SharedPreferencesPlugin.m | 4 +- .../ios/Classes/UrlLauncherPlugin.h | 2 +- .../ios/Classes/UrlLauncherPlugin.m | 4 +- .../ios/Classes/VideoPlayerPlugin.h | 2 +- .../ios/Classes/VideoPlayerPlugin.m | 12 +-- .../ios/Classes/FlutterWebView.h | 4 +- .../ios/Classes/WebViewFlutterPlugin.h | 2 +- 63 files changed, 250 insertions(+), 238 deletions(-) mode change 100755 => 100644 packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.h mode change 100755 => 100644 packages/google_sign_in/ios/Classes/GoogleSignInPlugin.h diff --git a/.cirrus.yml b/.cirrus.yml index efab9e79143e..00beb3c37cf6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -14,10 +14,10 @@ task: - name: test+format install_script: - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - - sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main" + - sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main" - sudo apt-get update - - sudo apt-get install -y --allow-unauthenticated clang-format-5.0 - format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-5.0 + - sudo apt-get install -y --allow-unauthenticated clang-format-7 + format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-7 test_script: ./script/incremental_build.sh test - name: analyze script: ./script/incremental_build.sh analyze diff --git a/packages/android_alarm_manager/ios/Classes/AndroidAlarmManagerPlugin.h b/packages/android_alarm_manager/ios/Classes/AndroidAlarmManagerPlugin.h index 5e1a495770f2..595fcf60fee1 100644 --- a/packages/android_alarm_manager/ios/Classes/AndroidAlarmManagerPlugin.h +++ b/packages/android_alarm_manager/ios/Classes/AndroidAlarmManagerPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTAndroidAlarmManagerPlugin : NSObject +@interface FLTAndroidAlarmManagerPlugin : NSObject @end diff --git a/packages/android_intent/ios/Classes/AndroidIntentPlugin.h b/packages/android_intent/ios/Classes/AndroidIntentPlugin.h index b63c92502121..8810c13f61cf 100644 --- a/packages/android_intent/ios/Classes/AndroidIntentPlugin.h +++ b/packages/android_intent/ios/Classes/AndroidIntentPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTAndroidIntentPlugin : NSObject +@interface FLTAndroidIntentPlugin : NSObject @end diff --git a/packages/battery/ios/Classes/BatteryPlugin.h b/packages/battery/ios/Classes/BatteryPlugin.h index f23edb246590..9743ca501208 100644 --- a/packages/battery/ios/Classes/BatteryPlugin.h +++ b/packages/battery/ios/Classes/BatteryPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTBatteryPlugin : NSObject +@interface FLTBatteryPlugin : NSObject @end diff --git a/packages/battery/ios/Classes/BatteryPlugin.m b/packages/battery/ios/Classes/BatteryPlugin.m index c2451a57683d..73042712340d 100644 --- a/packages/battery/ios/Classes/BatteryPlugin.m +++ b/packages/battery/ios/Classes/BatteryPlugin.m @@ -4,7 +4,7 @@ #import "BatteryPlugin.h" -@interface FLTBatteryPlugin () +@interface FLTBatteryPlugin () @end @implementation FLTBatteryPlugin { diff --git a/packages/camera/ios/Classes/CameraPlugin.h b/packages/camera/ios/Classes/CameraPlugin.h index a4c4482293ba..84a90f34b98c 100644 --- a/packages/camera/ios/Classes/CameraPlugin.h +++ b/packages/camera/ios/Classes/CameraPlugin.h @@ -1,4 +1,4 @@ #import -@interface CameraPlugin : NSObject +@interface CameraPlugin : NSObject @end diff --git a/packages/camera/ios/Classes/CameraPlugin.m b/packages/camera/ios/Classes/CameraPlugin.m index 0bfb7515c36c..42cc2e42894c 100644 --- a/packages/camera/ios/Classes/CameraPlugin.m +++ b/packages/camera/ios/Classes/CameraPlugin.m @@ -14,7 +14,7 @@ - (FlutterError *)flutterError { } @end -@interface FLTSavePhotoDelegate : NSObject +@interface FLTSavePhotoDelegate : NSObject @property(readonly, nonatomic) NSString *path; @property(readonly, nonatomic) FlutterResult result; @@ -59,8 +59,10 @@ - (void)captureOutput:(AVCapturePhotoOutput *)output } @end -@interface FLTCam : NSObject +@interface FLTCam : NSObject @property(readonly, nonatomic) int64_t textureId; @property(nonatomic, copy) void (^onFrameAvailable)(); @property(nonatomic) FlutterEventChannel *eventChannel; @@ -111,8 +113,8 @@ - (instancetype)initWithCameraName:(NSString *)cameraName _captureSession.sessionPreset = preset; _captureDevice = [AVCaptureDevice deviceWithUniqueID:cameraName]; NSError *localError = nil; - _captureVideoInput = - [AVCaptureDeviceInput deviceInputWithDevice:_captureDevice error:&localError]; + _captureVideoInput = [AVCaptureDeviceInput deviceInputWithDevice:_captureDevice + error:&localError]; if (localError) { *error = localError; return nil; @@ -123,7 +125,7 @@ - (instancetype)initWithCameraName:(NSString *)cameraName _captureVideoOutput = [AVCaptureVideoDataOutput new]; _captureVideoOutput.videoSettings = - @{(NSString *)kCVPixelBufferPixelFormatTypeKey : @(kCVPixelFormatType_32BGRA) }; + @{(NSString *)kCVPixelBufferPixelFormatTypeKey : @(kCVPixelFormatType_32BGRA)}; [_captureVideoOutput setAlwaysDiscardsLateVideoFrames:YES]; [_captureVideoOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()]; @@ -154,9 +156,9 @@ - (void)stop { - (void)captureToFile:(NSString *)path result:(FlutterResult)result { AVCapturePhotoSettings *settings = [AVCapturePhotoSettings photoSettings]; [settings setHighResolutionPhotoEnabled:YES]; - [_capturePhotoOutput - capturePhotoWithSettings:settings - delegate:[[FLTSavePhotoDelegate alloc] initWithPath:path result:result]]; + [_capturePhotoOutput capturePhotoWithSettings:settings + delegate:[[FLTSavePhotoDelegate alloc] initWithPath:path + result:result]]; } - (void)captureOutput:(AVCaptureOutput *)output @@ -330,8 +332,9 @@ - (BOOL)setupWriterForPath:(NSString *)path { if (!_isAudioSetup) { [self setUpCaptureSessionForAudio]; } - _videoWriter = - [[AVAssetWriter alloc] initWithURL:outputURL fileType:AVFileTypeQuickTimeMovie error:&error]; + _videoWriter = [[AVAssetWriter alloc] initWithURL:outputURL + fileType:AVFileTypeQuickTimeMovie + error:&error]; NSParameterAssert(_videoWriter); if (error) { _eventSink(@{@"event" : @"error", @"errorDescription" : error.description}); @@ -375,8 +378,8 @@ - (void)setUpCaptureSessionForAudio { // Create a device input with the device and add it to the session. // Setup the audio input. AVCaptureDevice *audioDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]; - AVCaptureDeviceInput *audioInput = - [AVCaptureDeviceInput deviceInputWithDevice:audioDevice error:&error]; + AVCaptureDeviceInput *audioInput = [AVCaptureDeviceInput deviceInputWithDevice:audioDevice + error:&error]; if (error) { _eventSink(@{@"event" : @"error", @"errorDescription" : error.description}); } @@ -411,8 +414,8 @@ + (void)registerWithRegistrar:(NSObject *)registrar { FlutterMethodChannel *channel = [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/camera" binaryMessenger:[registrar messenger]]; - CameraPlugin *instance = - [[CameraPlugin alloc] initWithRegistry:[registrar textures] messenger:[registrar messenger]]; + CameraPlugin *instance = [[CameraPlugin alloc] initWithRegistry:[registrar textures] + messenger:[registrar messenger]]; [registrar addMethodCallDelegate:instance channel:channel]; } diff --git a/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.h b/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.h index 156faca7c01e..3a9035a10fd9 100644 --- a/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.h +++ b/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTCloudFirestorePlugin : NSObject +@interface FLTCloudFirestorePlugin : NSObject @end diff --git a/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m b/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m index e9fa73a40a1f..3d93972b5ddd 100644 --- a/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m +++ b/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m @@ -295,27 +295,28 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result result(error.flutterError); }; if ([@"Firestore#runTransaction" isEqualToString:call.method]) { - [getFirestore(call.arguments) runTransactionWithBlock:^id(FIRTransaction *transaction, - NSError **pError) { - NSNumber *transactionId = call.arguments[@"transactionId"]; - NSNumber *transactionTimeout = call.arguments[@"transactionTimeout"]; + [getFirestore(call.arguments) + runTransactionWithBlock:^id(FIRTransaction *transaction, NSError **pError) { + NSNumber *transactionId = call.arguments[@"transactionId"]; + NSNumber *transactionTimeout = call.arguments[@"transactionTimeout"]; - self->transactions[transactionId] = transaction; + self->transactions[transactionId] = transaction; - dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); - [self.channel invokeMethod:@"DoTransaction" - arguments:call.arguments - result:^(id doTransactionResult) { - self->transactionResults[transactionId] = doTransactionResult; - dispatch_semaphore_signal(semaphore); - }]; + [self.channel invokeMethod:@"DoTransaction" + arguments:call.arguments + result:^(id doTransactionResult) { + self->transactionResults[transactionId] = doTransactionResult; + dispatch_semaphore_signal(semaphore); + }]; - dispatch_semaphore_wait( - semaphore, dispatch_time(DISPATCH_TIME_NOW, [transactionTimeout integerValue] * 1000000)); + dispatch_semaphore_wait( + semaphore, + dispatch_time(DISPATCH_TIME_NOW, [transactionTimeout integerValue] * 1000000)); - return self->transactionResults[transactionId]; - } + return self->transactionResults[transactionId]; + } completion:^(id transactionResult, NSError *error) { if (error != nil) { result([FlutterError errorWithCode:[NSString stringWithFormat:@"%ld", error.code] diff --git a/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.h b/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.h index efcd30337887..568c14a5a5ce 100644 --- a/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.h +++ b/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.h @@ -1,4 +1,4 @@ #import -@interface CloudFunctionsPlugin : NSObject +@interface CloudFunctionsPlugin : NSObject @end diff --git a/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.m b/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.m index fd04d7c71888..701c5efb3466 100644 --- a/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.m +++ b/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.m @@ -56,8 +56,9 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result message:@"Firebase function failed with exception." details:details]; } else { - flutterError = - [FlutterError errorWithCode:nil message:error.localizedDescription details:nil]; + flutterError = [FlutterError errorWithCode:nil + message:error.localizedDescription + details:nil]; } result(flutterError); } else { diff --git a/packages/connectivity/ios/Classes/ConnectivityPlugin.h b/packages/connectivity/ios/Classes/ConnectivityPlugin.h index 3a42fb2ce55b..5014624f2f69 100644 --- a/packages/connectivity/ios/Classes/ConnectivityPlugin.h +++ b/packages/connectivity/ios/Classes/ConnectivityPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTConnectivityPlugin : NSObject +@interface FLTConnectivityPlugin : NSObject @end diff --git a/packages/connectivity/ios/Classes/ConnectivityPlugin.m b/packages/connectivity/ios/Classes/ConnectivityPlugin.m index f924bb47679c..aa06353ec2da 100644 --- a/packages/connectivity/ios/Classes/ConnectivityPlugin.m +++ b/packages/connectivity/ios/Classes/ConnectivityPlugin.m @@ -8,7 +8,7 @@ #import "SystemConfiguration/CaptiveNetwork.h" -@interface FLTConnectivityPlugin () +@interface FLTConnectivityPlugin () @end @implementation FLTConnectivityPlugin { diff --git a/packages/device_info/ios/Classes/DeviceInfoPlugin.h b/packages/device_info/ios/Classes/DeviceInfoPlugin.h index 6c55bd83abca..b5e95ed10e84 100644 --- a/packages/device_info/ios/Classes/DeviceInfoPlugin.h +++ b/packages/device_info/ios/Classes/DeviceInfoPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTDeviceInfoPlugin : NSObject +@interface FLTDeviceInfoPlugin : NSObject @end diff --git a/packages/firebase_admob/ios/Classes/FLTMobileAd.h b/packages/firebase_admob/ios/Classes/FLTMobileAd.h index f62069b70fb1..24d23e04ed7a 100644 --- a/packages/firebase_admob/ios/Classes/FLTMobileAd.h +++ b/packages/firebase_admob/ios/Classes/FLTMobileAd.h @@ -23,12 +23,12 @@ typedef enum : NSUInteger { - (void)dispose; @end -@interface FLTBannerAd : FLTMobileAd +@interface FLTBannerAd : FLTMobileAd + (instancetype)withId:(NSNumber *)mobileAdId adSize:(GADAdSize)adSize channel:(FlutterMethodChannel *)channel; @end -@interface FLTInterstitialAd : FLTMobileAd +@interface FLTInterstitialAd : FLTMobileAd + (instancetype)withId:(NSNumber *)mobileAdId channel:(FlutterMethodChannel *)channel; @end diff --git a/packages/firebase_admob/ios/Classes/FLTRequestFactory.m b/packages/firebase_admob/ios/Classes/FLTRequestFactory.m index d72ec0a5cbaa..1b2e7f8e29e1 100644 --- a/packages/firebase_admob/ios/Classes/FLTRequestFactory.m +++ b/packages/firebase_admob/ios/Classes/FLTRequestFactory.m @@ -121,8 +121,8 @@ - (GADRequest *)createRequest { request.requestAgent = requestAgent; } - NSNumber *nonPersonalizedAds = - [self targetingInfoBoolForKey:@"nonPersonalizedAds" info:_targetingInfo]; + NSNumber *nonPersonalizedAds = [self targetingInfoBoolForKey:@"nonPersonalizedAds" + info:_targetingInfo]; if (nonPersonalizedAds != nil && [nonPersonalizedAds boolValue]) { GADExtras *extras = [[GADExtras alloc] init]; extras.additionalParameters = @{@"npa" : @"1"}; diff --git a/packages/firebase_admob/ios/Classes/FLTRewardedVideoAdWrapper.m b/packages/firebase_admob/ios/Classes/FLTRewardedVideoAdWrapper.m index b2f1a11149c3..c05345eb92af 100644 --- a/packages/firebase_admob/ios/Classes/FLTRewardedVideoAdWrapper.m +++ b/packages/firebase_admob/ios/Classes/FLTRewardedVideoAdWrapper.m @@ -8,7 +8,7 @@ static NSDictionary *rewardedStatusToString = nil; -@interface FLTRewardedVideoAdWrapper () +@interface FLTRewardedVideoAdWrapper () @end @implementation FLTRewardedVideoAdWrapper diff --git a/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.h b/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.h index 6b67219f34e4..e09cedc6bbcb 100644 --- a/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.h +++ b/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.h @@ -4,8 +4,7 @@ #import -#define FLTLogWarning(format, ...) \ - NSLog((@"FirebaseAdMobPlugin " format), ##__VA_ARGS__) +#define FLTLogWarning(format, ...) NSLog((@"FirebaseAdMobPlugin " format), ##__VA_ARGS__) -@interface FLTFirebaseAdMobPlugin : NSObject +@interface FLTFirebaseAdMobPlugin : NSObject @end diff --git a/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.m b/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.m index 7ea2ebdcba22..999ae420c4fb 100644 --- a/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.m +++ b/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.m @@ -271,10 +271,9 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result NSNumber *mobileAdId = (NSNumber *)call.arguments[@"id"]; if (mobileAdId == nil) { - NSString *message = - @"FirebaseAdMobPlugin method calls for banners and " - @"interstitials must specify an " - @"integer mobile ad id"; + NSString *message = @"FirebaseAdMobPlugin method calls for banners and " + @"interstitials must specify an " + @"integer mobile ad id"; result([FlutterError errorWithCode:@"no_id" message:message details:nil]); return; } diff --git a/packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.h b/packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.h old mode 100755 new mode 100644 index 00fb731c36b2..0ddf1f57a7de --- a/packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.h +++ b/packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTFirebaseAnalyticsPlugin : NSObject +@interface FLTFirebaseAnalyticsPlugin : NSObject @end diff --git a/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.h b/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.h index 7d1a3e38ddf7..1383a169fa81 100644 --- a/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.h +++ b/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTFirebaseAuthPlugin : NSObject +@interface FLTFirebaseAuthPlugin : NSObject @end diff --git a/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.m b/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.m index af07425d06ac..0ae2d2307269 100644 --- a/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.m +++ b/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.m @@ -79,8 +79,8 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result } else if ([@"signInWithGoogle" isEqualToString:call.method]) { NSString *idToken = call.arguments[@"idToken"]; NSString *accessToken = call.arguments[@"accessToken"]; - FIRAuthCredential *credential = - [FIRGoogleAuthProvider credentialWithIDToken:idToken accessToken:accessToken]; + FIRAuthCredential *credential = [FIRGoogleAuthProvider credentialWithIDToken:idToken + accessToken:accessToken]; [[self getAuth:call.arguments] signInWithCredential:credential completion:^(FIRUser *user, NSError *error) { [self sendResult:result forUser:user error:error]; @@ -95,8 +95,8 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result } else if ([@"signInWithTwitter" isEqualToString:call.method]) { NSString *authToken = call.arguments[@"authToken"]; NSString *authTokenSecret = call.arguments[@"authTokenSecret"]; - FIRAuthCredential *credential = - [FIRTwitterAuthProvider credentialWithToken:authToken secret:authTokenSecret]; + FIRAuthCredential *credential = [FIRTwitterAuthProvider credentialWithToken:authToken + secret:authTokenSecret]; [[self getAuth:call.arguments] signInWithCredential:credential completion:^(FIRUser *user, NSError *error) { [self sendResult:result forUser:user error:error]; @@ -139,11 +139,12 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result }]; } else if ([@"sendPasswordResetEmail" isEqualToString:call.method]) { NSString *email = call.arguments[@"email"]; - [[self getAuth:call.arguments] - sendPasswordResetWithEmail:email - completion:^(NSError *error) { - [self sendResult:result forUser:nil error:error]; - }]; + [[self getAuth:call.arguments] sendPasswordResetWithEmail:email + completion:^(NSError *error) { + [self sendResult:result + forUser:nil + error:error]; + }]; } else if ([@"signInWithEmailAndPassword" isEqualToString:call.method]) { NSString *email = call.arguments[@"email"]; NSString *password = call.arguments[@"password"]; @@ -171,49 +172,54 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result } else if ([@"linkWithEmailAndPassword" isEqualToString:call.method]) { NSString *email = call.arguments[@"email"]; NSString *password = call.arguments[@"password"]; - FIRAuthCredential *credential = - [FIREmailAuthProvider credentialWithEmail:email password:password]; - [[self getAuth:call.arguments].currentUser - linkWithCredential:credential - completion:^(FIRUser *user, NSError *error) { - [self sendResult:result forUser:user error:error]; - }]; + FIRAuthCredential *credential = [FIREmailAuthProvider credentialWithEmail:email + password:password]; + [[self getAuth:call.arguments].currentUser linkWithCredential:credential + completion:^(FIRUser *user, NSError *error) { + [self sendResult:result + forUser:user + error:error]; + }]; } else if ([@"linkWithGoogleCredential" isEqualToString:call.method]) { NSString *idToken = call.arguments[@"idToken"]; NSString *accessToken = call.arguments[@"accessToken"]; - FIRAuthCredential *credential = - [FIRGoogleAuthProvider credentialWithIDToken:idToken accessToken:accessToken]; - [[self getAuth:call.arguments].currentUser - linkWithCredential:credential - completion:^(FIRUser *user, NSError *error) { - [self sendResult:result forUser:user error:error]; - }]; + FIRAuthCredential *credential = [FIRGoogleAuthProvider credentialWithIDToken:idToken + accessToken:accessToken]; + [[self getAuth:call.arguments].currentUser linkWithCredential:credential + completion:^(FIRUser *user, NSError *error) { + [self sendResult:result + forUser:user + error:error]; + }]; } else if ([@"linkWithFacebookCredential" isEqualToString:call.method]) { NSString *accessToken = call.arguments[@"accessToken"]; FIRAuthCredential *credential = [FIRFacebookAuthProvider credentialWithAccessToken:accessToken]; - [[self getAuth:call.arguments].currentUser - linkWithCredential:credential - completion:^(FIRUser *user, NSError *error) { - [self sendResult:result forUser:user error:error]; - }]; + [[self getAuth:call.arguments].currentUser linkWithCredential:credential + completion:^(FIRUser *user, NSError *error) { + [self sendResult:result + forUser:user + error:error]; + }]; } else if ([@"linkWithTwitterCredential" isEqualToString:call.method]) { NSString *authToken = call.arguments[@"authToken"]; NSString *authTokenSecret = call.arguments[@"authTokenSecret"]; - FIRAuthCredential *credential = - [FIRTwitterAuthProvider credentialWithToken:authToken secret:authTokenSecret]; - [[self getAuth:call.arguments].currentUser - linkWithCredential:credential - completion:^(FIRUser *user, NSError *error) { - [self sendResult:result forUser:user error:error]; - }]; + FIRAuthCredential *credential = [FIRTwitterAuthProvider credentialWithToken:authToken + secret:authTokenSecret]; + [[self getAuth:call.arguments].currentUser linkWithCredential:credential + completion:^(FIRUser *user, NSError *error) { + [self sendResult:result + forUser:user + error:error]; + }]; } else if ([@"linkWithGithubCredential" isEqualToString:call.method]) { NSString *token = call.arguments[@"token"]; FIRAuthCredential *credential = [FIRGitHubAuthProvider credentialWithToken:token]; - [[self getAuth:call.arguments].currentUser - linkWithCredential:credential - completion:^(FIRUser *user, NSError *error) { - [self sendResult:result forUser:user error:error]; - }]; + [[self getAuth:call.arguments].currentUser linkWithCredential:credential + completion:^(FIRUser *user, NSError *error) { + [self sendResult:result + forUser:user + error:error]; + }]; } else if ([@"updateEmail" isEqualToString:call.method]) { NSString *email = call.arguments[@"email"]; [[self getAuth:call.arguments].currentUser updateEmail:email @@ -222,11 +228,12 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result }]; } else if ([@"updatePassword" isEqualToString:call.method]) { NSString *password = call.arguments[@"password"]; - [[self getAuth:call.arguments].currentUser - updatePassword:password - completion:^(NSError *error) { - [self sendResult:result forUser:nil error:error]; - }]; + [[self getAuth:call.arguments].currentUser updatePassword:password + completion:^(NSError *error) { + [self sendResult:result + forUser:nil + error:error]; + }]; } else if ([@"updateProfile" isEqualToString:call.method]) { FIRUserProfileChangeRequest *changeRequest = [[self getAuth:call.arguments].currentUser profileChangeRequest]; diff --git a/packages/firebase_core/ios/Classes/FirebaseCorePlugin.h b/packages/firebase_core/ios/Classes/FirebaseCorePlugin.h index f3ca94f5e6d4..42a71d29f641 100644 --- a/packages/firebase_core/ios/Classes/FirebaseCorePlugin.h +++ b/packages/firebase_core/ios/Classes/FirebaseCorePlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTFirebaseCorePlugin : NSObject +@interface FLTFirebaseCorePlugin : NSObject @end diff --git a/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.h b/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.h index dd817362bcf5..adc9034e88f2 100644 --- a/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.h +++ b/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.h @@ -4,7 +4,7 @@ #import -@interface FLTFirebaseDatabasePlugin : NSObject +@interface FLTFirebaseDatabasePlugin : NSObject @property(nonatomic) NSMutableDictionary *updatedSnapshots; diff --git a/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.m b/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.m index 7f7710f47f8c..98df29c8de51 100644 --- a/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.m +++ b/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.m @@ -221,58 +221,60 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result [getReference(database, call.arguments) setPriority:call.arguments[@"priority"] withCompletionBlock:defaultCompletionBlock]; } else if ([@"DatabaseReference#runTransaction" isEqualToString:call.method]) { - [getReference(database, call.arguments) runTransactionBlock:^FIRTransactionResult *_Nonnull( - FIRMutableData *_Nonnull currentData) { - // Create semaphore to allow native side to wait while snapshot - // updates occur on the Dart side. - dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); + [getReference(database, call.arguments) + runTransactionBlock:^FIRTransactionResult *_Nonnull(FIRMutableData *_Nonnull currentData) { + // Create semaphore to allow native side to wait while snapshot + // updates occur on the Dart side. + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); - NSObject *snapshot = - @{@"key" : currentData.key ?: [NSNull null], @"value" : currentData.value}; + NSObject *snapshot = + @{@"key" : currentData.key ?: [NSNull null], @"value" : currentData.value}; - __block bool shouldAbort = false; + __block bool shouldAbort = false; - [self.channel invokeMethod:@"DoTransaction" - arguments:@{ - @"transactionKey" : call.arguments[@"transactionKey"], - @"snapshot" : snapshot - } - result:^(id _Nullable result) { - if ([result isKindOfClass:[FlutterError class]]) { - FlutterError *flutterError = ((FlutterError *)result); - NSLog(@"Error code: %@", flutterError.code); - NSLog(@"Error message: %@", flutterError.message); - NSLog(@"Error details: %@", flutterError.details); - shouldAbort = true; - } else if ([result isEqual:FlutterMethodNotImplemented]) { - NSLog(@"DoTransaction not implemented on the Dart side."); - shouldAbort = true; - } else { - [self.updatedSnapshots setObject:result - forKey:call.arguments[@"transactionKey"]]; - } - dispatch_semaphore_signal(semaphore); - }]; + [self.channel invokeMethod:@"DoTransaction" + arguments:@{ + @"transactionKey" : call.arguments[@"transactionKey"], + @"snapshot" : snapshot + } + result:^(id _Nullable result) { + if ([result isKindOfClass:[FlutterError class]]) { + FlutterError *flutterError = ((FlutterError *)result); + NSLog(@"Error code: %@", flutterError.code); + NSLog(@"Error message: %@", flutterError.message); + NSLog(@"Error details: %@", flutterError.details); + shouldAbort = true; + } else if ([result isEqual:FlutterMethodNotImplemented]) { + NSLog(@"DoTransaction not implemented on the Dart side."); + shouldAbort = true; + } else { + [self.updatedSnapshots + setObject:result + forKey:call.arguments[@"transactionKey"]]; + } + dispatch_semaphore_signal(semaphore); + }]; - // Wait while Dart side updates the snapshot. Incoming transactionTimeout is in milliseconds - // so converting to nanoseconds for use with dispatch_semaphore_wait. - long result = dispatch_semaphore_wait( - semaphore, dispatch_time(DISPATCH_TIME_NOW, - [call.arguments[@"transactionTimeout"] integerValue] * 1000000)); + // Wait while Dart side updates the snapshot. Incoming transactionTimeout is in + // milliseconds so converting to nanoseconds for use with dispatch_semaphore_wait. + long result = dispatch_semaphore_wait( + semaphore, + dispatch_time(DISPATCH_TIME_NOW, + [call.arguments[@"transactionTimeout"] integerValue] * 1000000)); - if (result == 0 && !shouldAbort) { - // Set FIRMutableData value to value returned from the Dart side. - currentData.value = - [self.updatedSnapshots objectForKey:call.arguments[@"transactionKey"]][@"value"]; - } else { - if (result != 0) { - NSLog(@"Transaction at %@ timed out.", [getReference(database, call.arguments) URL]); - } - return [FIRTransactionResult abort]; - } + if (result == 0 && !shouldAbort) { + // Set FIRMutableData value to value returned from the Dart side. + currentData.value = + [self.updatedSnapshots objectForKey:call.arguments[@"transactionKey"]][@"value"]; + } else { + if (result != 0) { + NSLog(@"Transaction at %@ timed out.", [getReference(database, call.arguments) URL]); + } + return [FIRTransactionResult abort]; + } - return [FIRTransactionResult successWithValue:currentData]; - } + return [FIRTransactionResult successWithValue:currentData]; + } andCompletionBlock:^(NSError *_Nullable error, BOOL committed, FIRDataSnapshot *_Nullable snapshot) { // Invoke transaction completion on the Dart side. diff --git a/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.h b/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.h index 1129b9aa3883..25f4c1d8b8ca 100644 --- a/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.h +++ b/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.h @@ -1,4 +1,4 @@ #import -@interface FLTFirebaseDynamicLinksPlugin : NSObject +@interface FLTFirebaseDynamicLinksPlugin : NSObject @end diff --git a/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.m b/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.m index 43f49972348d..4169e790b58e 100644 --- a/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.m +++ b/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.m @@ -147,8 +147,8 @@ - (FIRDynamicLinkComponents *)setupParameters:(NSDictionary *)arguments { NSURL *link = [NSURL URLWithString:arguments[@"link"]]; NSString *domain = arguments[@"domain"]; - FIRDynamicLinkComponents *components = - [FIRDynamicLinkComponents componentsWithLink:link domain:domain]; + FIRDynamicLinkComponents *components = [FIRDynamicLinkComponents componentsWithLink:link + domain:domain]; if (![arguments[@"androidParameters"] isEqual:[NSNull null]]) { NSDictionary *params = arguments[@"androidParameters"]; diff --git a/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.h b/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.h index 93d1bdd927db..492be15a4ea6 100644 --- a/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.h +++ b/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTFirebaseMessagingPlugin : NSObject +@interface FLTFirebaseMessagingPlugin : NSObject @end diff --git a/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.m b/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.m index 60addf3870c6..fa50efc5579d 100644 --- a/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.m +++ b/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.m @@ -7,7 +7,7 @@ #import "Firebase/Firebase.h" #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 -@interface FLTFirebaseMessagingPlugin () +@interface FLTFirebaseMessagingPlugin () @end #endif diff --git a/packages/firebase_ml_vision/ios/Classes/FaceDetector.m b/packages/firebase_ml_vision/ios/Classes/FaceDetector.m index ed8ab7f0e5c9..602aaddf606e 100644 --- a/packages/firebase_ml_vision/ios/Classes/FaceDetector.m +++ b/packages/firebase_ml_vision/ios/Classes/FaceDetector.m @@ -42,26 +42,26 @@ + (void)handleDetection:(FIRVisionImage *)image @"rightEyeOpenProbability" : rightProb, @"trackingId" : face.hasTrackingID ? @(face.trackingID) : [NSNull null], @"landmarks" : @{ - @"bottomMouth" : - [FaceDetector getLandmarkPosition:face landmark:FIRFaceLandmarkTypeMouthBottom], - @"leftCheek" : - [FaceDetector getLandmarkPosition:face landmark:FIRFaceLandmarkTypeLeftCheek], - @"leftEar" : - [FaceDetector getLandmarkPosition:face landmark:FIRFaceLandmarkTypeLeftEar], - @"leftEye" : - [FaceDetector getLandmarkPosition:face landmark:FIRFaceLandmarkTypeLeftEye], - @"leftMouth" : - [FaceDetector getLandmarkPosition:face landmark:FIRFaceLandmarkTypeMouthLeft], - @"noseBase" : - [FaceDetector getLandmarkPosition:face landmark:FIRFaceLandmarkTypeNoseBase], - @"rightCheek" : - [FaceDetector getLandmarkPosition:face landmark:FIRFaceLandmarkTypeRightCheek], - @"rightEar" : - [FaceDetector getLandmarkPosition:face landmark:FIRFaceLandmarkTypeRightEar], - @"rightEye" : - [FaceDetector getLandmarkPosition:face landmark:FIRFaceLandmarkTypeRightEye], - @"rightMouth" : - [FaceDetector getLandmarkPosition:face landmark:FIRFaceLandmarkTypeMouthRight], + @"bottomMouth" : [FaceDetector getLandmarkPosition:face + landmark:FIRFaceLandmarkTypeMouthBottom], + @"leftCheek" : [FaceDetector getLandmarkPosition:face + landmark:FIRFaceLandmarkTypeLeftCheek], + @"leftEar" : [FaceDetector getLandmarkPosition:face + landmark:FIRFaceLandmarkTypeLeftEar], + @"leftEye" : [FaceDetector getLandmarkPosition:face + landmark:FIRFaceLandmarkTypeLeftEye], + @"leftMouth" : [FaceDetector getLandmarkPosition:face + landmark:FIRFaceLandmarkTypeMouthLeft], + @"noseBase" : [FaceDetector getLandmarkPosition:face + landmark:FIRFaceLandmarkTypeNoseBase], + @"rightCheek" : [FaceDetector getLandmarkPosition:face + landmark:FIRFaceLandmarkTypeRightCheek], + @"rightEar" : [FaceDetector getLandmarkPosition:face + landmark:FIRFaceLandmarkTypeRightEar], + @"rightEye" : [FaceDetector getLandmarkPosition:face + landmark:FIRFaceLandmarkTypeRightEye], + @"rightMouth" : [FaceDetector getLandmarkPosition:face + landmark:FIRFaceLandmarkTypeMouthRight], }, }; diff --git a/packages/firebase_ml_vision/ios/Classes/FirebaseMlVisionPlugin.h b/packages/firebase_ml_vision/ios/Classes/FirebaseMlVisionPlugin.h index 62979d0c2ed3..9a620dc45cfa 100644 --- a/packages/firebase_ml_vision/ios/Classes/FirebaseMlVisionPlugin.h +++ b/packages/firebase_ml_vision/ios/Classes/FirebaseMlVisionPlugin.h @@ -2,7 +2,7 @@ #import "Firebase/Firebase.h" -@interface FLTFirebaseMlVisionPlugin : NSObject +@interface FLTFirebaseMlVisionPlugin : NSObject + (void)handleError:(NSError *)error result:(FlutterResult)result; @end @@ -14,17 +14,17 @@ @optional @end -@interface BarcodeDetector : NSObject +@interface BarcodeDetector : NSObject @end -@interface FaceDetector : NSObject +@interface FaceDetector : NSObject @end -@interface LabelDetector : NSObject +@interface LabelDetector : NSObject @end -@interface CloudLabelDetector : NSObject +@interface CloudLabelDetector : NSObject @end -@interface TextRecognizer : NSObject +@interface TextRecognizer : NSObject @end diff --git a/packages/firebase_ml_vision/ios/Classes/TextRecognizer.m b/packages/firebase_ml_vision/ios/Classes/TextRecognizer.m index cadaa47c86e3..9b0f5567db06 100644 --- a/packages/firebase_ml_vision/ios/Classes/TextRecognizer.m +++ b/packages/firebase_ml_vision/ios/Classes/TextRecognizer.m @@ -15,7 +15,7 @@ + (void)handleDetection:(FIRVisionImage *)image [FLTFirebaseMlVisionPlugin handleError:error result:result]; return; } else if (!visionText) { - result(@{ @"text" : @"", @"blocks" : @[] }); + result(@{@"text" : @"", @"blocks" : @[]}); return; } diff --git a/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin.h b/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin.h index 7d3fe9130f82..d71c5351ac8d 100644 --- a/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin.h +++ b/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin.h @@ -1,4 +1,4 @@ #import -@interface FLTFirebasePerformancePlugin : NSObject +@interface FLTFirebasePerformancePlugin : NSObject @end diff --git a/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.h b/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.h index 43a2ff648fba..429a11c5addc 100644 --- a/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.h +++ b/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.h @@ -1,4 +1,4 @@ #import -@interface FirebaseRemoteConfigPlugin : NSObject +@interface FirebaseRemoteConfigPlugin : NSObject @end diff --git a/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.m b/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.m index a01d2c23495a..06091fab0575 100644 --- a/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.m +++ b/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.m @@ -81,9 +81,8 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result message:errorMessage details:resultDict]; } else { - NSString *errorMessage = - @"Unable to complete fetch. Reason is unknown " - "but this could be due to lack of connectivity."; + NSString *errorMessage = @"Unable to complete fetch. Reason is unknown " + "but this could be due to lack of connectivity."; flutterError = [FlutterError errorWithCode:@"fetchFailed" message:errorMessage details:resultDict]; diff --git a/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.h b/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.h index 278fccd79781..4c7a7df05b13 100644 --- a/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.h +++ b/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTFirebaseStoragePlugin : NSObject +@interface FLTFirebaseStoragePlugin : NSObject @end diff --git a/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.m b/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.m index 0196ce4f44fc..8ab7620550a7 100644 --- a/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.m +++ b/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.m @@ -391,7 +391,7 @@ - (void)getDownloadUrl:(FlutterMethodCall *)call result:(FlutterResult)result { }]; } -- (void) delete:(FlutterMethodCall *)call result:(FlutterResult)result { +- (void)delete:(FlutterMethodCall *)call result:(FlutterResult)result { NSString *path = call.arguments[@"path"]; FIRStorageReference *ref = [storage.reference child:path]; [ref deleteWithCompletion:^(NSError *error) { diff --git a/packages/google_maps_flutter/ios/Classes/GoogleMapController.h b/packages/google_maps_flutter/ios/Classes/GoogleMapController.h index a22aa144946e..eecc69c14cc6 100644 --- a/packages/google_maps_flutter/ios/Classes/GoogleMapController.h +++ b/packages/google_maps_flutter/ios/Classes/GoogleMapController.h @@ -31,7 +31,7 @@ // Defines map overlay controllable from Flutter. @interface FLTGoogleMapController - : NSObject + : NSObject @property(atomic) id delegate; @property(atomic, readonly) id mapId; - (instancetype)initWithFrame:(CGRect)frame @@ -51,6 +51,6 @@ @end // Allows the engine to create new Google Map instances. -@interface FLTGoogleMapFactory : NSObject +@interface FLTGoogleMapFactory : NSObject - (instancetype)initWithRegistrar:(NSObject*)registrar; @end diff --git a/packages/google_maps_flutter/ios/Classes/GoogleMapController.m b/packages/google_maps_flutter/ios/Classes/GoogleMapController.m index cf091a24f665..652760ae5567 100644 --- a/packages/google_maps_flutter/ios/Classes/GoogleMapController.m +++ b/packages/google_maps_flutter/ios/Classes/GoogleMapController.m @@ -426,8 +426,8 @@ static void interpretMarkerOptions(id json, id si if (iconData.count == 2) { image = [UIImage imageNamed:[registrar lookupKeyForAsset:iconData[1]]]; } else { - image = - [UIImage imageNamed:[registrar lookupKeyForAsset:iconData[1] fromPackage:iconData[2]]]; + image = [UIImage imageNamed:[registrar lookupKeyForAsset:iconData[1] + fromPackage:iconData[2]]]; } } [sink setIcon:image]; diff --git a/packages/google_maps_flutter/ios/Classes/GoogleMapMarkerController.h b/packages/google_maps_flutter/ios/Classes/GoogleMapMarkerController.h index 2e5b80aee70e..14f657a13f4e 100644 --- a/packages/google_maps_flutter/ios/Classes/GoogleMapMarkerController.h +++ b/packages/google_maps_flutter/ios/Classes/GoogleMapMarkerController.h @@ -22,7 +22,7 @@ @end // Defines marker controllable by Flutter. -@interface FLTGoogleMapMarkerController : NSObject +@interface FLTGoogleMapMarkerController : NSObject @property(atomic, readonly) NSString* markerId; - (instancetype)initWithPosition:(CLLocationCoordinate2D)position mapView:(GMSMapView*)mapView; @end diff --git a/packages/google_maps_flutter/ios/Classes/GoogleMapsPlugin.h b/packages/google_maps_flutter/ios/Classes/GoogleMapsPlugin.h index 653dfa8b9155..603287fc3ce2 100644 --- a/packages/google_maps_flutter/ios/Classes/GoogleMapsPlugin.h +++ b/packages/google_maps_flutter/ios/Classes/GoogleMapsPlugin.h @@ -7,5 +7,5 @@ #import "GoogleMapController.h" #import "GoogleMapMarkerController.h" -@interface FLTGoogleMapsPlugin : NSObject +@interface FLTGoogleMapsPlugin : NSObject @end diff --git a/packages/google_sign_in/ios/Classes/GoogleSignInPlugin.h b/packages/google_sign_in/ios/Classes/GoogleSignInPlugin.h old mode 100755 new mode 100644 index 9525d82ba03d..9474e371e176 --- a/packages/google_sign_in/ios/Classes/GoogleSignInPlugin.h +++ b/packages/google_sign_in/ios/Classes/GoogleSignInPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTGoogleSignInPlugin : NSObject +@interface FLTGoogleSignInPlugin : NSObject @end diff --git a/packages/google_sign_in/ios/Classes/GoogleSignInPlugin.m b/packages/google_sign_in/ios/Classes/GoogleSignInPlugin.m index 6a88d869dd4d..58401cd11696 100644 --- a/packages/google_sign_in/ios/Classes/GoogleSignInPlugin.m +++ b/packages/google_sign_in/ios/Classes/GoogleSignInPlugin.m @@ -29,12 +29,13 @@ - (FlutterError *)flutterError { } else { errorCode = kErrorReasonSignInFailed; } - return - [FlutterError errorWithCode:errorCode message:self.domain details:self.localizedDescription]; + return [FlutterError errorWithCode:errorCode + message:self.domain + details:self.localizedDescription]; } @end -@interface FLTGoogleSignInPlugin () +@interface FLTGoogleSignInPlugin () @end @implementation FLTGoogleSignInPlugin { @@ -73,8 +74,8 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result message:@"Games sign in is not supported on iOS" details:nil]); } else { - NSString *path = - [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"]; + NSString *path = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" + ofType:@"plist"]; if (path) { NSMutableDictionary *plist = [[NSMutableDictionary alloc] initWithContentsOfFile:path]; [GIDSignIn sharedInstance].clientID = plist[kClientIdKey]; diff --git a/packages/image_picker/ios/Classes/ImagePickerPlugin.h b/packages/image_picker/ios/Classes/ImagePickerPlugin.h index f070ece9918e..f7825ce7b6d9 100644 --- a/packages/image_picker/ios/Classes/ImagePickerPlugin.h +++ b/packages/image_picker/ios/Classes/ImagePickerPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTImagePickerPlugin : NSObject +@interface FLTImagePickerPlugin : NSObject @end diff --git a/packages/image_picker/ios/Classes/ImagePickerPlugin.m b/packages/image_picker/ios/Classes/ImagePickerPlugin.m index 10185776be39..44e736948c66 100644 --- a/packages/image_picker/ios/Classes/ImagePickerPlugin.m +++ b/packages/image_picker/ios/Classes/ImagePickerPlugin.m @@ -8,7 +8,7 @@ #import #import -@interface FLTImagePickerPlugin () +@interface FLTImagePickerPlugin () @end static const int SOURCE_CAMERA = 0; diff --git a/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.h b/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.h index 5749468d8582..49413df710a2 100644 --- a/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.h +++ b/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.h @@ -1,4 +1,4 @@ #import -@interface InAppPurchasePlugin : NSObject +@interface InAppPurchasePlugin : NSObject @end diff --git a/packages/local_auth/ios/Classes/LocalAuthPlugin.h b/packages/local_auth/ios/Classes/LocalAuthPlugin.h index 37b82f98d683..1e9e8c3a2d24 100644 --- a/packages/local_auth/ios/Classes/LocalAuthPlugin.h +++ b/packages/local_auth/ios/Classes/LocalAuthPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTLocalAuthPlugin : NSObject +@interface FLTLocalAuthPlugin : NSObject @end diff --git a/packages/location_background/ios/Classes/LocationBackgroundPlugin.h b/packages/location_background/ios/Classes/LocationBackgroundPlugin.h index 90a9d9dc4777..a84a129df1f8 100644 --- a/packages/location_background/ios/Classes/LocationBackgroundPlugin.h +++ b/packages/location_background/ios/Classes/LocationBackgroundPlugin.h @@ -6,7 +6,6 @@ #import -@interface LocationBackgroundPlugin - : NSObject { +@interface LocationBackgroundPlugin : NSObject { } @end diff --git a/packages/location_background/ios/Classes/LocationBackgroundPlugin.m b/packages/location_background/ios/Classes/LocationBackgroundPlugin.m index 2370d5ce6a87..24211c429541 100644 --- a/packages/location_background/ios/Classes/LocationBackgroundPlugin.m +++ b/packages/location_background/ios/Classes/LocationBackgroundPlugin.m @@ -99,8 +99,8 @@ - (instancetype)init:(NSObject *)registrar { [_locationManager setDelegate:self]; [_locationManager requestAlwaysAuthorization]; - _headlessEngine = - [[FlutterEngine alloc] initWithName:@"io.flutter.plugins.location_background" project:nil]; + _headlessEngine = [[FlutterEngine alloc] initWithName:@"io.flutter.plugins.location_background" + project:nil]; _registrar = registrar; // This is the method channel used to communicate with the UI Isolate. diff --git a/packages/package_info/ios/Classes/PackageInfoPlugin.h b/packages/package_info/ios/Classes/PackageInfoPlugin.h index 37f623228a94..5f58c82c9446 100644 --- a/packages/package_info/ios/Classes/PackageInfoPlugin.h +++ b/packages/package_info/ios/Classes/PackageInfoPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTPackageInfoPlugin : NSObject +@interface FLTPackageInfoPlugin : NSObject @end diff --git a/packages/path_provider/ios/Classes/PathProviderPlugin.h b/packages/path_provider/ios/Classes/PathProviderPlugin.h index 236c4c8db890..1ed0f26507f8 100644 --- a/packages/path_provider/ios/Classes/PathProviderPlugin.h +++ b/packages/path_provider/ios/Classes/PathProviderPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTPathProviderPlugin : NSObject +@interface FLTPathProviderPlugin : NSObject @end diff --git a/packages/quick_actions/ios/Classes/QuickActionsPlugin.h b/packages/quick_actions/ios/Classes/QuickActionsPlugin.h index 1ded954b80a9..f0ef61d445e9 100644 --- a/packages/quick_actions/ios/Classes/QuickActionsPlugin.h +++ b/packages/quick_actions/ios/Classes/QuickActionsPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTQuickActionsPlugin : NSObject +@interface FLTQuickActionsPlugin : NSObject @end diff --git a/packages/sensors/ios/Classes/SensorsPlugin.h b/packages/sensors/ios/Classes/SensorsPlugin.h index 1e674376e077..288db1901ed2 100644 --- a/packages/sensors/ios/Classes/SensorsPlugin.h +++ b/packages/sensors/ios/Classes/SensorsPlugin.h @@ -4,14 +4,14 @@ #import -@interface FLTSensorsPlugin : NSObject +@interface FLTSensorsPlugin : NSObject @end -@interface FLTUserAccelStreamHandler : NSObject +@interface FLTUserAccelStreamHandler : NSObject @end -@interface FLTAccelerometerStreamHandler : NSObject +@interface FLTAccelerometerStreamHandler : NSObject @end -@interface FLTGyroscopeStreamHandler : NSObject +@interface FLTGyroscopeStreamHandler : NSObject @end diff --git a/packages/share/ios/Classes/SharePlugin.h b/packages/share/ios/Classes/SharePlugin.h index 7fc0da2954e0..6f09616296b7 100644 --- a/packages/share/ios/Classes/SharePlugin.h +++ b/packages/share/ios/Classes/SharePlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTSharePlugin : NSObject +@interface FLTSharePlugin : NSObject @end diff --git a/packages/share/ios/Classes/SharePlugin.m b/packages/share/ios/Classes/SharePlugin.m index 77ae1d0789c7..7706e58e7152 100644 --- a/packages/share/ios/Classes/SharePlugin.m +++ b/packages/share/ios/Classes/SharePlugin.m @@ -19,8 +19,9 @@ + (void)registerWithRegistrar:(NSObject *)registrar { NSString *shareText = arguments[@"text"]; if (shareText.length == 0) { - result( - [FlutterError errorWithCode:@"error" message:@"Non-empty text expected" details:nil]); + result([FlutterError errorWithCode:@"error" + message:@"Non-empty text expected" + details:nil]); return; } diff --git a/packages/shared_preferences/ios/Classes/SharedPreferencesPlugin.h b/packages/shared_preferences/ios/Classes/SharedPreferencesPlugin.h index 49ecd57a5184..6bb1d5eecbeb 100644 --- a/packages/shared_preferences/ios/Classes/SharedPreferencesPlugin.h +++ b/packages/shared_preferences/ios/Classes/SharedPreferencesPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTSharedPreferencesPlugin : NSObject +@interface FLTSharedPreferencesPlugin : NSObject @end diff --git a/packages/shared_preferences/ios/Classes/SharedPreferencesPlugin.m b/packages/shared_preferences/ios/Classes/SharedPreferencesPlugin.m index 270f3a9efe53..74ebff28d03d 100644 --- a/packages/shared_preferences/ios/Classes/SharedPreferencesPlugin.m +++ b/packages/shared_preferences/ios/Classes/SharedPreferencesPlugin.m @@ -9,8 +9,8 @@ @implementation FLTSharedPreferencesPlugin + (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:CHANNEL_NAME binaryMessenger:registrar.messenger]; + FlutterMethodChannel *channel = [FlutterMethodChannel methodChannelWithName:CHANNEL_NAME + binaryMessenger:registrar.messenger]; [channel setMethodCallHandler:^(FlutterMethodCall *call, FlutterResult result) { NSString *method = [call method]; NSDictionary *arguments = [call arguments]; diff --git a/packages/url_launcher/ios/Classes/UrlLauncherPlugin.h b/packages/url_launcher/ios/Classes/UrlLauncherPlugin.h index 42ff5092b25a..e06009189384 100644 --- a/packages/url_launcher/ios/Classes/UrlLauncherPlugin.h +++ b/packages/url_launcher/ios/Classes/UrlLauncherPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTUrlLauncherPlugin : NSObject +@interface FLTUrlLauncherPlugin : NSObject @end diff --git a/packages/url_launcher/ios/Classes/UrlLauncherPlugin.m b/packages/url_launcher/ios/Classes/UrlLauncherPlugin.m index eeee84c9df0f..942a272a842f 100644 --- a/packages/url_launcher/ios/Classes/UrlLauncherPlugin.m +++ b/packages/url_launcher/ios/Classes/UrlLauncherPlugin.m @@ -6,7 +6,7 @@ #import "UrlLauncherPlugin.h" -@interface FLTUrlLaunchSession : NSObject +@interface FLTUrlLaunchSession : NSObject @end @implementation FLTUrlLaunchSession { @@ -92,7 +92,7 @@ - (void)launchURL:(NSString *)urlString result:(FlutterResult)result { UIApplication *application = [UIApplication sharedApplication]; if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) { [application openURL:url - options:@{} + options:@{} completionHandler:^(BOOL success) { if (success) { result(nil); diff --git a/packages/video_player/ios/Classes/VideoPlayerPlugin.h b/packages/video_player/ios/Classes/VideoPlayerPlugin.h index d5166b1782ad..18fdcca6d54e 100644 --- a/packages/video_player/ios/Classes/VideoPlayerPlugin.h +++ b/packages/video_player/ios/Classes/VideoPlayerPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTVideoPlayerPlugin : NSObject +@interface FLTVideoPlayerPlugin : NSObject @end diff --git a/packages/video_player/ios/Classes/VideoPlayerPlugin.m b/packages/video_player/ios/Classes/VideoPlayerPlugin.m index 7699831710c5..aeec622ce7b6 100644 --- a/packages/video_player/ios/Classes/VideoPlayerPlugin.m +++ b/packages/video_player/ios/Classes/VideoPlayerPlugin.m @@ -26,7 +26,7 @@ - (void)onDisplayLink:(CADisplayLink*)link { } @end -@interface FLTVideoPlayer : NSObject +@interface FLTVideoPlayer : NSObject @property(readonly, nonatomic) AVPlayer* player; @property(readonly, nonatomic) AVPlayerItemVideoOutput* videoOutput; @property(readonly, nonatomic) CADisplayLink* displayLink; @@ -113,8 +113,8 @@ - (instancetype)initWithURL:(NSURL*)url frameUpdater:(FLTFrameUpdater*)frameUpda AVAssetTrack* videoTrack = [tracks objectAtIndex:0]; void (^trackCompletionHandler)(void) = ^{ if (_disposed) return; - if ([videoTrack statusOfValueForKey:@"preferredTransform" error:nil] == - AVKeyValueStatusLoaded) { + if ([videoTrack statusOfValueForKey:@"preferredTransform" + error:nil] == AVKeyValueStatusLoaded) { dispatch_async(dispatch_get_main_queue(), ^{ [_player replaceCurrentItemWithPlayerItem:item]; }); @@ -126,8 +126,8 @@ - (instancetype)initWithURL:(NSURL*)url frameUpdater:(FLTFrameUpdater*)frameUpda } }; [asset loadValuesAsynchronouslyForKeys:@[ @"tracks" ] completionHandler:assetCompletionHandler]; - _displayLink = - [CADisplayLink displayLinkWithTarget:frameUpdater selector:@selector(onDisplayLink:)]; + _displayLink = [CADisplayLink displayLinkWithTarget:frameUpdater + selector:@selector(onDisplayLink:)]; [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; _displayLink.paused = YES; return self; @@ -352,7 +352,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { [eventChannel setStreamHandler:player]; player.eventChannel = eventChannel; _players[@(textureId)] = player; - result(@{ @"textureId" : @(textureId) }); + result(@{@"textureId" : @(textureId)}); } else { NSDictionary* argsMap = call.arguments; int64_t textureId = ((NSNumber*)argsMap[@"textureId"]).unsignedIntegerValue; diff --git a/packages/webview_flutter/ios/Classes/FlutterWebView.h b/packages/webview_flutter/ios/Classes/FlutterWebView.h index f5d2afddd9bd..665b0a45967c 100644 --- a/packages/webview_flutter/ios/Classes/FlutterWebView.h +++ b/packages/webview_flutter/ios/Classes/FlutterWebView.h @@ -3,7 +3,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface FLTWebViewController : NSObject +@interface FLTWebViewController : NSObject - (instancetype)initWithWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN - (UIView*)view; @end -@interface FLTWebViewFactory : NSObject +@interface FLTWebViewFactory : NSObject - (instancetype)initWithMessenger:(NSObject*)messenger; @end diff --git a/packages/webview_flutter/ios/Classes/WebViewFlutterPlugin.h b/packages/webview_flutter/ios/Classes/WebViewFlutterPlugin.h index da0a540d3ad9..ac25ee4d6856 100644 --- a/packages/webview_flutter/ios/Classes/WebViewFlutterPlugin.h +++ b/packages/webview_flutter/ios/Classes/WebViewFlutterPlugin.h @@ -4,5 +4,5 @@ #import -@interface FLTWebviewFlutterPlugin : NSObject +@interface FLTWebviewFlutterPlugin : NSObject @end