ScrollView constructor

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

Creates a widget that scrolls.

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

Implementation

ScrollView({
  Key key,
  this.scrollDirection: Axis.vertical,
  this.reverse: false,
  this.controller,
  bool primary,
  ScrollPhysics physics,
  this.shrinkWrap: false,
  this.cacheExtent,
}) : 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 && scrollDirection == Axis.vertical,
     physics = physics ?? (primary == true || (primary == null && controller == null && scrollDirection == Axis.vertical) ? const AlwaysScrollableScrollPhysics() : null),
     super(key: key);