performLayout method
Hook for subclasses to perform layout within the given constraints.
Implementation
@override
Size performLayout(BoxConstraints constraints) {
final canvas = widget as Canvas;
final width = constraints.hasBoundedWidth
? constraints.maxWidth
: canvas.width;
final height = constraints.hasBoundedHeight
? constraints.maxHeight
: canvas.height;
return constraints.constrain(Size(width, height));
}