screenshot method

Future<Response> screenshot(
  1. String isolateId,
  2. String id,
  3. double width,
  4. double height, {
  5. double? margin,
  6. double? maxPixelRatio,
  7. bool? debugPaint,
})

Takes a screenshot of a widget.

Implementation

Future<Response> screenshot(
    String isolateId, String id, double width, double height,
    {double? margin, double? maxPixelRatio, bool? debugPaint}) async {
  return await vmService.callServiceExtension(
    'ext.flutter.inspector.screenshot',
    isolateId: isolateId,
    args: {
      'id': id,
      'width': width.toString(),
      'height': height.toString(),
      'margin': margin?.toString(),
      'maxPixelRatio': maxPixelRatio?.toString(),
      'debugPaint': debugPaint?.toString(),
    },
  );
}