diff --git a/packages/camera/camera_avfoundation/CHANGELOG.md b/packages/camera/camera_avfoundation/CHANGELOG.md index b21271da150..28882e05828 100644 --- a/packages/camera/camera_avfoundation/CHANGELOG.md +++ b/packages/camera/camera_avfoundation/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.9.17+4 +* Updates Pigeon for non-nullable collection type support. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 0.9.17+3 diff --git a/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/include/camera_avfoundation/messages.g.h b/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/include/camera_avfoundation/messages.g.h index 8e3dd431443..2f1d8646afa 100644 --- a/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/include/camera_avfoundation/messages.g.h +++ b/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/include/camera_avfoundation/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #import @@ -182,8 +182,8 @@ typedef NS_ENUM(NSUInteger, FCPPlatformResolutionPreset) { @property(nonatomic, assign) double height; @end -/// The codec used by FCPCameraApi. -NSObject *FCPCameraApiGetCodec(void); +/// The codec used by all APIs. +NSObject *FCPGetMessagesCodec(void); @protocol FCPCameraApi /// Returns the list of available cameras. @@ -284,9 +284,6 @@ extern void SetUpFCPCameraApiWithSuffix(id binaryMesseng NSObject *_Nullable api, NSString *messageChannelSuffix); -/// The codec used by FCPCameraGlobalEventApi. -NSObject *FCPCameraGlobalEventApiGetCodec(void); - /// Handler for native callbacks that are not tied to a specific camera ID. @interface FCPCameraGlobalEventApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; @@ -297,9 +294,6 @@ NSObject *FCPCameraGlobalEventApiGetCodec(void); completion:(void (^)(FlutterError *_Nullable))completion; @end -/// The codec used by FCPCameraEventApi. -NSObject *FCPCameraEventApiGetCodec(void); - /// Handler for native callbacks that are tied to a specific camera ID. /// /// This is intended to be initialized with the camera ID as a suffix. diff --git a/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/messages.g.m b/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/messages.g.m index 3b4355f0709..0164b4d6c6c 100644 --- a/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/messages.g.m +++ b/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/messages.g.m @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #import "./include/camera_avfoundation/messages.g.h" @@ -16,7 +16,7 @@ #error File requires ARC to be enabled. #endif -static NSArray *wrapResult(id result, FlutterError *error) { +static NSArray *wrapResult(id result, FlutterError *error) { if (error) { return @[ error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] @@ -34,7 +34,7 @@ details:@""]; } -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { +static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { id result = array[key]; return (result == [NSNull null]) ? nil : result; } @@ -121,33 +121,33 @@ - (instancetype)initWithValue:(FCPPlatformResolutionPreset)value { @end @interface FCPPlatformCameraDescription () -+ (FCPPlatformCameraDescription *)fromList:(NSArray *)list; -+ (nullable FCPPlatformCameraDescription *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FCPPlatformCameraDescription *)fromList:(NSArray *)list; ++ (nullable FCPPlatformCameraDescription *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FCPPlatformCameraState () -+ (FCPPlatformCameraState *)fromList:(NSArray *)list; -+ (nullable FCPPlatformCameraState *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FCPPlatformCameraState *)fromList:(NSArray *)list; ++ (nullable FCPPlatformCameraState *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FCPPlatformMediaSettings () -+ (FCPPlatformMediaSettings *)fromList:(NSArray *)list; -+ (nullable FCPPlatformMediaSettings *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FCPPlatformMediaSettings *)fromList:(NSArray *)list; ++ (nullable FCPPlatformMediaSettings *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FCPPlatformPoint () -+ (FCPPlatformPoint *)fromList:(NSArray *)list; -+ (nullable FCPPlatformPoint *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FCPPlatformPoint *)fromList:(NSArray *)list; ++ (nullable FCPPlatformPoint *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FCPPlatformSize () -+ (FCPPlatformSize *)fromList:(NSArray *)list; -+ (nullable FCPPlatformSize *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FCPPlatformSize *)fromList:(NSArray *)list; ++ (nullable FCPPlatformSize *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @implementation FCPPlatformCameraDescription @@ -158,19 +158,21 @@ + (instancetype)makeWithName:(NSString *)name pigeonResult.lensDirection = lensDirection; return pigeonResult; } -+ (FCPPlatformCameraDescription *)fromList:(NSArray *)list { ++ (FCPPlatformCameraDescription *)fromList:(NSArray *)list { FCPPlatformCameraDescription *pigeonResult = [[FCPPlatformCameraDescription alloc] init]; pigeonResult.name = GetNullableObjectAtIndex(list, 0); - pigeonResult.lensDirection = [GetNullableObjectAtIndex(list, 1) integerValue]; + FCPPlatformCameraLensDirectionBox *boxedFCPPlatformCameraLensDirection = + GetNullableObjectAtIndex(list, 1); + pigeonResult.lensDirection = boxedFCPPlatformCameraLensDirection.value; return pigeonResult; } -+ (nullable FCPPlatformCameraDescription *)nullableFromList:(NSArray *)list { ++ (nullable FCPPlatformCameraDescription *)nullableFromList:(NSArray *)list { return (list) ? [FCPPlatformCameraDescription fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.name ?: [NSNull null], - @(self.lensDirection), + [[FCPPlatformCameraLensDirectionBox alloc] initWithValue:self.lensDirection], ]; } @end @@ -189,23 +191,25 @@ + (instancetype)makeWithPreviewSize:(FCPPlatformSize *)previewSize pigeonResult.focusPointSupported = focusPointSupported; return pigeonResult; } -+ (FCPPlatformCameraState *)fromList:(NSArray *)list { ++ (FCPPlatformCameraState *)fromList:(NSArray *)list { FCPPlatformCameraState *pigeonResult = [[FCPPlatformCameraState alloc] init]; - pigeonResult.previewSize = [FCPPlatformSize nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - pigeonResult.exposureMode = [GetNullableObjectAtIndex(list, 1) integerValue]; - pigeonResult.focusMode = [GetNullableObjectAtIndex(list, 2) integerValue]; + pigeonResult.previewSize = GetNullableObjectAtIndex(list, 0); + FCPPlatformExposureModeBox *boxedFCPPlatformExposureMode = GetNullableObjectAtIndex(list, 1); + pigeonResult.exposureMode = boxedFCPPlatformExposureMode.value; + FCPPlatformFocusModeBox *boxedFCPPlatformFocusMode = GetNullableObjectAtIndex(list, 2); + pigeonResult.focusMode = boxedFCPPlatformFocusMode.value; pigeonResult.exposurePointSupported = [GetNullableObjectAtIndex(list, 3) boolValue]; pigeonResult.focusPointSupported = [GetNullableObjectAtIndex(list, 4) boolValue]; return pigeonResult; } -+ (nullable FCPPlatformCameraState *)nullableFromList:(NSArray *)list { ++ (nullable FCPPlatformCameraState *)nullableFromList:(NSArray *)list { return (list) ? [FCPPlatformCameraState fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.previewSize ? [self.previewSize toList] : [NSNull null]), - @(self.exposureMode), - @(self.focusMode), + self.previewSize ?: [NSNull null], + [[FCPPlatformExposureModeBox alloc] initWithValue:self.exposureMode], + [[FCPPlatformFocusModeBox alloc] initWithValue:self.focusMode], @(self.exposurePointSupported), @(self.focusPointSupported), ]; @@ -226,21 +230,23 @@ + (instancetype)makeWithResolutionPreset:(FCPPlatformResolutionPreset)resolution pigeonResult.enableAudio = enableAudio; return pigeonResult; } -+ (FCPPlatformMediaSettings *)fromList:(NSArray *)list { ++ (FCPPlatformMediaSettings *)fromList:(NSArray *)list { FCPPlatformMediaSettings *pigeonResult = [[FCPPlatformMediaSettings alloc] init]; - pigeonResult.resolutionPreset = [GetNullableObjectAtIndex(list, 0) integerValue]; + FCPPlatformResolutionPresetBox *boxedFCPPlatformResolutionPreset = + GetNullableObjectAtIndex(list, 0); + pigeonResult.resolutionPreset = boxedFCPPlatformResolutionPreset.value; pigeonResult.framesPerSecond = GetNullableObjectAtIndex(list, 1); pigeonResult.videoBitrate = GetNullableObjectAtIndex(list, 2); pigeonResult.audioBitrate = GetNullableObjectAtIndex(list, 3); pigeonResult.enableAudio = [GetNullableObjectAtIndex(list, 4) boolValue]; return pigeonResult; } -+ (nullable FCPPlatformMediaSettings *)nullableFromList:(NSArray *)list { ++ (nullable FCPPlatformMediaSettings *)nullableFromList:(NSArray *)list { return (list) ? [FCPPlatformMediaSettings fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - @(self.resolutionPreset), + [[FCPPlatformResolutionPresetBox alloc] initWithValue:self.resolutionPreset], self.framesPerSecond ?: [NSNull null], self.videoBitrate ?: [NSNull null], self.audioBitrate ?: [NSNull null], @@ -256,16 +262,16 @@ + (instancetype)makeWithX:(double)x y:(double)y { pigeonResult.y = y; return pigeonResult; } -+ (FCPPlatformPoint *)fromList:(NSArray *)list { ++ (FCPPlatformPoint *)fromList:(NSArray *)list { FCPPlatformPoint *pigeonResult = [[FCPPlatformPoint alloc] init]; pigeonResult.x = [GetNullableObjectAtIndex(list, 0) doubleValue]; pigeonResult.y = [GetNullableObjectAtIndex(list, 1) doubleValue]; return pigeonResult; } -+ (nullable FCPPlatformPoint *)nullableFromList:(NSArray *)list { ++ (nullable FCPPlatformPoint *)nullableFromList:(NSArray *)list { return (list) ? [FCPPlatformPoint fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ @(self.x), @(self.y), @@ -280,16 +286,16 @@ + (instancetype)makeWithWidth:(double)width height:(double)height { pigeonResult.height = height; return pigeonResult; } -+ (FCPPlatformSize *)fromList:(NSArray *)list { ++ (FCPPlatformSize *)fromList:(NSArray *)list { FCPPlatformSize *pigeonResult = [[FCPPlatformSize alloc] init]; pigeonResult.width = [GetNullableObjectAtIndex(list, 0) doubleValue]; pigeonResult.height = [GetNullableObjectAtIndex(list, 1) doubleValue]; return pigeonResult; } -+ (nullable FCPPlatformSize *)nullableFromList:(NSArray *)list { ++ (nullable FCPPlatformSize *)nullableFromList:(NSArray *)list { return (list) ? [FCPPlatformSize fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ @(self.width), @(self.height), @@ -297,35 +303,125 @@ - (NSArray *)toList { } @end -@interface FCPCameraApiCodecReader : FlutterStandardReader +@interface FCPMessagesPigeonCodecReader : FlutterStandardReader @end -@implementation FCPCameraApiCodecReader +@implementation FCPMessagesPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 129: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FCPPlatformCameraLensDirectionBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 130: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FCPPlatformDeviceOrientationBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 131: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FCPPlatformExposureModeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 132: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FCPPlatformFlashModeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 133: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FCPPlatformFocusModeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 134: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FCPPlatformImageFileFormatBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 135: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FCPPlatformImageFormatGroupBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 136: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FCPPlatformResolutionPresetBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 137: return [FCPPlatformCameraDescription fromList:[self readValue]]; - case 129: + case 138: + return [FCPPlatformCameraState fromList:[self readValue]]; + case 139: return [FCPPlatformMediaSettings fromList:[self readValue]]; - case 130: + case 140: return [FCPPlatformPoint fromList:[self readValue]]; + case 141: + return [FCPPlatformSize fromList:[self readValue]]; default: return [super readValueOfType:type]; } } @end -@interface FCPCameraApiCodecWriter : FlutterStandardWriter +@interface FCPMessagesPigeonCodecWriter : FlutterStandardWriter @end -@implementation FCPCameraApiCodecWriter +@implementation FCPMessagesPigeonCodecWriter - (void)writeValue:(id)value { - if ([value isKindOfClass:[FCPPlatformCameraDescription class]]) { - [self writeByte:128]; + if ([value isKindOfClass:[FCPPlatformCameraLensDirectionBox class]]) { + FCPPlatformCameraLensDirectionBox *box = (FCPPlatformCameraLensDirectionBox *)value; + [self writeByte:129]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformDeviceOrientationBox class]]) { + FCPPlatformDeviceOrientationBox *box = (FCPPlatformDeviceOrientationBox *)value; + [self writeByte:130]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformExposureModeBox class]]) { + FCPPlatformExposureModeBox *box = (FCPPlatformExposureModeBox *)value; + [self writeByte:131]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformFlashModeBox class]]) { + FCPPlatformFlashModeBox *box = (FCPPlatformFlashModeBox *)value; + [self writeByte:132]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformFocusModeBox class]]) { + FCPPlatformFocusModeBox *box = (FCPPlatformFocusModeBox *)value; + [self writeByte:133]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformImageFileFormatBox class]]) { + FCPPlatformImageFileFormatBox *box = (FCPPlatformImageFileFormatBox *)value; + [self writeByte:134]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformImageFormatGroupBox class]]) { + FCPPlatformImageFormatGroupBox *box = (FCPPlatformImageFormatGroupBox *)value; + [self writeByte:135]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformResolutionPresetBox class]]) { + FCPPlatformResolutionPresetBox *box = (FCPPlatformResolutionPresetBox *)value; + [self writeByte:136]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformCameraDescription class]]) { + [self writeByte:137]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FCPPlatformCameraState class]]) { + [self writeByte:138]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[FCPPlatformMediaSettings class]]) { - [self writeByte:129]; + [self writeByte:139]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[FCPPlatformPoint class]]) { - [self writeByte:130]; + [self writeByte:140]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FCPPlatformSize class]]) { + [self writeByte:141]; [self writeValue:[value toList]]; } else { [super writeValue:value]; @@ -333,27 +429,27 @@ - (void)writeValue:(id)value { } @end -@interface FCPCameraApiCodecReaderWriter : FlutterStandardReaderWriter +@interface FCPMessagesPigeonCodecReaderWriter : FlutterStandardReaderWriter @end -@implementation FCPCameraApiCodecReaderWriter +@implementation FCPMessagesPigeonCodecReaderWriter - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FCPCameraApiCodecWriter alloc] initWithData:data]; + return [[FCPMessagesPigeonCodecWriter alloc] initWithData:data]; } - (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FCPCameraApiCodecReader alloc] initWithData:data]; + return [[FCPMessagesPigeonCodecReader alloc] initWithData:data]; } @end -NSObject *FCPCameraApiGetCodec(void) { +NSObject *FCPGetMessagesCodec(void) { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FCPCameraApiCodecReaderWriter *readerWriter = [[FCPCameraApiCodecReaderWriter alloc] init]; + FCPMessagesPigeonCodecReaderWriter *readerWriter = + [[FCPMessagesPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } - void SetUpFCPCameraApi(id binaryMessenger, NSObject *api) { SetUpFCPCameraApiWithSuffix(binaryMessenger, api, @""); } @@ -371,7 +467,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.getAvailableCameras", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(availableCamerasWithCompletion:)], @@ -396,14 +492,14 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.create", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(createCameraWithName:settings:completion:)], @"FCPCameraApi api (%@) doesn't respond to " @"@selector(createCameraWithName:settings:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_cameraName = GetNullableObjectAtIndex(args, 0); FCPPlatformMediaSettings *arg_settings = GetNullableObjectAtIndex(args, 1); [api createCameraWithName:arg_cameraName @@ -425,17 +521,18 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.initialize", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(initializeCamera:withImageFormat:completion:)], @"FCPCameraApi api (%@) doesn't respond to " @"@selector(initializeCamera:withImageFormat:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSInteger arg_cameraId = [GetNullableObjectAtIndex(args, 0) integerValue]; - FCPPlatformImageFormatGroup arg_imageFormat = - [GetNullableObjectAtIndex(args, 1) integerValue]; + FCPPlatformImageFormatGroupBox *boxedFCPPlatformImageFormatGroup = + GetNullableObjectAtIndex(args, 1); + FCPPlatformImageFormatGroup arg_imageFormat = boxedFCPPlatformImageFormatGroup.value; [api initializeCamera:arg_cameraId withImageFormat:arg_imageFormat completion:^(FlutterError *_Nullable error) { @@ -454,7 +551,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.startImageStream", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(startImageStreamWithCompletion:)], @@ -478,7 +575,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.stopImageStream", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(stopImageStreamWithCompletion:)], @@ -504,7 +601,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.receivedImageStreamData", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(receivedImageStreamDataWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to " @@ -528,13 +625,13 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.dispose", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(disposeCamera:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(disposeCamera:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSInteger arg_cameraId = [GetNullableObjectAtIndex(args, 0) integerValue]; [api disposeCamera:arg_cameraId completion:^(FlutterError *_Nullable error) { @@ -553,16 +650,17 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.lockCaptureOrientation", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(lockCaptureOrientation:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(lockCaptureOrientation:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FCPPlatformDeviceOrientation arg_orientation = - [GetNullableObjectAtIndex(args, 0) integerValue]; + NSArray *args = message; + FCPPlatformDeviceOrientationBox *boxedFCPPlatformDeviceOrientation = + GetNullableObjectAtIndex(args, 0); + FCPPlatformDeviceOrientation arg_orientation = boxedFCPPlatformDeviceOrientation.value; [api lockCaptureOrientation:arg_orientation completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -581,7 +679,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.unlockCaptureOrientation", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(unlockCaptureOrientationWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to " @@ -606,7 +704,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.takePicture", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(takePictureWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(takePictureWithCompletion:)", @@ -629,7 +727,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.prepareForVideoRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(prepareForVideoRecordingWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to " @@ -653,14 +751,14 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.startVideoRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(startVideoRecordingWithStreaming:completion:)], @"FCPCameraApi api (%@) doesn't respond to " @"@selector(startVideoRecordingWithStreaming:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; BOOL arg_enableStream = [GetNullableObjectAtIndex(args, 0) boolValue]; [api startVideoRecordingWithStreaming:arg_enableStream completion:^(FlutterError *_Nullable error) { @@ -679,7 +777,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.stopVideoRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(stopVideoRecordingWithCompletion:)], @@ -703,7 +801,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.pauseVideoRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(pauseVideoRecordingWithCompletion:)], @@ -726,7 +824,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.resumeVideoRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(resumeVideoRecordingWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to " @@ -750,14 +848,15 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.setFlashMode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setFlashMode:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setFlashMode:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FCPPlatformFlashMode arg_mode = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSArray *args = message; + FCPPlatformFlashModeBox *boxedFCPPlatformFlashMode = GetNullableObjectAtIndex(args, 0); + FCPPlatformFlashMode arg_mode = boxedFCPPlatformFlashMode.value; [api setFlashMode:arg_mode completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -776,14 +875,16 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposureMode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setExposureMode:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setExposureMode:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FCPPlatformExposureMode arg_mode = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSArray *args = message; + FCPPlatformExposureModeBox *boxedFCPPlatformExposureMode = + GetNullableObjectAtIndex(args, 0); + FCPPlatformExposureMode arg_mode = boxedFCPPlatformExposureMode.value; [api setExposureMode:arg_mode completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -803,13 +904,13 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.setExposurePoint", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setExposurePoint:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setExposurePoint:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FCPPlatformPoint *arg_point = GetNullableObjectAtIndex(args, 0); [api setExposurePoint:arg_point completion:^(FlutterError *_Nullable error) { @@ -828,7 +929,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.getMinExposureOffset", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getMinimumExposureOffset:)], @"FCPCameraApi api (%@) doesn't respond to @selector(getMinimumExposureOffset:)", @@ -850,7 +951,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.getMaxExposureOffset", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getMaximumExposureOffset:)], @"FCPCameraApi api (%@) doesn't respond to @selector(getMaximumExposureOffset:)", @@ -872,14 +973,14 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.setExposureOffset", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(setExposureOffset:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setExposureOffset:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; double arg_offset = [GetNullableObjectAtIndex(args, 0) doubleValue]; [api setExposureOffset:arg_offset completion:^(FlutterError *_Nullable error) { @@ -899,14 +1000,15 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusMode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setFocusMode:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setFocusMode:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FCPPlatformFocusMode arg_mode = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSArray *args = message; + FCPPlatformFocusModeBox *boxedFCPPlatformFocusMode = GetNullableObjectAtIndex(args, 0); + FCPPlatformFocusMode arg_mode = boxedFCPPlatformFocusMode.value; [api setFocusMode:arg_mode completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -927,13 +1029,13 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusPoint", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setFocusPoint:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setFocusPoint:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FCPPlatformPoint *arg_point = GetNullableObjectAtIndex(args, 0); [api setFocusPoint:arg_point completion:^(FlutterError *_Nullable error) { @@ -953,7 +1055,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.getMinZoomLevel", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getMinimumZoomLevel:)], @"FCPCameraApi api (%@) doesn't respond to @selector(getMinimumZoomLevel:)", api); @@ -975,7 +1077,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.getMaxZoomLevel", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getMaximumZoomLevel:)], @"FCPCameraApi api (%@) doesn't respond to @selector(getMaximumZoomLevel:)", api); @@ -997,13 +1099,13 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.setZoomLevel", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setZoomLevel:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setZoomLevel:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; double arg_zoom = [GetNullableObjectAtIndex(args, 0) doubleValue]; [api setZoomLevel:arg_zoom completion:^(FlutterError *_Nullable error) { @@ -1023,7 +1125,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.pausePreview", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(pausePreviewWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(pausePreviewWithCompletion:)", @@ -1046,7 +1148,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.resumePreview", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(resumePreviewWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(resumePreviewWithCompletion:)", @@ -1070,7 +1172,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.updateDescriptionWhileRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(updateDescriptionWhileRecordingCameraName: completion:)], @@ -1078,7 +1180,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"@selector(updateDescriptionWhileRecordingCameraName:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_cameraName = GetNullableObjectAtIndex(args, 0); [api updateDescriptionWhileRecordingCameraName:arg_cameraName completion:^(FlutterError *_Nullable error) { @@ -1097,15 +1199,17 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.setImageFileFormat", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(setImageFileFormat:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setImageFileFormat:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FCPPlatformImageFileFormat arg_format = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSArray *args = message; + FCPPlatformImageFileFormatBox *boxedFCPPlatformImageFileFormat = + GetNullableObjectAtIndex(args, 0); + FCPPlatformImageFileFormat arg_format = boxedFCPPlatformImageFileFormat.value; [api setImageFileFormat:arg_format completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1116,12 +1220,6 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, } } } -NSObject *FCPCameraGlobalEventApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - @interface FCPCameraGlobalEventApi () @property(nonatomic, strong) NSObject *binaryMessenger; @property(nonatomic, strong) NSString *messageChannelSuffix; @@ -1153,8 +1251,8 @@ - (void)deviceOrientationChangedOrientation:(FCPPlatformDeviceOrientation)arg_or FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:FCPCameraGlobalEventApiGetCodec()]; - [channel sendMessage:@[ [NSNumber numberWithInteger:arg_orientation] ] + codec:FCPGetMessagesCodec()]; + [channel sendMessage:@[ [[FCPPlatformDeviceOrientationBox alloc] initWithValue:arg_orientation] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -1171,59 +1269,6 @@ - (void)deviceOrientationChangedOrientation:(FCPPlatformDeviceOrientation)arg_or } @end -@interface FCPCameraEventApiCodecReader : FlutterStandardReader -@end -@implementation FCPCameraEventApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FCPPlatformCameraState fromList:[self readValue]]; - case 129: - return [FCPPlatformSize fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FCPCameraEventApiCodecWriter : FlutterStandardWriter -@end -@implementation FCPCameraEventApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FCPPlatformCameraState class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FCPPlatformSize class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FCPCameraEventApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FCPCameraEventApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FCPCameraEventApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FCPCameraEventApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FCPCameraEventApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FCPCameraEventApiCodecReaderWriter *readerWriter = - [[FCPCameraEventApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - @interface FCPCameraEventApi () @property(nonatomic, strong) NSObject *binaryMessenger; @property(nonatomic, strong) NSString *messageChannelSuffix; @@ -1254,7 +1299,7 @@ - (void)initializedWithState:(FCPPlatformCameraState *)arg_initialState FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:FCPCameraEventApiGetCodec()]; + codec:FCPGetMessagesCodec()]; [channel sendMessage:@[ arg_initialState ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { @@ -1278,7 +1323,7 @@ - (void)reportError:(NSString *)arg_message FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:FCPCameraEventApiGetCodec()]; + codec:FCPGetMessagesCodec()]; [channel sendMessage:@[ arg_message ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { diff --git a/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart b/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart index d3d5bd8fe4f..286e01940bf 100644 --- a/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart +++ b/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart @@ -68,8 +68,6 @@ class AVFoundationCamera extends CameraPlatform { Future> availableCameras() async { try { return (await _hostApi.getAvailableCameras()) - // See comment in messages.dart for why this is safe. - .map((PlatformCameraDescription? c) => c!) .map(cameraDescriptionFromPlatform) .toList(); } on PlatformException catch (e) { diff --git a/packages/camera/camera_avfoundation/lib/src/messages.g.dart b/packages/camera/camera_avfoundation/lib/src/messages.g.dart index 4290eb02ed2..535f03e34c2 100644 --- a/packages/camera/camera_avfoundation/lib/src/messages.g.dart +++ b/packages/camera/camera_avfoundation/lib/src/messages.g.dart @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -99,7 +99,7 @@ class PlatformCameraDescription { Object encode() { return [ name, - lensDirection.index, + lensDirection, ]; } @@ -107,7 +107,7 @@ class PlatformCameraDescription { result as List; return PlatformCameraDescription( name: result[0]! as String, - lensDirection: PlatformCameraLensDirection.values[result[1]! as int], + lensDirection: result[1]! as PlatformCameraLensDirection, ); } } @@ -138,9 +138,9 @@ class PlatformCameraState { Object encode() { return [ - previewSize.encode(), - exposureMode.index, - focusMode.index, + previewSize, + exposureMode, + focusMode, exposurePointSupported, focusPointSupported, ]; @@ -149,9 +149,9 @@ class PlatformCameraState { static PlatformCameraState decode(Object result) { result as List; return PlatformCameraState( - previewSize: PlatformSize.decode(result[0]! as List), - exposureMode: PlatformExposureMode.values[result[1]! as int], - focusMode: PlatformFocusMode.values[result[2]! as int], + previewSize: result[0]! as PlatformSize, + exposureMode: result[1]! as PlatformExposureMode, + focusMode: result[2]! as PlatformFocusMode, exposurePointSupported: result[3]! as bool, focusPointSupported: result[4]! as bool, ); @@ -179,7 +179,7 @@ class PlatformMediaSettings { Object encode() { return [ - resolutionPreset.index, + resolutionPreset, framesPerSecond, videoBitrate, audioBitrate, @@ -190,7 +190,7 @@ class PlatformMediaSettings { static PlatformMediaSettings decode(Object result) { result as List; return PlatformMediaSettings( - resolutionPreset: PlatformResolutionPreset.values[result[0]! as int], + resolutionPreset: result[0]! as PlatformResolutionPreset, framesPerSecond: result[1] as int?, videoBitrate: result[2] as int?, audioBitrate: result[3] as int?, @@ -251,18 +251,51 @@ class PlatformSize { } } -class _CameraApiCodec extends StandardMessageCodec { - const _CameraApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is PlatformCameraDescription) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is PlatformCameraLensDirection) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is PlatformDeviceOrientation) { + buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is PlatformExposureMode) { + buffer.putUint8(131); + writeValue(buffer, value.index); + } else if (value is PlatformFlashMode) { + buffer.putUint8(132); + writeValue(buffer, value.index); + } else if (value is PlatformFocusMode) { + buffer.putUint8(133); + writeValue(buffer, value.index); + } else if (value is PlatformImageFileFormat) { + buffer.putUint8(134); + writeValue(buffer, value.index); + } else if (value is PlatformImageFormatGroup) { + buffer.putUint8(135); + writeValue(buffer, value.index); + } else if (value is PlatformResolutionPreset) { + buffer.putUint8(136); + writeValue(buffer, value.index); + } else if (value is PlatformCameraDescription) { + buffer.putUint8(137); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraState) { + buffer.putUint8(138); writeValue(buffer, value.encode()); } else if (value is PlatformMediaSettings) { - buffer.putUint8(129); + buffer.putUint8(139); writeValue(buffer, value.encode()); } else if (value is PlatformPoint) { - buffer.putUint8(130); + buffer.putUint8(140); + writeValue(buffer, value.encode()); + } else if (value is PlatformSize) { + buffer.putUint8(141); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -272,12 +305,40 @@ class _CameraApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return PlatformCameraDescription.decode(readValue(buffer)!); case 129: - return PlatformMediaSettings.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformCameraLensDirection.values[value]; case 130: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformDeviceOrientation.values[value]; + case 131: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformExposureMode.values[value]; + case 132: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformFlashMode.values[value]; + case 133: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformFocusMode.values[value]; + case 134: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformImageFileFormat.values[value]; + case 135: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformImageFormatGroup.values[value]; + case 136: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformResolutionPreset.values[value]; + case 137: + return PlatformCameraDescription.decode(readValue(buffer)!); + case 138: + return PlatformCameraState.decode(readValue(buffer)!); + case 139: + return PlatformMediaSettings.decode(readValue(buffer)!); + case 140: return PlatformPoint.decode(readValue(buffer)!); + case 141: + return PlatformSize.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -290,96 +351,96 @@ class CameraApi { /// BinaryMessenger will be used which routes to the host platform. CameraApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = _CameraApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; /// Returns the list of available cameras. - Future> getAvailableCameras() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getAvailableCameras$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + Future> getAvailableCameras() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getAvailableCameras$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)! - .cast(); + return (pigeonVar_replyList[0] as List?)! + .cast(); } } /// Create a new camera with the given settings, and returns its ID. Future create(String cameraName, PlatformMediaSettings settings) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.create$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.create$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([cameraName, settings]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as int?)!; + return (pigeonVar_replyList[0] as int?)!; } } /// Initializes the camera with the given ID. Future initialize( int cameraId, PlatformImageFormatGroup imageFormat) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.initialize$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.initialize$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([cameraId, imageFormat.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([cameraId, imageFormat]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -388,23 +449,23 @@ class CameraApi { /// Begins streaming frames from the camera. Future startImageStream() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.startImageStream$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.startImageStream$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -413,23 +474,23 @@ class CameraApi { /// Stops streaming frames from the camera. Future stopImageStream() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.stopImageStream$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.stopImageStream$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -441,23 +502,23 @@ class CameraApi { /// /// This is used to throttle sending frames across the channel. Future receivedImageStreamData() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.receivedImageStreamData$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.receivedImageStreamData$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -467,23 +528,23 @@ class CameraApi { /// Indicates that the given camera is no longer being used on the Dart side, /// and any associated resources can be cleaned up. Future dispose(int cameraId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.dispose$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.dispose$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([cameraId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([cameraId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -493,23 +554,23 @@ class CameraApi { /// Locks the camera capture to the current device orientation. Future lockCaptureOrientation( PlatformDeviceOrientation orientation) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.lockCaptureOrientation$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.lockCaptureOrientation$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([orientation.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([orientation]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -519,23 +580,23 @@ class CameraApi { /// Unlocks camera capture orientation, allowing it to automatically adapt to /// device orientation. Future unlockCaptureOrientation() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.unlockCaptureOrientation$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.unlockCaptureOrientation$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -545,53 +606,53 @@ class CameraApi { /// Takes a picture with the current settings, and returns the path to the /// resulting file. Future takePicture() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.takePicture$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.takePicture$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as String?)!; + return (pigeonVar_replyList[0] as String?)!; } } /// Does any preprocessing necessary before beginning to record video. Future prepareForVideoRecording() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.prepareForVideoRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.prepareForVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -601,23 +662,23 @@ class CameraApi { /// Begins recording video, optionally enabling streaming to Dart at the same /// time. Future startVideoRecording(bool enableStream) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.startVideoRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.startVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([enableStream]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enableStream]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -626,53 +687,53 @@ class CameraApi { /// Stops recording video, and results the path to the resulting file. Future stopVideoRecording() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.stopVideoRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.stopVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as String?)!; + return (pigeonVar_replyList[0] as String?)!; } } /// Pauses video recording. Future pauseVideoRecording() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.pauseVideoRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.pauseVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -681,23 +742,23 @@ class CameraApi { /// Resumes a previously paused video recording. Future resumeVideoRecording() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.resumeVideoRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.resumeVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -706,23 +767,23 @@ class CameraApi { /// Switches the camera to the given flash mode. Future setFlashMode(PlatformFlashMode mode) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFlashMode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFlashMode$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([mode.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([mode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -731,23 +792,23 @@ class CameraApi { /// Switches the camera to the given exposure mode. Future setExposureMode(PlatformExposureMode mode) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposureMode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposureMode$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([mode.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([mode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -758,23 +819,23 @@ class CameraApi { /// /// A null value resets to the default exposure point. Future setExposurePoint(PlatformPoint? point) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposurePoint$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposurePoint$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([point]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([point]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -783,83 +844,83 @@ class CameraApi { /// Returns the minimum exposure offset supported by the camera. Future getMinExposureOffset() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMinExposureOffset$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMinExposureOffset$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } /// Returns the maximum exposure offset supported by the camera. Future getMaxExposureOffset() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMaxExposureOffset$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMaxExposureOffset$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } /// Sets the exposure offset manually to the given value. Future setExposureOffset(double offset) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposureOffset$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposureOffset$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([offset]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([offset]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -868,23 +929,23 @@ class CameraApi { /// Switches the camera to the given focus mode. Future setFocusMode(PlatformFocusMode mode) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusMode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusMode$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([mode.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([mode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -895,23 +956,23 @@ class CameraApi { /// /// A null value resets to the default focus point. Future setFocusPoint(PlatformPoint? point) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusPoint$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusPoint$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([point]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([point]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -920,83 +981,83 @@ class CameraApi { /// Returns the minimum zoom level supported by the camera. Future getMinZoomLevel() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMinZoomLevel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMinZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } /// Returns the maximum zoom level supported by the camera. Future getMaxZoomLevel() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMaxZoomLevel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMaxZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } /// Sets the zoom factor. Future setZoomLevel(double zoom) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setZoomLevel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([zoom]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([zoom]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1005,23 +1066,23 @@ class CameraApi { /// Pauses streaming of preview frames. Future pausePreview() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.pausePreview$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.pausePreview$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1030,23 +1091,23 @@ class CameraApi { /// Resumes a previously paused preview stream. Future resumePreview() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.resumePreview$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.resumePreview$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1057,23 +1118,23 @@ class CameraApi { /// /// This should only be called while video recording is active. Future updateDescriptionWhileRecording(String cameraName) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.updateDescriptionWhileRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.updateDescriptionWhileRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([cameraName]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([cameraName]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1082,23 +1143,23 @@ class CameraApi { /// Sets the file format used for taking pictures. Future setImageFileFormat(PlatformImageFileFormat format) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setImageFileFormat$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setImageFileFormat$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([format.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([format]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1108,8 +1169,7 @@ class CameraApi { /// Handler for native callbacks that are not tied to a specific camera ID. abstract class CameraGlobalEventApi { - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// Called when the device's physical orientation changes. void deviceOrientationChanged(PlatformDeviceOrientation orientation); @@ -1122,21 +1182,21 @@ abstract class CameraGlobalEventApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.camera_avfoundation.CameraGlobalEventApi.deviceOrientationChanged$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.camera_avfoundation.CameraGlobalEventApi.deviceOrientationChanged was null.'); final List args = (message as List?)!; - final PlatformDeviceOrientation? arg_orientation = args[0] == null - ? null - : PlatformDeviceOrientation.values[args[0]! as int]; + final PlatformDeviceOrientation? arg_orientation = + (args[0] as PlatformDeviceOrientation?); assert(arg_orientation != null, 'Argument for dev.flutter.pigeon.camera_avfoundation.CameraGlobalEventApi.deviceOrientationChanged was null, expected non-null PlatformDeviceOrientation.'); try { @@ -1154,40 +1214,11 @@ abstract class CameraGlobalEventApi { } } -class _CameraEventApiCodec extends StandardMessageCodec { - const _CameraEventApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PlatformCameraState) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PlatformSize) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return PlatformCameraState.decode(readValue(buffer)!); - case 129: - return PlatformSize.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - /// Handler for native callbacks that are tied to a specific camera ID. /// /// This is intended to be initialized with the camera ID as a suffix. abstract class CameraEventApi { - static const MessageCodec pigeonChannelCodec = - _CameraEventApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// Called when the camera is inialitized for use. void initialized(PlatformCameraState initialState); @@ -1206,15 +1237,16 @@ abstract class CameraEventApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.camera_avfoundation.CameraEventApi.initialized$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.camera_avfoundation.CameraEventApi.initialized was null.'); final List args = (message as List?)!; @@ -1235,15 +1267,16 @@ abstract class CameraEventApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.camera_avfoundation.CameraEventApi.error$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.camera_avfoundation.CameraEventApi.error was null.'); final List args = (message as List?)!; diff --git a/packages/camera/camera_avfoundation/pigeons/messages.dart b/packages/camera/camera_avfoundation/pigeons/messages.dart index c50ecc33e40..272ea288960 100644 --- a/packages/camera/camera_avfoundation/pigeons/messages.dart +++ b/packages/camera/camera_avfoundation/pigeons/messages.dart @@ -160,7 +160,7 @@ abstract class CameraApi { // The consuming code treats it as non-nullable. @async @ObjCSelector('availableCamerasWithCompletion') - List getAvailableCameras(); + List getAvailableCameras(); /// Create a new camera with the given settings, and returns its ID. @async diff --git a/packages/camera/camera_avfoundation/pubspec.yaml b/packages/camera/camera_avfoundation/pubspec.yaml index 69b8f40c47d..2fbbddb34c8 100644 --- a/packages/camera/camera_avfoundation/pubspec.yaml +++ b/packages/camera/camera_avfoundation/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_avfoundation description: iOS implementation of the camera plugin. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_avfoundation issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.9.17+3 +version: 0.9.17+4 environment: sdk: ^3.3.0 @@ -28,7 +28,7 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.4.4 - pigeon: ^18.0.0 + pigeon: ^22.4.2 topics: - camera diff --git a/packages/camera/camera_avfoundation/test/avfoundation_camera_test.mocks.dart b/packages/camera/camera_avfoundation/test/avfoundation_camera_test.mocks.dart index 729b39f7f28..b1118578a16 100644 --- a/packages/camera/camera_avfoundation/test/avfoundation_camera_test.mocks.dart +++ b/packages/camera/camera_avfoundation/test/avfoundation_camera_test.mocks.dart @@ -3,11 +3,11 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i3; +import 'dart:async' as _i4; import 'package:camera_avfoundation/src/messages.g.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i4; +import 'package:mockito/src/dummies.dart' as _i3; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -27,21 +27,34 @@ import 'package:mockito/src/dummies.dart' as _i4; /// See the documentation for Mockito's code generation for more information. class MockCameraApi extends _i1.Mock implements _i2.CameraApi { @override - _i3.Future> getAvailableCameras() => + String get pigeonVar_messageChannelSuffix => (super.noSuchMethod( + Invocation.getter(#pigeonVar_messageChannelSuffix), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + returnValueForMissingStub: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + ) as String); + + @override + _i4.Future> getAvailableCameras() => (super.noSuchMethod( Invocation.method( #getAvailableCameras, [], ), - returnValue: _i3.Future>.value( - <_i2.PlatformCameraDescription?>[]), + returnValue: _i4.Future>.value( + <_i2.PlatformCameraDescription>[]), returnValueForMissingStub: - _i3.Future>.value( - <_i2.PlatformCameraDescription?>[]), - ) as _i3.Future>); + _i4.Future>.value( + <_i2.PlatformCameraDescription>[]), + ) as _i4.Future>); @override - _i3.Future create( + _i4.Future create( String? cameraName, _i2.PlatformMediaSettings? settings, ) => @@ -53,12 +66,12 @@ class MockCameraApi extends _i1.Mock implements _i2.CameraApi { settings, ], ), - returnValue: _i3.Future.value(0), - returnValueForMissingStub: _i3.Future.value(0), - ) as _i3.Future); + returnValue: _i4.Future.value(0), + returnValueForMissingStub: _i4.Future.value(0), + ) as _i4.Future); @override - _i3.Future initialize( + _i4.Future initialize( int? cameraId, _i2.PlatformImageFormatGroup? imageFormat, ) => @@ -70,79 +83,79 @@ class MockCameraApi extends _i1.Mock implements _i2.CameraApi { imageFormat, ], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future startImageStream() => (super.noSuchMethod( + _i4.Future startImageStream() => (super.noSuchMethod( Invocation.method( #startImageStream, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future stopImageStream() => (super.noSuchMethod( + _i4.Future stopImageStream() => (super.noSuchMethod( Invocation.method( #stopImageStream, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future receivedImageStreamData() => (super.noSuchMethod( + _i4.Future receivedImageStreamData() => (super.noSuchMethod( Invocation.method( #receivedImageStreamData, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future dispose(int? cameraId) => (super.noSuchMethod( + _i4.Future dispose(int? cameraId) => (super.noSuchMethod( Invocation.method( #dispose, [cameraId], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future lockCaptureOrientation( + _i4.Future lockCaptureOrientation( _i2.PlatformDeviceOrientation? orientation) => (super.noSuchMethod( Invocation.method( #lockCaptureOrientation, [orientation], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future unlockCaptureOrientation() => (super.noSuchMethod( + _i4.Future unlockCaptureOrientation() => (super.noSuchMethod( Invocation.method( #unlockCaptureOrientation, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future takePicture() => (super.noSuchMethod( + _i4.Future takePicture() => (super.noSuchMethod( Invocation.method( #takePicture, [], ), - returnValue: _i3.Future.value(_i4.dummyValue( + returnValue: _i4.Future.value(_i3.dummyValue( this, Invocation.method( #takePicture, @@ -150,43 +163,43 @@ class MockCameraApi extends _i1.Mock implements _i2.CameraApi { ), )), returnValueForMissingStub: - _i3.Future.value(_i4.dummyValue( + _i4.Future.value(_i3.dummyValue( this, Invocation.method( #takePicture, [], ), )), - ) as _i3.Future); + ) as _i4.Future); @override - _i3.Future prepareForVideoRecording() => (super.noSuchMethod( + _i4.Future prepareForVideoRecording() => (super.noSuchMethod( Invocation.method( #prepareForVideoRecording, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future startVideoRecording(bool? enableStream) => + _i4.Future startVideoRecording(bool? enableStream) => (super.noSuchMethod( Invocation.method( #startVideoRecording, [enableStream], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future stopVideoRecording() => (super.noSuchMethod( + _i4.Future stopVideoRecording() => (super.noSuchMethod( Invocation.method( #stopVideoRecording, [], ), - returnValue: _i3.Future.value(_i4.dummyValue( + returnValue: _i4.Future.value(_i3.dummyValue( this, Invocation.method( #stopVideoRecording, @@ -194,189 +207,189 @@ class MockCameraApi extends _i1.Mock implements _i2.CameraApi { ), )), returnValueForMissingStub: - _i3.Future.value(_i4.dummyValue( + _i4.Future.value(_i3.dummyValue( this, Invocation.method( #stopVideoRecording, [], ), )), - ) as _i3.Future); + ) as _i4.Future); @override - _i3.Future pauseVideoRecording() => (super.noSuchMethod( + _i4.Future pauseVideoRecording() => (super.noSuchMethod( Invocation.method( #pauseVideoRecording, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future resumeVideoRecording() => (super.noSuchMethod( + _i4.Future resumeVideoRecording() => (super.noSuchMethod( Invocation.method( #resumeVideoRecording, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setFlashMode(_i2.PlatformFlashMode? mode) => + _i4.Future setFlashMode(_i2.PlatformFlashMode? mode) => (super.noSuchMethod( Invocation.method( #setFlashMode, [mode], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setExposureMode(_i2.PlatformExposureMode? mode) => + _i4.Future setExposureMode(_i2.PlatformExposureMode? mode) => (super.noSuchMethod( Invocation.method( #setExposureMode, [mode], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setExposurePoint(_i2.PlatformPoint? point) => + _i4.Future setExposurePoint(_i2.PlatformPoint? point) => (super.noSuchMethod( Invocation.method( #setExposurePoint, [point], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future getMinExposureOffset() => (super.noSuchMethod( + _i4.Future getMinExposureOffset() => (super.noSuchMethod( Invocation.method( #getMinExposureOffset, [], ), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) as _i3.Future); + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); @override - _i3.Future getMaxExposureOffset() => (super.noSuchMethod( + _i4.Future getMaxExposureOffset() => (super.noSuchMethod( Invocation.method( #getMaxExposureOffset, [], ), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) as _i3.Future); + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); @override - _i3.Future setExposureOffset(double? offset) => (super.noSuchMethod( + _i4.Future setExposureOffset(double? offset) => (super.noSuchMethod( Invocation.method( #setExposureOffset, [offset], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setFocusMode(_i2.PlatformFocusMode? mode) => + _i4.Future setFocusMode(_i2.PlatformFocusMode? mode) => (super.noSuchMethod( Invocation.method( #setFocusMode, [mode], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setFocusPoint(_i2.PlatformPoint? point) => + _i4.Future setFocusPoint(_i2.PlatformPoint? point) => (super.noSuchMethod( Invocation.method( #setFocusPoint, [point], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future getMinZoomLevel() => (super.noSuchMethod( + _i4.Future getMinZoomLevel() => (super.noSuchMethod( Invocation.method( #getMinZoomLevel, [], ), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) as _i3.Future); + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); @override - _i3.Future getMaxZoomLevel() => (super.noSuchMethod( + _i4.Future getMaxZoomLevel() => (super.noSuchMethod( Invocation.method( #getMaxZoomLevel, [], ), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) as _i3.Future); + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); @override - _i3.Future setZoomLevel(double? zoom) => (super.noSuchMethod( + _i4.Future setZoomLevel(double? zoom) => (super.noSuchMethod( Invocation.method( #setZoomLevel, [zoom], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future pausePreview() => (super.noSuchMethod( + _i4.Future pausePreview() => (super.noSuchMethod( Invocation.method( #pausePreview, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future resumePreview() => (super.noSuchMethod( + _i4.Future resumePreview() => (super.noSuchMethod( Invocation.method( #resumePreview, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future updateDescriptionWhileRecording(String? cameraName) => + _i4.Future updateDescriptionWhileRecording(String? cameraName) => (super.noSuchMethod( Invocation.method( #updateDescriptionWhileRecording, [cameraName], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setImageFileFormat(_i2.PlatformImageFileFormat? format) => + _i4.Future setImageFileFormat(_i2.PlatformImageFileFormat? format) => (super.noSuchMethod( Invocation.method( #setImageFileFormat, [format], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); }