getScrollPhysics method

ScrollPhysics getScrollPhysics (BuildContext context)

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

Defaults to BouncingScrollPhysics on iOS and ClampingScrollPhysics on Android.

Implementation

ScrollPhysics getScrollPhysics(BuildContext context) {
  switch (getPlatform(context)) {
    case TargetPlatform.iOS:
      return const BouncingScrollPhysics();
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
      return const ClampingScrollPhysics();
  }
  return null;
}