createOffset static method

(List<int>, int) createOffset({
  1. required int totalCount,
  2. required int limitCount,
})

ccreate offset for tl

Implementation

static (List<int> offsets, int limit) createOffset({
  required int totalCount,
  required int limitCount,
}) {
  int offset = 0;
  final List<int> listOffset = [0];
  for (var i = 0; i < (totalCount ~/ limitCount).toInt(); i++) {
    for (var ii = 0; ii <= limitCount; ii++) {
      if (ii == limitCount) {
        offset = (offset + limitCount);
      }
    }
    listOffset.add(offset);
  }
  return (listOffset, limitCount);
}