needChangeToFoldWidget method

bool needChangeToFoldWidget(
  1. int i,
  2. double offsetX,
  3. double screenW,
  4. int nowLine,
  5. FlowPaintingContext context,
)

Implementation

bool needChangeToFoldWidget(int i, double offsetX, double screenW,
    int nowLine, FlowPaintingContext context) {
  if (!isFold) {
    return false;
  }
  if ((i + 1 < context.childCount - 1) &&
      ((offsetX +
              (context.getChildSize(i)?.width ?? 0) +
              spacing +
              (context.getChildSize(i + 1)?.width ?? 0)) >
          screenW)) {
    if ((isFold && ((nowLine + 1) > foldLine))) {
      return true;
    }
  }
  return false;
}