getScrollPhysics method Null safety

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) {
  switch (getPlatform(context)) {
    case TargetPlatform.iOS:
    case TargetPlatform.macOS:
      return _bouncingPhysics;
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
    case TargetPlatform.linux:
    case TargetPlatform.windows:
      return _clampingPhysics;
  }
}