Update to the latest pigeon (#3561)

Update to the latest pigeon
This commit is contained in:
Nate Bosch
2023-03-27 14:45:00 -07:00
committed by GitHub
parent ded5482b51
commit 3347a31dbf
4 changed files with 554 additions and 785 deletions

View File

@ -1,13 +1,14 @@
// Copyright 2013 The Flutter Authors. All rights reserved. // Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Autogenerated from Pigeon (v3.2.9), do not edit directly. // Autogenerated from Pigeon (v9.1.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon // 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 // 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
import 'dart:async';
import 'dart:typed_data' show Uint8List, Int32List, Int64List, Float64List;
import 'package:flutter/foundation.dart' show WriteBuffer, ReadBuffer; import 'dart:async';
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
class ResolutionInfo { class ResolutionInfo {
@ -17,20 +18,21 @@ class ResolutionInfo {
}); });
int width; int width;
int height; int height;
Object encode() { Object encode() {
final Map<Object?, Object?> pigeonMap = <Object?, Object?>{}; return <Object?>[
pigeonMap['width'] = width; width,
pigeonMap['height'] = height; height,
return pigeonMap; ];
} }
static ResolutionInfo decode(Object message) { static ResolutionInfo decode(Object result) {
final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>; result as List<Object?>;
return ResolutionInfo( return ResolutionInfo(
width: pigeonMap['width']! as int, width: result[0]! as int,
height: pigeonMap['height']! as int, height: result[1]! as int,
); );
} }
} }
@ -42,57 +44,53 @@ class CameraPermissionsErrorData {
}); });
String errorCode; String errorCode;
String description; String description;
Object encode() { Object encode() {
final Map<Object?, Object?> pigeonMap = <Object?, Object?>{}; return <Object?>[
pigeonMap['errorCode'] = errorCode; errorCode,
pigeonMap['description'] = description; description,
return pigeonMap; ];
} }
static CameraPermissionsErrorData decode(Object message) { static CameraPermissionsErrorData decode(Object result) {
final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>; result as List<Object?>;
return CameraPermissionsErrorData( return CameraPermissionsErrorData(
errorCode: pigeonMap['errorCode']! as String, errorCode: result[0]! as String,
description: pigeonMap['description']! as String, description: result[1]! as String,
); );
} }
} }
class _InstanceManagerHostApiCodec extends StandardMessageCodec {
const _InstanceManagerHostApiCodec();
}
class InstanceManagerHostApi { class InstanceManagerHostApi {
/// Constructor for [InstanceManagerHostApi]. The [binaryMessenger] named argument is /// Constructor for [InstanceManagerHostApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default /// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform. /// BinaryMessenger will be used which routes to the host platform.
InstanceManagerHostApi({BinaryMessenger? binaryMessenger}) InstanceManagerHostApi({BinaryMessenger? binaryMessenger})
: _binaryMessenger = binaryMessenger; : _binaryMessenger = binaryMessenger;
final BinaryMessenger? _binaryMessenger; final BinaryMessenger? _binaryMessenger;
static const MessageCodec<Object?> codec = _InstanceManagerHostApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
/// Clear the native `InstanceManager`.
///
/// This is typically only used after a hot restart.
Future<void> clear() async { Future<void> clear() async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList = await channel.send(null) as List<Object?>?;
await channel.send(null) as Map<Object?, Object?>?; if (replyList == null) {
if (replyMap == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -100,39 +98,32 @@ class InstanceManagerHostApi {
} }
} }
class _JavaObjectHostApiCodec extends StandardMessageCodec {
const _JavaObjectHostApiCodec();
}
class JavaObjectHostApi { class JavaObjectHostApi {
/// Constructor for [JavaObjectHostApi]. The [binaryMessenger] named argument is /// Constructor for [JavaObjectHostApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default /// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform. /// BinaryMessenger will be used which routes to the host platform.
JavaObjectHostApi({BinaryMessenger? binaryMessenger}) JavaObjectHostApi({BinaryMessenger? binaryMessenger})
: _binaryMessenger = binaryMessenger; : _binaryMessenger = binaryMessenger;
final BinaryMessenger? _binaryMessenger; final BinaryMessenger? _binaryMessenger;
static const MessageCodec<Object?> codec = _JavaObjectHostApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
Future<void> dispose(int arg_identifier) async { Future<void> dispose(int arg_identifier) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.JavaObjectHostApi.dispose', codec, 'dev.flutter.pigeon.JavaObjectHostApi.dispose', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList =
await channel.send(<Object?>[arg_identifier]) as Map<Object?, Object?>?; await channel.send(<Object?>[arg_identifier]) as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -140,14 +131,11 @@ class JavaObjectHostApi {
} }
} }
class _JavaObjectFlutterApiCodec extends StandardMessageCodec {
const _JavaObjectFlutterApiCodec();
}
abstract class JavaObjectFlutterApi { abstract class JavaObjectFlutterApi {
static const MessageCodec<Object?> codec = _JavaObjectFlutterApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
void dispose(int identifier); void dispose(int identifier);
static void setup(JavaObjectFlutterApi? api, static void setup(JavaObjectFlutterApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -172,59 +160,49 @@ abstract class JavaObjectFlutterApi {
} }
} }
class _CameraInfoHostApiCodec extends StandardMessageCodec {
const _CameraInfoHostApiCodec();
}
class CameraInfoHostApi { class CameraInfoHostApi {
/// Constructor for [CameraInfoHostApi]. The [binaryMessenger] named argument is /// Constructor for [CameraInfoHostApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default /// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform. /// BinaryMessenger will be used which routes to the host platform.
CameraInfoHostApi({BinaryMessenger? binaryMessenger}) CameraInfoHostApi({BinaryMessenger? binaryMessenger})
: _binaryMessenger = binaryMessenger; : _binaryMessenger = binaryMessenger;
final BinaryMessenger? _binaryMessenger; final BinaryMessenger? _binaryMessenger;
static const MessageCodec<Object?> codec = _CameraInfoHostApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
Future<int> getSensorRotationDegrees(int arg_identifier) async { Future<int> getSensorRotationDegrees(int arg_identifier) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', codec, 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList =
await channel.send(<Object?>[arg_identifier]) as Map<Object?, Object?>?; await channel.send(<Object?>[arg_identifier]) as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else if (replyMap['result'] == null) { } else if (replyList[0] == null) {
throw PlatformException( throw PlatformException(
code: 'null-error', code: 'null-error',
message: 'Host platform returned null value for non-null return value.', message: 'Host platform returned null value for non-null return value.',
); );
} else { } else {
return (replyMap['result'] as int?)!; return (replyList[0] as int?)!;
} }
} }
} }
class _CameraInfoFlutterApiCodec extends StandardMessageCodec {
const _CameraInfoFlutterApiCodec();
}
abstract class CameraInfoFlutterApi { abstract class CameraInfoFlutterApi {
static const MessageCodec<Object?> codec = _CameraInfoFlutterApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
void create(int identifier); void create(int identifier);
static void setup(CameraInfoFlutterApi? api, static void setup(CameraInfoFlutterApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -249,40 +227,32 @@ abstract class CameraInfoFlutterApi {
} }
} }
class _CameraSelectorHostApiCodec extends StandardMessageCodec {
const _CameraSelectorHostApiCodec();
}
class CameraSelectorHostApi { class CameraSelectorHostApi {
/// Constructor for [CameraSelectorHostApi]. The [binaryMessenger] named argument is /// Constructor for [CameraSelectorHostApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default /// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform. /// BinaryMessenger will be used which routes to the host platform.
CameraSelectorHostApi({BinaryMessenger? binaryMessenger}) CameraSelectorHostApi({BinaryMessenger? binaryMessenger})
: _binaryMessenger = binaryMessenger; : _binaryMessenger = binaryMessenger;
final BinaryMessenger? _binaryMessenger; final BinaryMessenger? _binaryMessenger;
static const MessageCodec<Object?> codec = _CameraSelectorHostApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
Future<void> create(int arg_identifier, int? arg_lensFacing) async { Future<void> create(int arg_identifier, int? arg_lensFacing) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList = await channel
await channel.send(<Object?>[arg_identifier, arg_lensFacing]) .send(<Object?>[arg_identifier, arg_lensFacing]) as List<Object?>?;
as Map<Object?, Object?>?; if (replyList == null) {
if (replyMap == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -294,41 +264,35 @@ class CameraSelectorHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList = await channel
await channel.send(<Object?>[arg_identifier, arg_cameraInfoIds]) .send(<Object?>[arg_identifier, arg_cameraInfoIds]) as List<Object?>?;
as Map<Object?, Object?>?; if (replyList == null) {
if (replyMap == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else if (replyMap['result'] == null) { } else if (replyList[0] == null) {
throw PlatformException( throw PlatformException(
code: 'null-error', code: 'null-error',
message: 'Host platform returned null value for non-null return value.', message: 'Host platform returned null value for non-null return value.',
); );
} else { } else {
return (replyMap['result'] as List<Object?>?)!.cast<int?>(); return (replyList[0] as List<Object?>?)!.cast<int?>();
} }
} }
} }
class _CameraSelectorFlutterApiCodec extends StandardMessageCodec {
const _CameraSelectorFlutterApiCodec();
}
abstract class CameraSelectorFlutterApi { abstract class CameraSelectorFlutterApi {
static const MessageCodec<Object?> codec = _CameraSelectorFlutterApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
void create(int identifier, int? lensFacing); void create(int identifier, int? lensFacing);
static void setup(CameraSelectorFlutterApi? api, static void setup(CameraSelectorFlutterApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -354,48 +318,39 @@ abstract class CameraSelectorFlutterApi {
} }
} }
class _ProcessCameraProviderHostApiCodec extends StandardMessageCodec {
const _ProcessCameraProviderHostApiCodec();
}
class ProcessCameraProviderHostApi { class ProcessCameraProviderHostApi {
/// Constructor for [ProcessCameraProviderHostApi]. The [binaryMessenger] named argument is /// Constructor for [ProcessCameraProviderHostApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default /// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform. /// BinaryMessenger will be used which routes to the host platform.
ProcessCameraProviderHostApi({BinaryMessenger? binaryMessenger}) ProcessCameraProviderHostApi({BinaryMessenger? binaryMessenger})
: _binaryMessenger = binaryMessenger; : _binaryMessenger = binaryMessenger;
final BinaryMessenger? _binaryMessenger; final BinaryMessenger? _binaryMessenger;
static const MessageCodec<Object?> codec = static const MessageCodec<Object?> codec = StandardMessageCodec();
_ProcessCameraProviderHostApiCodec();
Future<int> getInstance() async { Future<int> getInstance() async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList = await channel.send(null) as List<Object?>?;
await channel.send(null) as Map<Object?, Object?>?; if (replyList == null) {
if (replyMap == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else if (replyMap['result'] == null) { } else if (replyList[0] == null) {
throw PlatformException( throw PlatformException(
code: 'null-error', code: 'null-error',
message: 'Host platform returned null value for non-null return value.', message: 'Host platform returned null value for non-null return value.',
); );
} else { } else {
return (replyMap['result'] as int?)!; return (replyList[0] as int?)!;
} }
} }
@ -404,28 +359,26 @@ class ProcessCameraProviderHostApi {
'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos',
codec, codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList =
await channel.send(<Object?>[arg_identifier]) as Map<Object?, Object?>?; await channel.send(<Object?>[arg_identifier]) as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else if (replyMap['result'] == null) { } else if (replyList[0] == null) {
throw PlatformException( throw PlatformException(
code: 'null-error', code: 'null-error',
message: 'Host platform returned null value for non-null return value.', message: 'Host platform returned null value for non-null return value.',
); );
} else { } else {
return (replyMap['result'] as List<Object?>?)!.cast<int?>(); return (replyList[0] as List<Object?>?)!.cast<int?>();
} }
} }
@ -435,31 +388,29 @@ class ProcessCameraProviderHostApi {
'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle',
codec, codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = await channel.send(<Object?>[ final List<Object?>? replyList = await channel.send(<Object?>[
arg_identifier, arg_identifier,
arg_cameraSelectorIdentifier, arg_cameraSelectorIdentifier,
arg_useCaseIds arg_useCaseIds
]) as Map<Object?, Object?>?; ]) as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else if (replyMap['result'] == null) { } else if (replyList[0] == null) {
throw PlatformException( throw PlatformException(
code: 'null-error', code: 'null-error',
message: 'Host platform returned null value for non-null return value.', message: 'Host platform returned null value for non-null return value.',
); );
} else { } else {
return (replyMap['result'] as int?)!; return (replyList[0] as int?)!;
} }
} }
@ -467,29 +418,27 @@ class ProcessCameraProviderHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList =
await channel.send(<Object?>[arg_identifier, arg_useCaseIdentifier]) await channel.send(<Object?>[arg_identifier, arg_useCaseIdentifier])
as Map<Object?, Object?>?; as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else if (replyMap['result'] == null) { } else if (replyList[0] == null) {
throw PlatformException( throw PlatformException(
code: 'null-error', code: 'null-error',
message: 'Host platform returned null value for non-null return value.', message: 'Host platform returned null value for non-null return value.',
); );
} else { } else {
return (replyMap['result'] as bool?)!; return (replyList[0] as bool?)!;
} }
} }
@ -497,21 +446,18 @@ class ProcessCameraProviderHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList = await channel
await channel.send(<Object?>[arg_identifier, arg_useCaseIds]) .send(<Object?>[arg_identifier, arg_useCaseIds]) as List<Object?>?;
as Map<Object?, Object?>?; if (replyList == null) {
if (replyMap == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -522,20 +468,18 @@ class ProcessCameraProviderHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll', codec, 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList =
await channel.send(<Object?>[arg_identifier]) as Map<Object?, Object?>?; await channel.send(<Object?>[arg_identifier]) as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -543,15 +487,11 @@ class ProcessCameraProviderHostApi {
} }
} }
class _ProcessCameraProviderFlutterApiCodec extends StandardMessageCodec {
const _ProcessCameraProviderFlutterApiCodec();
}
abstract class ProcessCameraProviderFlutterApi { abstract class ProcessCameraProviderFlutterApi {
static const MessageCodec<Object?> codec = static const MessageCodec<Object?> codec = StandardMessageCodec();
_ProcessCameraProviderFlutterApiCodec();
void create(int identifier); void create(int identifier);
static void setup(ProcessCameraProviderFlutterApi? api, static void setup(ProcessCameraProviderFlutterApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -576,14 +516,11 @@ abstract class ProcessCameraProviderFlutterApi {
} }
} }
class _CameraFlutterApiCodec extends StandardMessageCodec {
const _CameraFlutterApiCodec();
}
abstract class CameraFlutterApi { abstract class CameraFlutterApi {
static const MessageCodec<Object?> codec = _CameraFlutterApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
void create(int identifier); void create(int identifier);
static void setup(CameraFlutterApi? api, {BinaryMessenger? binaryMessenger}) { static void setup(CameraFlutterApi? api, {BinaryMessenger? binaryMessenger}) {
{ {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
@ -624,7 +561,6 @@ class _SystemServicesHostApiCodec extends StandardMessageCodec {
switch (type) { switch (type) {
case 128: case 128:
return CameraPermissionsErrorData.decode(readValue(buffer)!); return CameraPermissionsErrorData.decode(readValue(buffer)!);
default: default:
return super.readValueOfType(type, buffer); return super.readValueOfType(type, buffer);
} }
@ -637,7 +573,6 @@ class SystemServicesHostApi {
/// BinaryMessenger will be used which routes to the host platform. /// BinaryMessenger will be used which routes to the host platform.
SystemServicesHostApi({BinaryMessenger? binaryMessenger}) SystemServicesHostApi({BinaryMessenger? binaryMessenger})
: _binaryMessenger = binaryMessenger; : _binaryMessenger = binaryMessenger;
final BinaryMessenger? _binaryMessenger; final BinaryMessenger? _binaryMessenger;
static const MessageCodec<Object?> codec = _SystemServicesHostApiCodec(); static const MessageCodec<Object?> codec = _SystemServicesHostApiCodec();
@ -648,23 +583,21 @@ class SystemServicesHostApi {
'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions',
codec, codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = await channel final List<Object?>? replyList =
.send(<Object?>[arg_enableAudio]) as Map<Object?, Object?>?; await channel.send(<Object?>[arg_enableAudio]) as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return (replyMap['result'] as CameraPermissionsErrorData?); return (replyList[0] as CameraPermissionsErrorData?);
} }
} }
@ -674,21 +607,19 @@ class SystemServicesHostApi {
'dev.flutter.pigeon.SystemServicesHostApi.startListeningForDeviceOrientationChange', 'dev.flutter.pigeon.SystemServicesHostApi.startListeningForDeviceOrientationChange',
codec, codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList =
await channel.send(<Object?>[arg_isFrontFacing, arg_sensorOrientation]) await channel.send(<Object?>[arg_isFrontFacing, arg_sensorOrientation])
as Map<Object?, Object?>?; as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -700,20 +631,17 @@ class SystemServicesHostApi {
'dev.flutter.pigeon.SystemServicesHostApi.stopListeningForDeviceOrientationChange', 'dev.flutter.pigeon.SystemServicesHostApi.stopListeningForDeviceOrientationChange',
codec, codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList = await channel.send(null) as List<Object?>?;
await channel.send(null) as Map<Object?, Object?>?; if (replyList == null) {
if (replyMap == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -721,15 +649,13 @@ class SystemServicesHostApi {
} }
} }
class _SystemServicesFlutterApiCodec extends StandardMessageCodec {
const _SystemServicesFlutterApiCodec();
}
abstract class SystemServicesFlutterApi { abstract class SystemServicesFlutterApi {
static const MessageCodec<Object?> codec = _SystemServicesFlutterApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
void onDeviceOrientationChanged(String orientation); void onDeviceOrientationChanged(String orientation);
void onCameraError(String errorDescription); void onCameraError(String errorDescription);
static void setup(SystemServicesFlutterApi? api, static void setup(SystemServicesFlutterApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -794,10 +720,8 @@ class _PreviewHostApiCodec extends StandardMessageCodec {
switch (type) { switch (type) {
case 128: case 128:
return ResolutionInfo.decode(readValue(buffer)!); return ResolutionInfo.decode(readValue(buffer)!);
case 129: case 129:
return ResolutionInfo.decode(readValue(buffer)!); return ResolutionInfo.decode(readValue(buffer)!);
default: default:
return super.readValueOfType(type, buffer); return super.readValueOfType(type, buffer);
} }
@ -810,7 +734,6 @@ class PreviewHostApi {
/// BinaryMessenger will be used which routes to the host platform. /// BinaryMessenger will be used which routes to the host platform.
PreviewHostApi({BinaryMessenger? binaryMessenger}) PreviewHostApi({BinaryMessenger? binaryMessenger})
: _binaryMessenger = binaryMessenger; : _binaryMessenger = binaryMessenger;
final BinaryMessenger? _binaryMessenger; final BinaryMessenger? _binaryMessenger;
static const MessageCodec<Object?> codec = _PreviewHostApiCodec(); static const MessageCodec<Object?> codec = _PreviewHostApiCodec();
@ -820,21 +743,19 @@ class PreviewHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.PreviewHostApi.create', codec, 'dev.flutter.pigeon.PreviewHostApi.create', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = await channel final List<Object?>? replyList = await channel
.send(<Object?>[arg_identifier, arg_rotation, arg_targetResolution]) .send(<Object?>[arg_identifier, arg_rotation, arg_targetResolution])
as Map<Object?, Object?>?; as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -845,28 +766,26 @@ class PreviewHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider', codec, 'dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList =
await channel.send(<Object?>[arg_identifier]) as Map<Object?, Object?>?; await channel.send(<Object?>[arg_identifier]) as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else if (replyMap['result'] == null) { } else if (replyList[0] == null) {
throw PlatformException( throw PlatformException(
code: 'null-error', code: 'null-error',
message: 'Host platform returned null value for non-null return value.', message: 'Host platform returned null value for non-null return value.',
); );
} else { } else {
return (replyMap['result'] as int?)!; return (replyList[0] as int?)!;
} }
} }
@ -874,20 +793,17 @@ class PreviewHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList = await channel.send(null) as List<Object?>?;
await channel.send(null) as Map<Object?, Object?>?; if (replyList == null) {
if (replyMap == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -898,28 +814,26 @@ class PreviewHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.PreviewHostApi.getResolutionInfo', codec, 'dev.flutter.pigeon.PreviewHostApi.getResolutionInfo', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList =
await channel.send(<Object?>[arg_identifier]) as Map<Object?, Object?>?; await channel.send(<Object?>[arg_identifier]) as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else if (replyMap['result'] == null) { } else if (replyList[0] == null) {
throw PlatformException( throw PlatformException(
code: 'null-error', code: 'null-error',
message: 'Host platform returned null value for non-null return value.', message: 'Host platform returned null value for non-null return value.',
); );
} else { } else {
return (replyMap['result'] as ResolutionInfo?)!; return (replyList[0] as ResolutionInfo?)!;
} }
} }
} }
@ -941,7 +855,6 @@ class _ImageCaptureHostApiCodec extends StandardMessageCodec {
switch (type) { switch (type) {
case 128: case 128:
return ResolutionInfo.decode(readValue(buffer)!); return ResolutionInfo.decode(readValue(buffer)!);
default: default:
return super.readValueOfType(type, buffer); return super.readValueOfType(type, buffer);
} }
@ -954,7 +867,6 @@ class ImageCaptureHostApi {
/// BinaryMessenger will be used which routes to the host platform. /// BinaryMessenger will be used which routes to the host platform.
ImageCaptureHostApi({BinaryMessenger? binaryMessenger}) ImageCaptureHostApi({BinaryMessenger? binaryMessenger})
: _binaryMessenger = binaryMessenger; : _binaryMessenger = binaryMessenger;
final BinaryMessenger? _binaryMessenger; final BinaryMessenger? _binaryMessenger;
static const MessageCodec<Object?> codec = _ImageCaptureHostApiCodec(); static const MessageCodec<Object?> codec = _ImageCaptureHostApiCodec();
@ -964,21 +876,19 @@ class ImageCaptureHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = await channel.send( final List<Object?>? replyList = await channel.send(
<Object?>[arg_identifier, arg_flashMode, arg_targetResolution]) <Object?>[arg_identifier, arg_flashMode, arg_targetResolution])
as Map<Object?, Object?>?; as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -989,21 +899,18 @@ class ImageCaptureHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList = await channel
await channel.send(<Object?>[arg_identifier, arg_flashMode]) .send(<Object?>[arg_identifier, arg_flashMode]) as List<Object?>?;
as Map<Object?, Object?>?; if (replyList == null) {
if (replyMap == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else { } else {
return; return;
@ -1014,28 +921,26 @@ class ImageCaptureHostApi {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.ImageCaptureHostApi.takePicture', codec, 'dev.flutter.pigeon.ImageCaptureHostApi.takePicture', codec,
binaryMessenger: _binaryMessenger); binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap = final List<Object?>? replyList =
await channel.send(<Object?>[arg_identifier]) as Map<Object?, Object?>?; await channel.send(<Object?>[arg_identifier]) as List<Object?>?;
if (replyMap == null) { if (replyList == null) {
throw PlatformException( throw PlatformException(
code: 'channel-error', code: 'channel-error',
message: 'Unable to establish connection on channel.', message: 'Unable to establish connection on channel.',
); );
} else if (replyMap['error'] != null) { } else if (replyList.length > 1) {
final Map<Object?, Object?> error =
(replyMap['error'] as Map<Object?, Object?>?)!;
throw PlatformException( throw PlatformException(
code: (error['code'] as String?)!, code: replyList[0]! as String,
message: error['message'] as String?, message: replyList[1] as String?,
details: error['details'], details: replyList[2],
); );
} else if (replyMap['result'] == null) { } else if (replyList[0] == null) {
throw PlatformException( throw PlatformException(
code: 'null-error', code: 'null-error',
message: 'Host platform returned null value for non-null return value.', message: 'Host platform returned null value for non-null return value.',
); );
} else { } else {
return (replyMap['result'] as String?)!; return (replyList[0] as String?)!;
} }
} }
} }

View File

@ -31,4 +31,4 @@ dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
mockito: 5.3.2 mockito: 5.3.2
pigeon: ^3.2.6 pigeon: ^9.1.0

View File

@ -1,26 +1,26 @@
// Copyright 2013 The Flutter Authors. All rights reserved. // Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Autogenerated from Pigeon (v3.2.9), do not edit directly. // Autogenerated from Pigeon (v9.1.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon // See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import
// ignore_for_file: avoid_relative_lib_imports // ignore_for_file: avoid_relative_lib_imports
import 'dart:async'; import 'dart:async';
import 'dart:typed_data' show Uint8List, Int32List, Int64List, Float64List; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
import 'package:flutter/foundation.dart' show WriteBuffer, ReadBuffer; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:camera_android_camerax/src/camerax_library.g.dart'; import 'package:camera_android_camerax/src/camerax_library.g.dart';
class _TestInstanceManagerHostApiCodec extends StandardMessageCodec {
const _TestInstanceManagerHostApiCodec();
}
abstract class TestInstanceManagerHostApi { abstract class TestInstanceManagerHostApi {
static const MessageCodec<Object?> codec = _TestInstanceManagerHostApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
/// Clear the native `InstanceManager`.
///
/// This is typically only used after a hot restart.
void clear(); void clear();
static void setup(TestInstanceManagerHostApi? api, static void setup(TestInstanceManagerHostApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -33,21 +33,18 @@ abstract class TestInstanceManagerHostApi {
channel.setMockMessageHandler((Object? message) async { channel.setMockMessageHandler((Object? message) async {
// ignore message // ignore message
api.clear(); api.clear();
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
} }
} }
class _TestJavaObjectHostApiCodec extends StandardMessageCodec {
const _TestJavaObjectHostApiCodec();
}
abstract class TestJavaObjectHostApi { abstract class TestJavaObjectHostApi {
static const MessageCodec<Object?> codec = _TestJavaObjectHostApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
void dispose(int identifier); void dispose(int identifier);
static void setup(TestJavaObjectHostApi? api, static void setup(TestJavaObjectHostApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -65,21 +62,18 @@ abstract class TestJavaObjectHostApi {
assert(arg_identifier != null, assert(arg_identifier != null,
'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null, expected non-null int.');
api.dispose(arg_identifier!); api.dispose(arg_identifier!);
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
} }
} }
class _TestCameraInfoHostApiCodec extends StandardMessageCodec {
const _TestCameraInfoHostApiCodec();
}
abstract class TestCameraInfoHostApi { abstract class TestCameraInfoHostApi {
static const MessageCodec<Object?> codec = _TestCameraInfoHostApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
int getSensorRotationDegrees(int identifier); int getSensorRotationDegrees(int identifier);
static void setup(TestCameraInfoHostApi? api, static void setup(TestCameraInfoHostApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -98,22 +92,20 @@ abstract class TestCameraInfoHostApi {
assert(arg_identifier != null, assert(arg_identifier != null,
'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null, expected non-null int.');
final int output = api.getSensorRotationDegrees(arg_identifier!); final int output = api.getSensorRotationDegrees(arg_identifier!);
return <Object?, Object?>{'result': output}; return <Object?>[output];
}); });
} }
} }
} }
} }
class _TestCameraSelectorHostApiCodec extends StandardMessageCodec {
const _TestCameraSelectorHostApiCodec();
}
abstract class TestCameraSelectorHostApi { abstract class TestCameraSelectorHostApi {
static const MessageCodec<Object?> codec = _TestCameraSelectorHostApiCodec(); static const MessageCodec<Object?> codec = StandardMessageCodec();
void create(int identifier, int? lensFacing); void create(int identifier, int? lensFacing);
List<int?> filter(int identifier, List<int?> cameraInfoIds); List<int?> filter(int identifier, List<int?> cameraInfoIds);
static void setup(TestCameraSelectorHostApi? api, static void setup(TestCameraSelectorHostApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -132,7 +124,7 @@ abstract class TestCameraSelectorHostApi {
'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null, expected non-null int.');
final int? arg_lensFacing = (args[1] as int?); final int? arg_lensFacing = (args[1] as int?);
api.create(arg_identifier!, arg_lensFacing); api.create(arg_identifier!, arg_lensFacing);
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
@ -156,28 +148,29 @@ abstract class TestCameraSelectorHostApi {
'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null List<int?>.'); 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null List<int?>.');
final List<int?> output = final List<int?> output =
api.filter(arg_identifier!, arg_cameraInfoIds!); api.filter(arg_identifier!, arg_cameraInfoIds!);
return <Object?, Object?>{'result': output}; return <Object?>[output];
}); });
} }
} }
} }
} }
class _TestProcessCameraProviderHostApiCodec extends StandardMessageCodec {
const _TestProcessCameraProviderHostApiCodec();
}
abstract class TestProcessCameraProviderHostApi { abstract class TestProcessCameraProviderHostApi {
static const MessageCodec<Object?> codec = static const MessageCodec<Object?> codec = StandardMessageCodec();
_TestProcessCameraProviderHostApiCodec();
Future<int> getInstance(); Future<int> getInstance();
List<int?> getAvailableCameraInfos(int identifier); List<int?> getAvailableCameraInfos(int identifier);
int bindToLifecycle( int bindToLifecycle(
int identifier, int cameraSelectorIdentifier, List<int?> useCaseIds); int identifier, int cameraSelectorIdentifier, List<int?> useCaseIds);
bool isBound(int identifier, int useCaseIdentifier); bool isBound(int identifier, int useCaseIdentifier);
void unbind(int identifier, List<int?> useCaseIds); void unbind(int identifier, List<int?> useCaseIds);
void unbindAll(int identifier); void unbindAll(int identifier);
static void setup(TestProcessCameraProviderHostApi? api, static void setup(TestProcessCameraProviderHostApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -190,7 +183,7 @@ abstract class TestProcessCameraProviderHostApi {
channel.setMockMessageHandler((Object? message) async { channel.setMockMessageHandler((Object? message) async {
// ignore message // ignore message
final int output = await api.getInstance(); final int output = await api.getInstance();
return <Object?, Object?>{'result': output}; return <Object?>[output];
}); });
} }
} }
@ -211,7 +204,7 @@ abstract class TestProcessCameraProviderHostApi {
'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null, expected non-null int.');
final List<int?> output = final List<int?> output =
api.getAvailableCameraInfos(arg_identifier!); api.getAvailableCameraInfos(arg_identifier!);
return <Object?, Object?>{'result': output}; return <Object?>[output];
}); });
} }
} }
@ -239,7 +232,7 @@ abstract class TestProcessCameraProviderHostApi {
'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null List<int?>.'); 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null List<int?>.');
final int output = api.bindToLifecycle( final int output = api.bindToLifecycle(
arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!);
return <Object?, Object?>{'result': output}; return <Object?>[output];
}); });
} }
} }
@ -262,7 +255,7 @@ abstract class TestProcessCameraProviderHostApi {
'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null, expected non-null int.');
final bool output = final bool output =
api.isBound(arg_identifier!, arg_useCaseIdentifier!); api.isBound(arg_identifier!, arg_useCaseIdentifier!);
return <Object?, Object?>{'result': output}; return <Object?>[output];
}); });
} }
} }
@ -285,7 +278,7 @@ abstract class TestProcessCameraProviderHostApi {
assert(arg_useCaseIds != null, assert(arg_useCaseIds != null,
'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null List<int?>.'); 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null List<int?>.');
api.unbind(arg_identifier!, arg_useCaseIds!); api.unbind(arg_identifier!, arg_useCaseIds!);
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
@ -304,7 +297,7 @@ abstract class TestProcessCameraProviderHostApi {
assert(arg_identifier != null, assert(arg_identifier != null,
'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null, expected non-null int.');
api.unbindAll(arg_identifier!); api.unbindAll(arg_identifier!);
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
@ -328,7 +321,6 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec {
switch (type) { switch (type) {
case 128: case 128:
return CameraPermissionsErrorData.decode(readValue(buffer)!); return CameraPermissionsErrorData.decode(readValue(buffer)!);
default: default:
return super.readValueOfType(type, buffer); return super.readValueOfType(type, buffer);
} }
@ -340,9 +332,12 @@ abstract class TestSystemServicesHostApi {
Future<CameraPermissionsErrorData?> requestCameraPermissions( Future<CameraPermissionsErrorData?> requestCameraPermissions(
bool enableAudio); bool enableAudio);
void startListeningForDeviceOrientationChange( void startListeningForDeviceOrientationChange(
bool isFrontFacing, int sensorOrientation); bool isFrontFacing, int sensorOrientation);
void stopListeningForDeviceOrientationChange(); void stopListeningForDeviceOrientationChange();
static void setup(TestSystemServicesHostApi? api, static void setup(TestSystemServicesHostApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -362,7 +357,7 @@ abstract class TestSystemServicesHostApi {
'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null, expected non-null bool.'); 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null, expected non-null bool.');
final CameraPermissionsErrorData? output = final CameraPermissionsErrorData? output =
await api.requestCameraPermissions(arg_enableAudio!); await api.requestCameraPermissions(arg_enableAudio!);
return <Object?, Object?>{'result': output}; return <Object?>[output];
}); });
} }
} }
@ -386,7 +381,7 @@ abstract class TestSystemServicesHostApi {
'Argument for dev.flutter.pigeon.SystemServicesHostApi.startListeningForDeviceOrientationChange was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.SystemServicesHostApi.startListeningForDeviceOrientationChange was null, expected non-null int.');
api.startListeningForDeviceOrientationChange( api.startListeningForDeviceOrientationChange(
arg_isFrontFacing!, arg_sensorOrientation!); arg_isFrontFacing!, arg_sensorOrientation!);
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
@ -401,7 +396,7 @@ abstract class TestSystemServicesHostApi {
channel.setMockMessageHandler((Object? message) async { channel.setMockMessageHandler((Object? message) async {
// ignore message // ignore message
api.stopListeningForDeviceOrientationChange(); api.stopListeningForDeviceOrientationChange();
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
@ -428,10 +423,8 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec {
switch (type) { switch (type) {
case 128: case 128:
return ResolutionInfo.decode(readValue(buffer)!); return ResolutionInfo.decode(readValue(buffer)!);
case 129: case 129:
return ResolutionInfo.decode(readValue(buffer)!); return ResolutionInfo.decode(readValue(buffer)!);
default: default:
return super.readValueOfType(type, buffer); return super.readValueOfType(type, buffer);
} }
@ -442,9 +435,13 @@ abstract class TestPreviewHostApi {
static const MessageCodec<Object?> codec = _TestPreviewHostApiCodec(); static const MessageCodec<Object?> codec = _TestPreviewHostApiCodec();
void create(int identifier, int? rotation, ResolutionInfo? targetResolution); void create(int identifier, int? rotation, ResolutionInfo? targetResolution);
int setSurfaceProvider(int identifier); int setSurfaceProvider(int identifier);
void releaseFlutterSurfaceTexture(); void releaseFlutterSurfaceTexture();
ResolutionInfo getResolutionInfo(int identifier); ResolutionInfo getResolutionInfo(int identifier);
static void setup(TestPreviewHostApi? api, static void setup(TestPreviewHostApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -465,7 +462,7 @@ abstract class TestPreviewHostApi {
final ResolutionInfo? arg_targetResolution = final ResolutionInfo? arg_targetResolution =
(args[2] as ResolutionInfo?); (args[2] as ResolutionInfo?);
api.create(arg_identifier!, arg_rotation, arg_targetResolution); api.create(arg_identifier!, arg_rotation, arg_targetResolution);
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
@ -484,7 +481,7 @@ abstract class TestPreviewHostApi {
assert(arg_identifier != null, assert(arg_identifier != null,
'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null, expected non-null int.');
final int output = api.setSurfaceProvider(arg_identifier!); final int output = api.setSurfaceProvider(arg_identifier!);
return <Object?, Object?>{'result': output}; return <Object?>[output];
}); });
} }
} }
@ -499,7 +496,7 @@ abstract class TestPreviewHostApi {
channel.setMockMessageHandler((Object? message) async { channel.setMockMessageHandler((Object? message) async {
// ignore message // ignore message
api.releaseFlutterSurfaceTexture(); api.releaseFlutterSurfaceTexture();
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
@ -518,7 +515,7 @@ abstract class TestPreviewHostApi {
assert(arg_identifier != null, assert(arg_identifier != null,
'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null, expected non-null int.');
final ResolutionInfo output = api.getResolutionInfo(arg_identifier!); final ResolutionInfo output = api.getResolutionInfo(arg_identifier!);
return <Object?, Object?>{'result': output}; return <Object?>[output];
}); });
} }
} }
@ -542,7 +539,6 @@ class _TestImageCaptureHostApiCodec extends StandardMessageCodec {
switch (type) { switch (type) {
case 128: case 128:
return ResolutionInfo.decode(readValue(buffer)!); return ResolutionInfo.decode(readValue(buffer)!);
default: default:
return super.readValueOfType(type, buffer); return super.readValueOfType(type, buffer);
} }
@ -553,8 +549,11 @@ abstract class TestImageCaptureHostApi {
static const MessageCodec<Object?> codec = _TestImageCaptureHostApiCodec(); static const MessageCodec<Object?> codec = _TestImageCaptureHostApiCodec();
void create(int identifier, int? flashMode, ResolutionInfo? targetResolution); void create(int identifier, int? flashMode, ResolutionInfo? targetResolution);
void setFlashMode(int identifier, int flashMode); void setFlashMode(int identifier, int flashMode);
Future<String> takePicture(int identifier); Future<String> takePicture(int identifier);
static void setup(TestImageCaptureHostApi? api, static void setup(TestImageCaptureHostApi? api,
{BinaryMessenger? binaryMessenger}) { {BinaryMessenger? binaryMessenger}) {
{ {
@ -575,7 +574,7 @@ abstract class TestImageCaptureHostApi {
final ResolutionInfo? arg_targetResolution = final ResolutionInfo? arg_targetResolution =
(args[2] as ResolutionInfo?); (args[2] as ResolutionInfo?);
api.create(arg_identifier!, arg_flashMode, arg_targetResolution); api.create(arg_identifier!, arg_flashMode, arg_targetResolution);
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
@ -597,7 +596,7 @@ abstract class TestImageCaptureHostApi {
assert(arg_flashMode != null, assert(arg_flashMode != null,
'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null, expected non-null int.');
api.setFlashMode(arg_identifier!, arg_flashMode!); api.setFlashMode(arg_identifier!, arg_flashMode!);
return <Object?, Object?>{}; return <Object?>[];
}); });
} }
} }
@ -616,7 +615,7 @@ abstract class TestImageCaptureHostApi {
assert(arg_identifier != null, assert(arg_identifier != null,
'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null, expected non-null int.'); 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null, expected non-null int.');
final String output = await api.takePicture(arg_identifier!); final String output = await api.takePicture(arg_identifier!);
return <Object?, Object?>{'result': output}; return <Object?>[output];
}); });
} }
} }