INNER CODE UNIT · Dart
_currentPageIndex
woltapp/wolt_modal_sheet · lib/src/wolt_modal_sheet.dart:830
_currentPageIndex = min(newPageIndex, _pages.length - 1);
});
}
/// Advances to the next page in the modal sheet if one exists.
///
/// This method navigates to the next page in the modal sheet's stack. If the current page is
/// the last one in the stack, this method will do nothing to prevent out-of-bounds errors. It
/// ensures that navigation requests are safely bounded within the limits of the existing pages.
///
/// Returns:
/// - [bool]: Returns `true` if the navigation to the next page was successful, `false` if
/// already on the last page and navigation did not occur.
bool showNext() {
if (_currentPageIndex < _pages.length - 1) {
_currentPageIndex = _currentPageIndex + 1;
return true;
}