measure static method
PdfPoint
measure(
- Widget widget, {
- PdfPage? page,
- PdfGraphics? canvas,
- BoxConstraints? constraints,
- Context? context,
Measure the size of a widget to a page canvas.
Implementation
static PdfPoint measure(
Widget widget, {
PdfPage? page,
PdfGraphics? canvas,
BoxConstraints? constraints,
Context? context,
}) {
context ??= Context(
document: page!.pdfDocument,
page: page,
canvas: canvas!,
).inheritFromAll(<Inherited>[
ThemeData.base(),
]);
widget.layout(
context,
constraints ?? const BoxConstraints(),
);
assert(widget.box != null);
return widget.box!.size;
}