currentPageNumber property

int currentPageNumber

Get the current page number by obtaining the page that has the largest area from visiblePages.

Implementation

int get currentPageNumber {
  MapEntry<int, double>? max;
  for (final v in visiblePages.entries) {
    if (max == null || max.value < v.value) {
      max = v;
    }
  }
  return max?.key ?? 1;
}