getAutoLayoutContentRatio static method

double getAutoLayoutContentRatio({
  1. required bool tipLabelHidden,
  2. double? layoutRatio,
})

当左右内容超出默认比例且「有」提示语,则按比例 6:4 布局 当左右内容超出默认比例且「无」提示语,则按比例 4:6 布局 有用户自定义比例时用用户自定义比例

Implementation

static double getAutoLayoutContentRatio(
    {required bool tipLabelHidden, double? layoutRatio}) {
  double defaultRatio =
      tipLabelHidden ? FormUtil.contentRatio : 1 - FormUtil.contentRatio;
  double contentRatio = layoutRatio != null && layoutRatio > 0
      ? 1 / (layoutRatio + 1)
      : defaultRatio;
  return contentRatio;
}