adaptiveCommandScrollbarBuilder function

CommandScrollbarBuilder adaptiveCommandScrollbarBuilder({
  1. bool? thumbVisibility,
  2. double? thickness,
  3. Radius? radius,
  4. ScrollNotificationPredicate? notificationPredicate,
})

A CommandScrollbarBuilder that automatically selects CupertinoScrollbar on iOS and macOS, and Material Scrollbar on other platforms.

Implementation

CommandScrollbarBuilder adaptiveCommandScrollbarBuilder({
  bool? thumbVisibility,
  double? thickness,
  Radius? radius,
  ScrollNotificationPredicate? notificationPredicate,
}) => (BuildContext context, Widget child, ScrollController scrollController) {
  final platform = material.Theme.of(context).platform;
  final isApple =
      platform == TargetPlatform.iOS || platform == TargetPlatform.macOS;
  if (isApple) {
    return cupertinoCommandScrollbarBuilder(
      thumbVisibility: thumbVisibility,
      thickness: thickness,
      radius: radius,
      notificationPredicate: notificationPredicate,
    )(context, child, scrollController);
  } else {
    return materialCommandScrollbarBuilder(
      thumbVisibility: thumbVisibility,
      thickness: thickness,
      radius: radius,
      notificationPredicate: notificationPredicate,
    )(context, child, scrollController);
  }
};