ScrollView constructor

const ScrollView({Key key, Axis scrollDirection: Axis.vertical, bool reverse: false, ScrollController controller, bool primary, ScrollPhysics physics, bool shrinkWrap: false, double cacheExtent, int semanticChildCount })

Creates a widget that scrolls.

If the primary argument is true, the controller must be null.

Implementation

const ScrollView({
  Key key,
  this.scrollDirection = Axis.vertical,
  this.reverse = false,
  this.controller,
  bool primary,
  ScrollPhysics physics,
  this.shrinkWrap = false,
  this.cacheExtent,
  this.semanticChildCount,
}) : assert(reverse != null),
     assert(shrinkWrap != null),
     assert(!(controller != null && primary == true),
         'Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. '
         'You cannot both set primary to true and pass an explicit controller.'
     ),
     primary = primary ?? controller == null && identical(scrollDirection, Axis.vertical),
     physics = physics ?? (primary == true || (primary == null && controller == null && identical(scrollDirection, Axis.vertical)) ? const AlwaysScrollableScrollPhysics() : null),
     super(key: key);