getScrollPhysics method

ScrollPhysics getScrollPhysics(
  1. BuildContext context
)

The scroll physics to use for the platform given by getPlatform.

Defaults to RangeMaintainingScrollPhysics mixed with BouncingScrollPhysics on iOS and ClampingScrollPhysics on Android.

Implementation

ScrollPhysics getScrollPhysics(BuildContext context) {
  // When modifying this function, consider modifying the implementation in
  // the Material and Cupertino subclasses as well.
  switch (getPlatform(context)) {
    case TargetPlatform.iOS:
      return _bouncingPhysics;
    case TargetPlatform.macOS:
      return _bouncingDesktopPhysics;
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
    case TargetPlatform.linux:
    case TargetPlatform.windows:
      return _clampingPhysics;
  }
}