buildViewportChrome method

Widget buildViewportChrome (BuildContext context, Widget child, AxisDirection axisDirection)

Wraps the given widget, which scrolls in the given AxisDirection.

For example, on Android, this method wraps the given widget with a GlowingOverscrollIndicator to provide visual feedback when the user overscrolls.

Implementation

Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) {
  // When modifying this function, consider modifying the implementation in
  // _MaterialScrollBehavior as well.
  switch (getPlatform(context)) {
    case TargetPlatform.iOS:
      return child;
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
      return GlowingOverscrollIndicator(
        child: child,
        axisDirection: axisDirection,
        color: _kDefaultGlowColor,
      );
  }
  return null;
}