captureImage method

Future<Image> captureImage({
  1. bool blockText = false,
  2. DeviceInfo? device,
  3. Orientation orientation = Orientation.portrait,
  4. bool includeDeviceFrame = false,
})

Renders the closest RepaintBoundary of this element into an image.

Set blockText to true to replace text with colored rectangles for cross-platform consistency in golden tests.

If includeDeviceFrame is true and a device is provided, the image will be wrapped with the device's frame.

See also:

Implementation

Future<ui.Image> captureImage({
  bool blockText = false,
  DeviceInfo? device,
  Orientation orientation = Orientation.portrait,
  bool includeDeviceFrame = false,
}) async {
  return _captureImage(
    this,
    blockText: blockText,
    device: device,
    orientation: orientation,
    includeDeviceFrame: includeDeviceFrame,
  );
}