reset method
void
reset(
{ - required int count,
- int? newSelectedIndex,
})
Implementation
void reset({required int count, int? newSelectedIndex}) {
if (newSelectedIndex != null) {
if (newSelectedIndex >= count || newSelectedIndex < 0) {
throw ArgumentError(
"New selected index $newSelectedIndex is out of bounds [0; $count)",
);
}
_selectedIndex = newSelectedIndex;
} else if (selectedIndex >= count) {
throw ArgumentError(
"Current selected index $selectedIndex is out of new bounds $count, "
"provide new selected index via 'newSelectedIndex' parameter",
);
}
_itemCount = count;
notifyListeners();
}