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
589cd0bb
Commit
589cd0bb
authored
May 19, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct Block scrollableKey plumbing (#4048)
parent
199f24ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+1
-1
block_test.dart
packages/flutter/test/widget/block_test.dart
+14
-0
No files found.
packages/flutter/lib/src/widgets/scrollable.dart
View file @
589cd0bb
...
...
@@ -854,7 +854,7 @@ class Block extends StatelessWidget {
if
(
padding
!=
null
)
contents
=
new
Padding
(
padding:
padding
,
child:
contents
);
return
new
ScrollableViewport
(
k
ey:
scrollableKey
,
scrollableK
ey:
scrollableKey
,
initialScrollOffset:
initialScrollOffset
,
scrollDirection:
scrollDirection
,
scrollAnchor:
scrollAnchor
,
...
...
packages/flutter/test/widget/block_test.dart
View file @
589cd0bb
...
...
@@ -105,4 +105,18 @@ void main() {
expect
(
first
,
equals
(
1
));
expect
(
second
,
equals
(
1
));
});
testWidgets
(
'Block scrollableKey'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/4046
// The Block's scrollableKey needs to become its Scrollable descendant's key.
final
GlobalKey
<
ScrollableState
<
Scrollable
>>
key
=
new
GlobalKey
<
ScrollableState
<
Scrollable
>>();
Widget
buildBlock
()
{
return
new
Block
(
scrollableKey:
key
,
children:
<
Widget
>[
new
Text
(
"A"
),
new
Text
(
"B"
),
new
Text
(
"C"
)]
);
}
await
tester
.
pumpWidget
(
buildBlock
());
expect
(
key
.
currentState
.
scrollOffset
,
0.0
);
});
}
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