pages property

List<Page> pages
final

The list of pages with which to populate the history.

Pages are turned into routes using Page.createRoute in a manner analogous to how Widgets are turned into Elements (and States or RenderObjects) using Widget.createElement (and StatefulWidget.createState or RenderObjectWidget.createRenderObject).

When this list is updated, the new list is compared to the previous list and the set of routes is updated accordingly.

Some Routes do not correspond to Page objects, namely, those that are added to the history using the Navigator API (push and friends). A Route that does not correspond to a Page object is called a pageless route and is tied to the Route that does correspond to a Page object that is below it in the history.

Pages that are added or removed may be animated as controlled by the transitionDelegate. If a page is removed that had other pageless routes pushed on top of it using push and friends, those pageless routes are also removed with or without animation as determined by the transitionDelegate.

To use this API, an onPopPage callback must also be provided to properly clean up this list if a page has been popped.

If initialRoute is non-null when the widget is first created, then onGenerateInitialRoutes is used to generate routes that are above those corresponding to pages in the initial history.

Implementation

final List<Page<dynamic>> pages