takeCapture method

  1. @override
Future<CapturedImage?> takeCapture({
  1. int? x,
  2. int? y,
  3. int? width,
  4. int? height,
})
override

Implementation

@override
Future<CapturedImage?> takeCapture({int? x, int? y, int? width, int? height}) async {
  Map<String, dynamic>? data;
  if (x != null && y != null && width != null && height != null) {
    data = {
      'x': x,
      'y': y,
      'width': width,
      'height': height,
    };
  }
  final result = await methodChannel.invokeMethod('takeCapture', data);
  if (result == null) {
    return null;
  }
  return CapturedImage.fromMap(Map<String, dynamic>.from(result));
}