getFreeRowForColumn method

int getFreeRowForColumn(
  1. int x
)

Implementation

int getFreeRowForColumn(int x) {
  if (this.height() == 0) {
    return 0;
  }
  final entries = this.s.asMap().entries.toList();
  final idx = entries.indexWhere((data) {
    var row = data.value;
    return row.length == 0 || x >= row.length || row[x] == null;
  });
  var y = idx == -1 ? this.height() : entries[idx].key;
  return y;
}