measure method
({double flex, double width})
measure(
- Widget child,
- Context context,
- BoxConstraints constraints
override
Intrinsic or fixed contribution before flex distribution.
Implementation
@override
({double width, double flex}) measure(
Widget child,
Context context,
BoxConstraints constraints,
) {
if (flex != null) {
return (width: 0, flex: flex!);
}
final PwBox box = child.layout(context, const BoxConstraints());
final double w = box.size.width.isFinite ? box.size.width : 0;
return (width: w, flex: w <= 0 ? 1 : 0);
}