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
54ef030a
Unverified
Commit
54ef030a
authored
Jan 16, 2021
by
Jenn Magder
Committed by
GitHub
Jan 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Improve the ScrollBar behavior when nested (#71843)" (#74088)
This reverts commit
99daddc2
.
parent
d603ee11
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
82 deletions
+0
-82
scrollbar.dart
packages/flutter/lib/src/cupertino/scrollbar.dart
+0
-2
scrollbar.dart
packages/flutter/lib/src/material/scrollbar.dart
+0
-2
scrollbar.dart
packages/flutter/lib/src/widgets/scrollbar.dart
+0
-15
scrollbar_test.dart
packages/flutter/test/widgets/scrollbar_test.dart
+0
-63
No files found.
packages/flutter/lib/src/cupertino/scrollbar.dart
View file @
54ef030a
...
...
@@ -61,7 +61,6 @@ class CupertinoScrollbar extends RawScrollbar {
this
.
thicknessWhileDragging
=
defaultThicknessWhileDragging
,
Radius
radius
=
defaultRadius
,
this
.
radiusWhileDragging
=
defaultRadiusWhileDragging
,
ScrollNotificationPredicate
?
notificationPredicate
,
})
:
assert
(
thickness
!=
null
),
assert
(
thickness
<
double
.
infinity
),
assert
(
thicknessWhileDragging
!=
null
),
...
...
@@ -78,7 +77,6 @@ class CupertinoScrollbar extends RawScrollbar {
fadeDuration:
_kScrollbarFadeDuration
,
timeToFade:
_kScrollbarTimeToFade
,
pressDuration:
const
Duration
(
milliseconds:
100
),
notificationPredicate:
notificationPredicate
??
defaultScrollNotificationPredicate
,
);
/// Default value for [thickness] if it's not specified in [CupertinoScrollbar].
...
...
packages/flutter/lib/src/material/scrollbar.dart
View file @
54ef030a
...
...
@@ -153,7 +153,6 @@ class _MaterialScrollbar extends RawScrollbar {
this
.
hoverThickness
,
double
?
thickness
,
Radius
?
radius
,
ScrollNotificationPredicate
?
notificationPredicate
,
})
:
super
(
key:
key
,
child:
child
,
...
...
@@ -164,7 +163,6 @@ class _MaterialScrollbar extends RawScrollbar {
fadeDuration:
_kScrollbarFadeDuration
,
timeToFade:
_kScrollbarTimeToFade
,
pressDuration:
Duration
.
zero
,
notificationPredicate:
notificationPredicate
??
defaultScrollNotificationPredicate
,
);
final
bool
?
showTrackOnHover
;
...
...
packages/flutter/lib/src/widgets/scrollbar.dart
View file @
54ef030a
...
...
@@ -565,10 +565,6 @@ class ScrollbarPainter extends ChangeNotifier implements CustomPainter {
/// visible without the fade animation. This requires that a [ScrollController]
/// is provided to [controller], or that the [PrimaryScrollController] is available.
///
/// If the scrollbar is wrapped around multiple [ScrollView]s, it only responds to
/// the nearest scrollView and shows the corresponding scrollbar thumb by default.
/// Set [notificationPredicate] to something else for more complicated behaviors.
///
/// Scrollbars are interactive and will also use the [PrimaryScrollController] if
/// a [controller] is not set. Scrollbar thumbs can be dragged along the main axis
/// of the [ScrollView] to change the [ScrollPosition]. Tapping along the track
...
...
@@ -611,7 +607,6 @@ class RawScrollbar extends StatefulWidget {
this
.
fadeDuration
=
_kScrollbarFadeDuration
,
this
.
timeToFade
=
_kScrollbarTimeToFade
,
this
.
pressDuration
=
Duration
.
zero
,
this
.
notificationPredicate
=
defaultScrollNotificationPredicate
,
})
:
assert
(
child
!=
null
),
assert
(
fadeDuration
!=
null
),
assert
(
timeToFade
!=
null
),
...
...
@@ -772,14 +767,6 @@ class RawScrollbar extends StatefulWidget {
/// Cannot be null, defaults to [Duration.zero].
final
Duration
pressDuration
;
/// A check that specifies whether a [ScrollNotification] should be
/// handled by this widget.
///
/// By default, checks whether `notification.depth == 0`. That means if the
/// scrollbar is wrapped around multiple [ScrollView]s, it only responds to the
/// nearest scrollView and shows the corresponding scrollbar thumb.
final
ScrollNotificationPredicate
notificationPredicate
;
@override
RawScrollbarState
<
RawScrollbar
>
createState
()
=>
RawScrollbarState
<
RawScrollbar
>();
}
...
...
@@ -1044,8 +1031,6 @@ class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProv
}
bool
_handleScrollNotification
(
ScrollNotification
notification
)
{
if
(!
widget
.
notificationPredicate
(
notification
))
return
false
;
final
ScrollMetrics
metrics
=
notification
.
metrics
;
if
(
metrics
.
maxScrollExtent
<=
metrics
.
minScrollExtent
)
...
...
packages/flutter/test/widgets/scrollbar_test.dart
View file @
54ef030a
...
...
@@ -804,67 +804,4 @@ void main() {
),
);
});
// Regression test for https://github.com/flutter/flutter/issues/66444
testWidgets
(
"Scrollbar doesn't show when scroll the inner scrollable widget"
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
key1
=
GlobalKey
();
final
GlobalKey
key2
=
GlobalKey
();
final
GlobalKey
outerKey
=
GlobalKey
();
final
GlobalKey
innerKey
=
GlobalKey
();
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
data:
const
MediaQueryData
(),
child:
RawScrollbar
(
key:
key2
,
thumbColor:
const
Color
(
0x11111111
),
child:
SingleChildScrollView
(
key:
outerKey
,
child:
SizedBox
(
height:
1000.0
,
width:
double
.
infinity
,
child:
Column
(
children:
<
Widget
>[
RawScrollbar
(
key:
key1
,
thumbColor:
const
Color
(
0x22222222
),
child:
SizedBox
(
height:
300.0
,
width:
double
.
infinity
,
child:
SingleChildScrollView
(
key:
innerKey
,
child:
const
SizedBox
(
key:
Key
(
'Inner scrollable'
),
height:
1000.0
,
width:
double
.
infinity
,
),
),
),
),
],
),
),
),
),
),
),
);
// Drag the inner scrollable widget.
await
tester
.
drag
(
find
.
byKey
(
innerKey
),
const
Offset
(
0.0
,
-
25.0
));
await
tester
.
pump
();
// Scrollbar fully showing.
await
tester
.
pump
(
const
Duration
(
milliseconds:
500
));
expect
(
tester
.
renderObject
(
find
.
byKey
(
key2
)),
paintsExactlyCountTimes
(
#drawRect
,
2
),
// Each bar will call [drawRect] twice.
);
expect
(
tester
.
renderObject
(
find
.
byKey
(
key1
)),
paintsExactlyCountTimes
(
#drawRect
,
2
),
);
});
}
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