layout method
Implementation
@override
void layout(BoxConstraints constraints) {
super.layout(constraints);
final content = _viewToString(_paintDelegate());
_lastPaint = content;
final width = Layout.getWidth(content).toDouble();
final height = Layout.getHeight(content).toDouble();
size = constraints.constrain(Size(width, height));
}