pages property
int
get
pages
The total number of pages.
Setting this clamps value to pages - 1 if it would otherwise be out of range.
Contract:
- Throws AssertionError if pages <= 0.
Implementation
int get pages => _pages;
set
pages
(int pages)
Implementation
set pages(int pages) {
assert(0 < pages, 'pages ($pages) should be > 0');
if (_pages == pages) {
return;
}
_pages = pages;
if (pages <= super.value) {
// This already notifies listeners, so we don't need to call notifyListeners again.
super.value = pages - 1;
} else {
notifyListeners();
}
}