utils.dart 286 B

12345678910
  1. int remainder(int input, int source) {
  2. if (source == 0) return 0;
  3. final int result = input % source;
  4. return result < 0 ? source + result : result;
  5. }
  6. int getRealIndex(int position, int base, int length) {
  7. final int offset = position - base;
  8. return remainder(offset, length);
  9. }