initializeRoutes method

  1. @override
void initializeRoutes(
  1. List<Widget> pages, {
  2. dynamic lastPageCallback(
    1. BuildContext context
    )?,
})
override

Call this function to load a list of pages to be pushed on to the array.

lastPageCallback is what pushNext will do for the final page in the array, for example, show a dialog box and then push another page or go back to the main page with the Navigator.

Implementation

@override
void initializeRoutes(List<Widget> pages,
    {Function(BuildContext context)? lastPageCallback}) {
  _lastPageCallback = lastPageCallback;
  _pageDataMap = _generatePageStates(pages: pages);
  _isStackLoaded = true;
}