Viewport constructor
Creates a widget that is bigger on the inside.
The viewport listens to the offset
, which means you do not need to
rebuild this widget when the offset
changes.
The offset
argument must not be null.
Implementation
Viewport({
Key key,
this.axisDirection = AxisDirection.down,
this.crossAxisDirection,
this.anchor = 0.0,
@required this.offset,
this.center,
this.cacheExtent,
List<Widget> slivers = const <Widget>[],
}) : assert(offset != null),
assert(slivers != null),
assert(center == null || slivers.where((Widget child) => child.key == center).length == 1),
super(key: key, children: slivers);