changePage method Null safety

void changePage(
  1. int index
)

Maps an index to a state which reflect a page.

So far there is only four pages, so the index should be between 0 and 3.

Implementation

void changePage(int index) {
  if (index == 0) emit(const NavigationHome());
  if (index == 1) emit(const NavigationAcademic());
  if (index == 2) emit(const NavigationPayments());
  if (index == 3) emit(const NavigationProfile());
}