From c57e67d84426cf51c2aa2b34e4df2b42a66ac4d6 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Wed, 2 Feb 2022 20:20:05 -0600 Subject: [PATCH] Add docs about horizontal scrollbars (#97673) --- packages/flutter/lib/src/material/app.dart | 4 ++++ packages/flutter/lib/src/material/scrollbar.dart | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/flutter/lib/src/material/app.dart b/packages/flutter/lib/src/material/app.dart index 91f819d132..6dd71a7450 100644 --- a/packages/flutter/lib/src/material/app.dart +++ b/packages/flutter/lib/src/material/app.dart @@ -723,6 +723,10 @@ class MaterialApp extends StatefulWidget { /// When using the desktop platform, if the [Scrollable] widget scrolls in the /// [Axis.vertical], a [Scrollbar] is applied. /// +/// If the scroll direction is [Axis.horizontal] scroll views are less +/// discoverable, so consider adding a Scrollbar in these cases, either directly +/// or through the [buildScrollbar] method. +/// /// [MaterialScrollBehavior.androidOverscrollIndicator] specifies the /// overscroll indicator that is used on [TargetPlatform.android]. When null, /// [ThemeData.androidOverscrollIndicator] is used. If also null, the default diff --git a/packages/flutter/lib/src/material/scrollbar.dart b/packages/flutter/lib/src/material/scrollbar.dart index dc564cd68f..83f835b73d 100644 --- a/packages/flutter/lib/src/material/scrollbar.dart +++ b/packages/flutter/lib/src/material/scrollbar.dart @@ -47,6 +47,10 @@ const Duration _kScrollbarTimeToFade = Duration(milliseconds: 600); /// without the fade animation. This requires that a [ScrollController] is /// provided to controller, or that the [PrimaryScrollController] is available. /// +/// When a [ScrollView.scrollDirection] is [Axis.horizontal], it is recommended +/// that the [Scrollbar] is always visible, since scrolling in the horizontal +/// axis is less discoverable. +/// /// ** See code in examples/api/lib/material/scrollbar/scrollbar.1.dart ** /// {@end-tool} ///