CaptureStrategy class

Utility class providing strategy and JavaScript snippets for retrieving output image dimensions

Constructors

CaptureStrategy.customScript(String? script)
Provide a custom script to calculate content dimensions
const
CaptureStrategy.fitContent()
Uses a JavaScript to calculate the dimensions required to fit content width and height
const
CaptureStrategy.fitHeight()
Uses a JavaScript to calculate the dimensions required to fit the content height
const
CaptureStrategy.fitWidth()
Uses a JavaScript to calculate the dimensions required to fit the content width
const
CaptureStrategy.followLayout()
Follows the dimensions of the WebView Layout
const
CaptureStrategy.fullScroll()
Uses a JavaScript to calculate the full scroll content dimensions
const
CaptureStrategy.unbounded()
Captures the entire content unbounded
const
CaptureStrategy.withDimensions({int? width, int? height})
Uses the provided width and height as the output dimensions
const

Properties

hashCode int
The hash code for this object.
no setterinherited
height int?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
script String?
final
width int?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

fitContentJs → const String
JavaScript code to determine the tightest possible dimensions (width and height) that encompass all rendered HTML elements. This computes the maximum right and bottom coordinates from the getBoundingClientRect() of all elements.
fitHeightJs → const String
JavaScript code to determine the tightest possible height that encompass all rendered HTML elements. This computes the maximum bottom coordinates from the getBoundingClientRect() of all elements.
fitWidthJs → const String
JavaScript code to determine the tightest possible width that encompass all rendered HTML elements. This computes the maximum right coordinates from the getBoundingClientRect() of all elements.
fullScrollJs → const String
JavaScript code to determine the maximum potential width and height of the HTML document by taking the largest values from scrollWidth, offsetWidth, and clientWidth properties of both document.body and document.documentElement. This is useful for capturing the full scrollable content size.