captureFrame method

  1. @override
Future<Uint8List?> captureFrame()
override

Implementation

@override
Future<Uint8List?> captureFrame() async {
  try {
    await methodChannel.invokeMethod('captureFrame');
    Uint8List frame = await methodChannel.invokeMethod('getCapturedFrame');
    return frame;
  } on PlatformException catch (e) {
    throw Exception("Failed to capture frame: '${e.message}'");
  }
}