canAddCell method

bool canAddCell(
  1. ResponsiveLayoutCell newCell
)

Implementation

bool canAddCell(ResponsiveLayoutCell newCell) {
  List<int> columnSpansWithoutNewCell = [..._cellColumnSpans];
  var scoreWithoutNewCell = score;
  add(newCell);
  var scoreWithNewCell = score;
  var fits = _cellsFitInRow;

  _cells.removeLast();
  _cellColumnSpans = columnSpansWithoutNewCell;
  return fits & (scoreWithoutNewCell <= scoreWithNewCell);
}