buildScrollbar method Null safety

Widget buildScrollbar(
  1. BuildContext context,
  2. Widget child,
  3. ScrollableDetails details

Applies a RawScrollbar to the child widget on desktop platforms.


Widget buildScrollbar(BuildContext context, Widget child, ScrollableDetails details) {
  // When modifying this function, consider modifying the implementation in
  // the Material and Cupertino subclasses as well.
  switch (getPlatform(context)) {
    case TargetPlatform.linux:
    case TargetPlatform.macOS:
      return RawScrollbar(
        controller: details.controller,
        child: child,
    case TargetPlatform.fuchsia:
    case TargetPlatform.iOS:
      return child;