Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
fbc4e9bc
Unverified
Commit
fbc4e9bc
authored
Aug 12, 2021
by
Michael Goderbauer
Committed by
GitHub
Aug 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Update MaterialScrollBehavior.buildScrollbar for horizontal axes (#87740)" (#88129)
parent
5b5eaf0e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
38 deletions
+10
-38
app.dart
packages/flutter/lib/src/material/app.dart
+3
-12
tabs.dart
packages/flutter/lib/src/material/tabs.dart
+7
-10
scrollbar_test.dart
packages/flutter/test/material/scrollbar_test.dart
+0
-16
No files found.
packages/flutter/lib/src/material/app.dart
View file @
fbc4e9bc
...
...
@@ -693,13 +693,8 @@ class MaterialApp extends StatefulWidget {
/// [GlowingOverscrollIndicator] to [Scrollable] descendants when executing on
/// [TargetPlatform.android] and [TargetPlatform.fuchsia].
///
/// The [buildScrollbar] function is called by the [Scrollable] to wrap with a
/// [Scrollbar] when appropriate. On all platforms, when the Scrollable [Axis] is
/// [Axis.horizontal], an always visible Scrollbar will be applied. This is
/// because horizontal [ScrollView]s have lower discoverability as scrollable
/// content. When the Axis is [Axis.vertical] a Scrollbar is applied on
/// desktop platforms. In this vertical case, [Scrollbar.isAlwaysShown] is not
/// set and will defer to the inherited [ScrollbarTheme].
/// When using the desktop platform, if the [Scrollable] widget scrolls in the
/// [Axis.vertical], a [Scrollbar] is applied.
///
/// See also:
///
...
...
@@ -721,11 +716,7 @@ class MaterialScrollBehavior extends ScrollBehavior {
// the base class as well.
switch
(
axisDirectionToAxis
(
details
.
direction
))
{
case
Axis
.
horizontal
:
return
Scrollbar
(
isAlwaysShown:
true
,
controller:
details
.
controller
,
child:
child
,
);
return
child
;
case
Axis
.
vertical
:
switch
(
getPlatform
(
context
))
{
case
TargetPlatform
.
linux
:
...
...
packages/flutter/lib/src/material/tabs.dart
View file @
fbc4e9bc
...
...
@@ -1308,16 +1308,13 @@ class _TabBarState extends State<TabBar> {
if
(
widget
.
isScrollable
)
{
_scrollController
??=
_TabBarScrollController
(
this
);
tabBar
=
ScrollConfiguration
(
behavior:
ScrollConfiguration
.
of
(
context
).
copyWith
(
scrollbars:
false
),
child:
SingleChildScrollView
(
dragStartBehavior:
widget
.
dragStartBehavior
,
scrollDirection:
Axis
.
horizontal
,
controller:
_scrollController
,
padding:
widget
.
padding
,
physics:
widget
.
physics
,
child:
tabBar
,
),
tabBar
=
SingleChildScrollView
(
dragStartBehavior:
widget
.
dragStartBehavior
,
scrollDirection:
Axis
.
horizontal
,
controller:
_scrollController
,
padding:
widget
.
padding
,
physics:
widget
.
physics
,
child:
tabBar
,
);
}
else
if
(
widget
.
padding
!=
null
)
{
tabBar
=
Padding
(
...
...
packages/flutter/test/material/scrollbar_test.dart
View file @
fbc4e9bc
...
...
@@ -1557,20 +1557,4 @@ void main() {
),
);
});
testWidgets
(
'MaterialScrollBehavior applies always shown Scrollbar to horizontal scrollables'
,
(
WidgetTester
tester
)
async
{
final
ScrollController
controller
=
ScrollController
();
await
tester
.
pumpWidget
(
MaterialApp
(
home:
SingleChildScrollView
(
scrollDirection:
Axis
.
horizontal
,
controller:
controller
,
child:
const
SizedBox
(
width:
4000.0
,
height:
4000.0
,
),
),
));
await
tester
.
pumpAndSettle
();
expect
(
find
.
byType
(
Scrollbar
),
paints
..
rect
());
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment