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
6d7bf20f
Commit
6d7bf20f
authored
Jan 14, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1243 from abarth/edge_trigger
Stocks has both tabs reified in the wiget tree
parents
675f4c4d
b5ed355b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
12 deletions
+26
-12
pageable_list.dart
packages/flutter/lib/src/widgets/pageable_list.dart
+2
-2
scrollable_grid.dart
packages/flutter/lib/src/widgets/scrollable_grid.dart
+2
-2
scrollable_list.dart
packages/flutter/lib/src/widgets/scrollable_list.dart
+2
-2
virtual_viewport.dart
packages/flutter/lib/src/widgets/virtual_viewport.dart
+20
-6
No files found.
packages/flutter/lib/src/widgets/pageable_list.dart
View file @
6d7bf20f
...
...
@@ -225,10 +225,10 @@ class _PageViewportElement extends VirtualViewportElement<PageViewport> {
return
-(
widget
.
startOffset
-
startOffsetBase
)
*
_containerExtent
;
}
void
updateRenderObject
()
{
void
updateRenderObject
(
PageViewport
oldWidget
)
{
renderObject
.
scrollDirection
=
widget
.
scrollDirection
;
renderObject
.
overlayPainter
=
widget
.
overlayPainter
;
super
.
updateRenderObject
();
super
.
updateRenderObject
(
oldWidget
);
}
double
_containerExtent
;
...
...
packages/flutter/lib/src/widgets/scrollable_grid.dart
View file @
6d7bf20f
...
...
@@ -122,9 +122,9 @@ class _GridViewportElement extends VirtualViewportElement<GridViewport> {
double
get
startOffsetLimit
=>
_startOffsetLimit
;
double
_startOffsetLimit
;
void
updateRenderObject
()
{
void
updateRenderObject
(
GridViewport
oldWidget
)
{
renderObject
.
delegate
=
widget
.
delegate
;
super
.
updateRenderObject
();
super
.
updateRenderObject
(
oldWidget
);
}
double
_contentExtent
;
...
...
packages/flutter/lib/src/widgets/scrollable_list.dart
View file @
6d7bf20f
...
...
@@ -135,12 +135,12 @@ class _ListViewportElement extends VirtualViewportElement<ListViewport> {
double
get
startOffsetLimit
=>
_startOffsetLimit
;
double
_startOffsetLimit
;
void
updateRenderObject
()
{
void
updateRenderObject
(
ListViewport
oldWidget
)
{
renderObject
.
scrollDirection
=
widget
.
scrollDirection
;
renderObject
.
itemExtent
=
widget
.
itemExtent
;
renderObject
.
padding
=
widget
.
padding
;
renderObject
.
overlayPainter
=
widget
.
overlayPainter
;
super
.
updateRenderObject
();
super
.
updateRenderObject
(
oldWidget
);
}
double
_contentExtent
;
...
...
packages/flutter/lib/src/widgets/virtual_viewport.dart
View file @
6d7bf20f
...
...
@@ -43,7 +43,7 @@ abstract class VirtualViewportElement<T extends VirtualViewport> extends RenderO
_iterator
=
null
;
_widgets
=
<
Widget
>[];
renderObject
.
callback
=
layout
;
updateRenderObject
();
updateRenderObject
(
null
);
}
void
unmount
()
{
...
...
@@ -56,8 +56,9 @@ abstract class VirtualViewportElement<T extends VirtualViewport> extends RenderO
_iterator
=
null
;
_widgets
=
<
Widget
>[];
}
T
oldWidget
=
widget
;
super
.
update
(
newWidget
);
updateRenderObject
();
updateRenderObject
(
oldWidget
);
if
(!
renderObject
.
needsLayout
)
_materializeChildren
();
}
...
...
@@ -73,7 +74,7 @@ abstract class VirtualViewportElement<T extends VirtualViewport> extends RenderO
}
}
void
updateRenderObject
()
{
void
updateRenderObject
(
T
oldWidget
)
{
renderObject
.
virtualChildCount
=
widget
.
children
.
length
;
if
(
startOffsetBase
!=
null
)
{
...
...
@@ -82,9 +83,22 @@ abstract class VirtualViewportElement<T extends VirtualViewport> extends RenderO
// If we don't already need layout, we need to request a layout if the
// viewport has shifted to expose new children.
if
(!
renderObject
.
needsLayout
)
{
if
(
startOffsetBase
!=
null
&&
widget
.
startOffset
<
startOffsetBase
)
renderObject
.
markNeedsLayout
();
else
if
(
startOffsetLimit
!=
null
&&
widget
.
startOffset
>
startOffsetLimit
)
bool
shouldLayout
=
false
;
if
(
startOffsetBase
!=
null
)
{
if
(
widget
.
startOffset
<
startOffsetBase
)
shouldLayout
=
true
;
else
if
(
widget
.
startOffset
==
startOffsetBase
&&
oldWidget
?.
startOffset
!=
startOffsetBase
)
shouldLayout
=
true
;
}
if
(
startOffsetLimit
!=
null
)
{
if
(
widget
.
startOffset
>
startOffsetLimit
)
shouldLayout
=
true
;
else
if
(
widget
.
startOffset
==
startOffsetLimit
&&
oldWidget
?.
startOffset
!=
startOffsetLimit
)
shouldLayout
=
true
;
}
if
(
shouldLayout
)
renderObject
.
markNeedsLayout
();
}
}
...
...
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