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
4ec51444
Commit
4ec51444
authored
Sep 14, 2016
by
Hans Muller
Committed by
GitHub
Sep 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scrollable should restore its viewport dimensions when it reappears (#5862)
parent
42b01132
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+9
-1
scroll_behavior_test.dart
packages/flutter/test/widget/scroll_behavior_test.dart
+5
-0
No files found.
packages/flutter/lib/src/widgets/scrollable.dart
View file @
4ec51444
...
...
@@ -274,6 +274,8 @@ class ScrollableState<T extends Scrollable> extends State<T> {
Simulation
_simulation
;
// if we're flinging, then this is the animation with which we're doing it
AnimationController
_controller
;
double
_contentExtent
;
double
_containerExtent
;
@override
void
dispose
()
{
...
...
@@ -285,7 +287,11 @@ class ScrollableState<T extends Scrollable> extends State<T> {
@override
void
dependenciesChanged
()
{
_scrollBehavior
=
createScrollBehavior
();
didUpdateScrollBehavior
(
scrollOffset
);
didUpdateScrollBehavior
(
_scrollBehavior
.
updateExtents
(
contentExtent:
_contentExtent
,
containerExtent:
_containerExtent
,
scrollOffset:
scrollOffset
));
super
.
dependenciesChanged
();
}
...
...
@@ -495,6 +501,8 @@ class ScrollableState<T extends Scrollable> extends State<T> {
/// [didUpdateScrollBehavior].
/// 3. Updating this object's gesture detector with [updateGestureDetector].
void
handleExtentsChanged
(
double
contentExtent
,
double
containerExtent
)
{
_contentExtent
=
contentExtent
;
_containerExtent
=
containerExtent
;
didUpdateScrollBehavior
(
scrollBehavior
.
updateExtents
(
contentExtent:
contentExtent
,
containerExtent:
containerExtent
,
...
...
packages/flutter/test/widget/scroll_behavior_test.dart
View file @
4ec51444
...
...
@@ -80,6 +80,8 @@ void main() {
expect
(
delegate
,
isNotNull
);
expect
(
delegate
.
flag
,
isTrue
);
expect
(
behavior
,
new
isInstanceOf
<
BoundedBehavior
>());
expect
(
behavior
.
contentExtent
,
equals
(
1000.0
));
expect
(
behavior
.
containerExtent
,
equals
(
600.0
));
// Same Scrollable, different ScrollConfiguration
await
tester
.
pumpWidget
(
...
...
@@ -101,5 +103,8 @@ void main() {
expect
(
delegate
,
isNotNull
);
expect
(
delegate
.
flag
,
isFalse
);
expect
(
behavior
,
new
isInstanceOf
<
UnboundedBehavior
>());
// Regression test for https://github.com/flutter/flutter/issues/5856
expect
(
behavior
.
contentExtent
,
equals
(
1000.0
));
expect
(
behavior
.
containerExtent
,
equals
(
600.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