getIntrinsicWidth method

  1. @override
int getIntrinsicWidth(
  1. int height
)
override

Returns the intrinsic width of this element.

Implementation

@override
int getIntrinsicWidth(int height) {
  final split = widget as SplitPane;
  final w1 = childElement1?.getIntrinsicWidth(height) ?? 0;
  final w2 = childElement2?.getIntrinsicWidth(height) ?? 0;
  if (split.direction == LayoutDirection.horizontal) {
    return w1 + w2 + 1;
  } else {
    return max(w1, w2);
  }
}