getIntrinsicHeight method
Computes the intrinsic height of this widget under the given width constraint.
Implementation
@override
int getIntrinsicHeight(int width) {
// Run within a zone specifying #isMeasuringIntrinsics = true to prevent
// temporary mounting of children from polluting or corrupting the global
// GlobalKey registry.
return runZoned(() {
final rootContext = StatelessElement(this)..mount(null);
final h = rootContext.childElement?.widget.getIntrinsicHeight(width) ?? 0;
rootContext.unmount();
return h;
}, zoneValues: {#isMeasuringIntrinsics: true});
}