canAddToFoldWidget method

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

Implementation

bool canAddToFoldWidget(int i, double offsetX, double screenW,
    FlowPaintingContext context, int lastIndex) {
  if ((offsetX +
          (context.getChildSize(i)?.width ?? 0) +
          spacing +
          (context.getChildSize(lastIndex)?.width ?? 0)) <=
      screenW) {
    return true;
  }
  return false;
}