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
30fed3a0
Unverified
Commit
30fed3a0
authored
May 15, 2019
by
Hans Muller
Committed by
GitHub
May 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Material should not prevent ScrollNotifications from bubbling upwards (#32726)
parent
7d667dec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
material.dart
packages/flutter/lib/src/material/material.dart
+1
-1
scroll_notification_test.dart
packages/flutter/test/widgets/scroll_notification_test.dart
+50
-0
No files found.
packages/flutter/lib/src/material/material.dart
View file @
30fed3a0
...
...
@@ -339,7 +339,7 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin {
onNotification:
(
LayoutChangedNotification
notification
)
{
final
_RenderInkFeatures
renderer
=
_inkFeatureRenderer
.
currentContext
.
findRenderObject
();
renderer
.
_didChangeLayout
();
return
tru
e
;
return
fals
e
;
},
child:
_InkFeatures
(
key:
_inkFeatureRenderer
,
...
...
packages/flutter/test/widgets/scroll_notification_test.dart
View file @
30fed3a0
...
...
@@ -4,6 +4,7 @@
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
void
main
(
)
{
...
...
@@ -101,4 +102,53 @@ void main() {
expect
(
depth0Values
,
equals
(<
int
>[
0
,
0
,
0
,
0
,
0
]));
expect
(
depth1Values
,
equals
(<
int
>[
1
,
1
,
1
,
1
,
1
]));
});
testWidgets
(
'ScrollNotifications bubble past Scaffold Material'
,
(
WidgetTester
tester
)
async
{
final
List
<
Type
>
notificationTypes
=
<
Type
>[];
await
tester
.
pumpWidget
(
MaterialApp
(
home:
NotificationListener
<
ScrollNotification
>(
onNotification:
(
ScrollNotification
value
)
{
notificationTypes
.
add
(
value
.
runtimeType
);
return
false
;
},
child:
Scaffold
(
body:
SizedBox
.
expand
(
child:
SingleChildScrollView
(
dragStartBehavior:
DragStartBehavior
.
down
,
child:
SizedBox
(
height:
1200.0
,
child:
Container
(
padding:
const
EdgeInsets
.
all
(
50.0
),
child:
const
SingleChildScrollView
(
child:
SizedBox
(
height:
1200.0
),
dragStartBehavior:
DragStartBehavior
.
down
,
),
),
),
),
),
),
),
),
);
final
TestGesture
gesture
=
await
tester
.
startGesture
(
const
Offset
(
100.0
,
100.0
));
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
await
gesture
.
moveBy
(
const
Offset
(-
10.0
,
-
40.0
));
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
await
gesture
.
up
();
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
final
List
<
Type
>
types
=
<
Type
>[
ScrollStartNotification
,
UserScrollNotification
,
ScrollUpdateNotification
,
ScrollEndNotification
,
UserScrollNotification
,
];
expect
(
notificationTypes
,
equals
(
types
));
});
}
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