measure method

  1. @override
void measure(
  1. double parentWidth,
  2. double parentHeight
)
override

Implementation

@override
void measure(double parentWidth, double parentHeight) {
  bool force = forceMeasure || forceLayout;
  bool minDiff = (boundRect.width - parentWidth).abs() <= 0.00001 && (boundRect.height - parentHeight).abs() <= 0.00001;
  if (measureCompleted && minDiff && !force) {
    return;
  }
  oldBoundRect = boundRect;
  Size size = onMeasure(parentWidth, parentHeight);
  boundRect = Rect.fromLTWH(0, 0, size.width, size.height);
  measureCompleted = true;
}