PageView constructor

PageView({Key key, Axis scrollDirection: Axis.horizontal, bool reverse: false, PageController controller, ScrollPhysics physics, bool pageSnapping: true, ValueChanged<int> onPageChanged, List<Widget> children: const [] })

Creates a scrollable list that works page by page from an explicit List of widgets.

This constructor is appropriate for page views with a small number of children because constructing the List requires doing work for every child that could possibly be displayed in the page view, instead of just those children that are actually visible.

Implementation

PageView({
  Key key,
  this.scrollDirection = Axis.horizontal,
  this.reverse = false,
  PageController controller,
  this.physics,
  this.pageSnapping = true,
  this.onPageChanged,
  List<Widget> children = const <Widget>[],
}) : controller = controller ?? _defaultPageController,
     childrenDelegate = SliverChildListDelegate(children),
     super(key: key);