setupCamera method
Implementation
Future<bool> setupCamera(
String arg_sensor,
String arg_aspectRatio,
double arg_zoom,
bool arg_mirrorFrontCamera,
bool arg_enablePhysicalButton,
String arg_flashMode,
String arg_captureMode,
bool arg_enableImageStream,
ExifPreferences arg_exifPreferences) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.CameraInterface.setupCamera', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList = await channel.send(<Object?>[
arg_sensor,
arg_aspectRatio,
arg_zoom,
arg_mirrorFrontCamera,
arg_enablePhysicalButton,
arg_flashMode,
arg_captureMode,
arg_enableImageStream,
arg_exifPreferences
]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else if (replyList[0] == null) {
throw PlatformException(
code: 'null-error',
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (replyList[0] as bool?)!;
}
}