goToPage method Null safety

void goToPage(
  1. int newPage
)

Changes which page is displayed in the controlled Curtain.

Implementation

void goToPage(int newPage) {
  _previousPage = _page;
  _page = newPage;
  notifyListeners();
}