layout method
PdfPoint
layout(
- Widget child,
- Context context,
- BoxConstraints constraints, {
- bool parentUsesSize = false,
Implementation
@protected
PdfPoint layout(Widget child, Context context, BoxConstraints constraints,
{bool parentUsesSize = false}) {
final margin = resolvedMargin!;
child.layout(context, constraints, parentUsesSize: parentUsesSize);
assert(child.box != null);
final width = pageFormat.width == double.infinity
? child.box!.width + margin.left + margin.right
: pageFormat.width;
final height = pageFormat.height == double.infinity
? child.box!.height + margin.top + margin.bottom
: pageFormat.height;
child.box = PdfRect(margin.left, height - child.box!.height - margin.top,
child.box!.width, child.box!.height);
return PdfPoint(width, height);
}