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
andheight
as the output dimensionsconst
Properties
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
andbottom
coordinates from thegetBoundingClientRect()
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 thegetBoundingClientRect()
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 thegetBoundingClientRect()
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
, andclientWidth
properties of bothdocument.body
anddocument.documentElement
. This is useful for capturing the full scrollable content size.