buildOverscrollIndicator method

  1. @override
Widget buildOverscrollIndicator(
  1. BuildContext context,
  2. Widget child,
  3. ScrollableDetails details
)
override

Applies a GlowingOverscrollIndicator to the child widget on TargetPlatform.android and TargetPlatform.fuchsia.

Implementation

@override
Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) {
  // When modifying this function, consider modifying the implementation in
  // the base class ScrollBehavior as well.
  final AndroidOverscrollIndicator indicator = Theme.of(context).useMaterial3
      ? AndroidOverscrollIndicator.stretch
      : AndroidOverscrollIndicator.glow;
  switch (getPlatform(context)) {
    case TargetPlatform.iOS:
    case TargetPlatform.linux:
    case TargetPlatform.macOS:
    case TargetPlatform.windows:
      return child;
    case TargetPlatform.android:
      switch (indicator) {
        case AndroidOverscrollIndicator.stretch:
          return StretchingOverscrollIndicator(
            axisDirection: details.direction,
            clipBehavior: details.clipBehavior ?? Clip.hardEdge,
            child: child,
          );
        case AndroidOverscrollIndicator.glow:
          break;
      }
    case TargetPlatform.fuchsia:
      break;
  }
  return GlowingOverscrollIndicator(
    axisDirection: details.direction,
    color: Theme.of(context).colorScheme.secondary,
    child: child,
  );
}