copyWith method

ScrollBehavior copyWith({
  1. bool? scrollbars,
  2. bool? overscroll,
  3. Set<PointerDeviceKind>? dragDevices,
  4. MultitouchDragStrategy? multitouchDragStrategy,
  5. Set<LogicalKeyboardKey>? pointerAxisModifiers,
  6. ScrollPhysics? physics,
  7. TargetPlatform? platform,
})

Creates a copy of this ScrollBehavior, making it possible to easily toggle scrollbar and overscrollIndicator effects.

This is used by widgets like PageView and ListWheelScrollView to override the current ScrollBehavior and manage how they are decorated. Widgets such as these have the option to provide a ScrollBehavior on the widget level, like PageView.scrollBehavior, in order to change the default.

Implementation

ScrollBehavior copyWith({
  bool? scrollbars,
  bool? overscroll,
  Set<PointerDeviceKind>? dragDevices,
  MultitouchDragStrategy? multitouchDragStrategy,
  Set<LogicalKeyboardKey>? pointerAxisModifiers,
  ScrollPhysics? physics,
  TargetPlatform? platform,
}) {
  return _WrappedScrollBehavior(
    delegate: this,
    scrollbars: scrollbars ?? true,
    overscroll: overscroll ?? true,
    dragDevices: dragDevices,
    multitouchDragStrategy: multitouchDragStrategy,
    pointerAxisModifiers: pointerAxisModifiers,
    physics: physics,
    platform: platform,
  );
}