INNER CODE UNIT · Dart

verticalConstraintCount

hackware1993/Flutter_ConstraintLayout · lib/src/auxiliary.dart:213

      int verticalConstraintCount = (element.topConstraint == null ? 0 : 1) +
          (element.bottomConstraint == null ? 0 : 1) +
          (element.baselineConstraint == null ? 0 : 10);
      if (verticalConstraintCount == 0) {
        throw ConstraintLayoutException(
            'Need to set a top or bottom or baseline constraint for ${element.nodeId}.');
      } else if (verticalConstraintCount > 10) {
        throw ConstraintLayoutException(
            'When the baseline constraint is set, the top or bottom constraint can not be set for ${element.nodeId}.');
      }
    } else if (element.height == matchConstraint) {
      if (element.baselineConstraint != null) {
        throw ConstraintLayoutException(
            'When setting a baseline constraint for ${element.nodeId}, its height must be fixed or wrap_content.');
      }
      if (element.widthHeightRatio == null) {
        if (element.heightPercentageAnchor == PercentageAnchor.constraint) {
          if (element.topConstraint == null ||

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…