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
3f70271d
Commit
3f70271d
authored
Jul 21, 2015
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manage listener with on,didMount
parent
b0e0e65c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
variable_height_scrollable.dart
packages/flutter/lib/widgets/variable_height_scrollable.dart
+11
-7
No files found.
packages/flutter/lib/widgets/variable_height_scrollable.dart
View file @
3f70271d
...
...
@@ -28,11 +28,20 @@ class VariableHeightScrollable extends Scrollable {
void
initState
()
{
assert
(
layoutState
!=
null
);
layoutState
.
removeListener
(
_handleLayoutChanged
);
layoutState
.
addListener
(
_handleLayoutChanged
);
super
.
initState
();
}
void
didMount
()
{
layoutState
.
addListener
(
_handleLayoutChanged
);
super
.
didMount
();
}
void
didUnmount
()
{
layoutState
.
removeListener
(
_handleLayoutChanged
);
super
.
didUnmount
();
}
void
syncFields
(
VariableHeightScrollable
source
)
{
builder
=
source
.
builder
;
if
(
token
!=
source
.
token
)
...
...
@@ -55,11 +64,6 @@ class VariableHeightScrollable extends Scrollable {
scrollBehavior
.
containerSize
=
newSize
.
height
;
}
void
didUnmount
()
{
layoutState
.
removeListener
(
_handleLayoutChanged
);
super
.
didUnmount
();
}
void
_handleLayoutChanged
()
{
if
(
layoutState
.
didReachLastChild
)
{
scrollBehavior
.
contentsSize
=
layoutState
.
contentsSize
;
...
...
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