setDescription method

  1. @override
Future<({int previewRotationQuarterTurns, Size previewSize})> setDescription(
  1. int handle,
  2. String cameraId
)
override

Swap to a different camera mid-session. Resets the lock and clears any pending recording. Returns the new preview size and rotation; the size may again be Size.zero initially on Android, with a follow-up XCameraPreviewSizeChanged event.

Implementation

@override
Future<({Size previewSize, int previewRotationQuarterTurns})> setDescription(
  int handle,
  String cameraId,
) async {
  final m = await _invokeMap('setDescription', {
    'handle': handle,
    'cameraId': cameraId,
  });
  final s = (m['previewSize'] as Map).cast<Object?, Object?>();
  return (
    previewSize: Size(
      (s['width'] as num).toDouble(),
      (s['height'] as num).toDouble(),
    ),
    previewRotationQuarterTurns:
        (m['previewRotationQuarterTurns'] as num?)?.toInt() ?? 0,
  );
}