ScrollController constructor Null safety

ScrollController(
  1. {double initialScrollOffset = 0.0,
  2. bool keepScrollOffset = true,
  3. String? debugLabel}
)

Creates a controller for a scrollable widget.

The values of initialScrollOffset and keepScrollOffset must not be null.

Implementation

ScrollController({
  double initialScrollOffset = 0.0,
  this.keepScrollOffset = true,
  this.debugLabel,
}) : assert(initialScrollOffset != null),
     assert(keepScrollOffset != null),
     _initialScrollOffset = initialScrollOffset;