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
d78b78c4
Commit
d78b78c4
authored
Mar 12, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[rename fixit] scrollAnchor -> anchor
parent
e9b8f445
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
35 deletions
+37
-35
list.dart
packages/flutter/lib/src/rendering/list.dart
+2
-0
viewport.dart
packages/flutter/lib/src/rendering/viewport.dart
+13
-13
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+4
-4
pageable_list.dart
packages/flutter/lib/src/widgets/pageable_list.dart
+4
-4
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+1
-1
scrollable_list.dart
packages/flutter/lib/src/widgets/scrollable_list.dart
+12
-12
virtual_viewport.dart
packages/flutter/lib/src/widgets/virtual_viewport.dart
+1
-1
No files found.
packages/flutter/lib/src/rendering/list.dart
View file @
d78b78c4
...
...
@@ -19,6 +19,7 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
int
virtualChildCount
,
Offset
paintOffset:
Offset
.
zero
,
Axis
mainAxis:
Axis
.
vertical
,
ViewportAnchor
anchor:
ViewportAnchor
.
start
,
Painter
overlayPainter
,
LayoutCallback
callback
})
:
_itemExtent
=
itemExtent
,
...
...
@@ -27,6 +28,7 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
virtualChildCount:
virtualChildCount
,
paintOffset:
paintOffset
,
mainAxis:
mainAxis
,
anchor:
anchor
,
overlayPainter:
overlayPainter
,
callback:
callback
)
{
...
...
packages/flutter/lib/src/rendering/viewport.dart
View file @
d78b78c4
...
...
@@ -85,11 +85,11 @@ class RenderViewportBase extends RenderBox implements HasMainAxis {
RenderViewportBase
(
Offset
paintOffset
,
Axis
mainAxis
,
ViewportAnchor
scrollA
nchor
,
ViewportAnchor
a
nchor
,
Painter
overlayPainter
)
:
_paintOffset
=
paintOffset
,
_mainAxis
=
mainAxis
,
_
scrollAnchor
=
scrollA
nchor
,
_
anchor
=
a
nchor
,
_overlayPainter
=
overlayPainter
{
assert
(
paintOffset
!=
null
);
assert
(
mainAxis
!=
null
);
...
...
@@ -139,13 +139,13 @@ class RenderViewportBase extends RenderBox implements HasMainAxis {
/// The end of the viewport from which the paint offset is computed.
///
/// See [ViewportAnchor] for more detail.
ViewportAnchor
get
scrollAnchor
=>
_scrollA
nchor
;
ViewportAnchor
_
scrollA
nchor
;
void
set
scrollA
nchor
(
ViewportAnchor
value
)
{
ViewportAnchor
get
anchor
=>
_a
nchor
;
ViewportAnchor
_
a
nchor
;
void
set
a
nchor
(
ViewportAnchor
value
)
{
assert
(
value
!=
null
);
if
(
value
==
_
scrollA
nchor
)
if
(
value
==
_
a
nchor
)
return
;
_
scrollA
nchor
=
value
;
_
a
nchor
=
value
;
markNeedsPaint
();
markNeedsSemanticsUpdate
();
}
...
...
@@ -186,7 +186,7 @@ class RenderViewportBase extends RenderBox implements HasMainAxis {
int
dyInDevicePixels
=
(
_paintOffset
.
dy
*
devicePixelRatio
).
round
();
return
_dimensions
.
getAbsolutePaintOffset
(
paintOffset:
new
Offset
(
dxInDevicePixels
/
devicePixelRatio
,
dyInDevicePixels
/
devicePixelRatio
),
anchor:
_
scrollA
nchor
anchor:
_
a
nchor
);
}
...
...
@@ -199,7 +199,7 @@ class RenderViewportBase extends RenderBox implements HasMainAxis {
super
.
debugFillDescription
(
description
);
description
.
add
(
'paintOffset:
$paintOffset
'
);
description
.
add
(
'mainAxis:
$mainAxis
'
);
description
.
add
(
'
scrollAnchor:
$scrollA
nchor
'
);
description
.
add
(
'
anchor:
$a
nchor
'
);
if
(
overlayPainter
!=
null
)
description
.
add
(
'overlay painter:
$overlayPainter
'
);
}
...
...
@@ -219,10 +219,10 @@ class RenderViewport extends RenderViewportBase with RenderObjectWithChildMixin<
RenderBox
child
,
Offset
paintOffset:
Offset
.
zero
,
Axis
mainAxis:
Axis
.
vertical
,
ViewportAnchor
scrollA
nchor:
ViewportAnchor
.
start
,
ViewportAnchor
a
nchor:
ViewportAnchor
.
start
,
Painter
overlayPainter
,
this
.
onPaintOffsetUpdateNeeded
})
:
super
(
paintOffset
,
mainAxis
,
scrollA
nchor
,
overlayPainter
)
{
})
:
super
(
paintOffset
,
mainAxis
,
a
nchor
,
overlayPainter
)
{
this
.
child
=
child
;
}
...
...
@@ -339,11 +339,11 @@ abstract class RenderVirtualViewport<T extends ContainerBoxParentDataMixin<Rende
LayoutCallback
callback
,
Offset
paintOffset:
Offset
.
zero
,
Axis
mainAxis:
Axis
.
vertical
,
ViewportAnchor
scrollA
nchor:
ViewportAnchor
.
start
,
ViewportAnchor
a
nchor:
ViewportAnchor
.
start
,
Painter
overlayPainter
})
:
_virtualChildCount
=
virtualChildCount
,
_callback
=
callback
,
super
(
paintOffset
,
mainAxis
,
scrollA
nchor
,
overlayPainter
);
super
(
paintOffset
,
mainAxis
,
a
nchor
,
overlayPainter
);
int
get
virtualChildCount
=>
_virtualChildCount
;
int
_virtualChildCount
;
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
d78b78c4
...
...
@@ -833,7 +833,7 @@ class Viewport extends OneChildRenderObjectWidget {
Key
key
,
this
.
paintOffset
:
Offset
.
zero
,
this
.
mainAxis
:
Axis
.
vertical
,
this
.
scrollA
nchor
:
ViewportAnchor
.
start
,
this
.
a
nchor
:
ViewportAnchor
.
start
,
this
.
overlayPainter
,
this
.
onPaintOffsetUpdateNeeded
,
Widget
child
...
...
@@ -854,7 +854,7 @@ class Viewport extends OneChildRenderObjectWidget {
/// that direction (e.g., the child can be as tall as it wants).
final
Axis
mainAxis
;
final
ViewportAnchor
scrollA
nchor
;
final
ViewportAnchor
a
nchor
;
/// Paints an overlay over the viewport.
///
...
...
@@ -867,7 +867,7 @@ class Viewport extends OneChildRenderObjectWidget {
return
new
RenderViewport
(
paintOffset:
paintOffset
,
mainAxis:
mainAxis
,
scrollAnchor:
scrollA
nchor
,
anchor:
a
nchor
,
onPaintOffsetUpdateNeeded:
onPaintOffsetUpdateNeeded
,
overlayPainter:
overlayPainter
);
...
...
@@ -877,7 +877,7 @@ class Viewport extends OneChildRenderObjectWidget {
// Order dependency: RenderViewport validates scrollOffset based on mainAxis.
renderObject
..
mainAxis
=
mainAxis
..
scrollAnchor
=
scrollA
nchor
..
anchor
=
a
nchor
..
paintOffset
=
paintOffset
..
onPaintOffsetUpdateNeeded
=
onPaintOffsetUpdateNeeded
..
overlayPainter
=
overlayPainter
;
...
...
packages/flutter/lib/src/widgets/pageable_list.dart
View file @
d78b78c4
...
...
@@ -166,7 +166,7 @@ class PageableListState<T extends PageableList> extends ScrollableState<T> {
return
new
PageViewport
(
itemsWrap:
config
.
itemsWrap
,
mainAxis:
config
.
scrollDirection
,
scrollA
nchor:
config
.
scrollAnchor
,
a
nchor:
config
.
scrollAnchor
,
startOffset:
scrollOffset
,
overlayPainter:
config
.
scrollableListPainter
,
children:
config
.
children
...
...
@@ -227,7 +227,7 @@ class PageViewport extends VirtualViewportFromIterable {
PageViewport
({
this
.
startOffset
:
0.0
,
this
.
mainAxis
:
Axis
.
vertical
,
this
.
scrollA
nchor
:
ViewportAnchor
.
start
,
this
.
a
nchor
:
ViewportAnchor
.
start
,
this
.
itemsWrap
:
false
,
this
.
overlayPainter
,
this
.
children
...
...
@@ -237,7 +237,7 @@ class PageViewport extends VirtualViewportFromIterable {
final
double
startOffset
;
final
Axis
mainAxis
;
final
ViewportAnchor
scrollA
nchor
;
final
ViewportAnchor
a
nchor
;
final
bool
itemsWrap
;
final
Painter
overlayPainter
;
final
Iterable
<
Widget
>
children
;
...
...
@@ -326,7 +326,7 @@ class _PageViewportElement extends VirtualViewportElement {
_materializedChildCount
=
limitItem
-
startItem
;
_startOffsetBase
=
startItem
.
toDouble
();
_startOffsetLimit
=
(
limitItem
-
1
).
toDouble
();
if
(
widget
.
scrollA
nchor
==
ViewportAnchor
.
end
)
if
(
widget
.
a
nchor
==
ViewportAnchor
.
end
)
_materializedChildBase
=
(
length
-
_materializedChildBase
-
_materializedChildCount
)
%
length
;
}
...
...
packages/flutter/lib/src/widgets/scrollable.dart
View file @
d78b78c4
...
...
@@ -658,7 +658,7 @@ class _ScrollableViewportState extends ScrollableState<ScrollableViewport> {
return
new
Viewport
(
paintOffset:
scrollOffsetToPixelDelta
(
scrollOffset
),
mainAxis:
config
.
scrollDirection
,
scrollA
nchor:
config
.
scrollAnchor
,
a
nchor:
config
.
scrollAnchor
,
onPaintOffsetUpdateNeeded:
_handlePaintOffsetUpdateNeeded
,
child:
config
.
child
);
...
...
packages/flutter/lib/src/widgets/scrollable_list.dart
View file @
d78b78c4
...
...
@@ -79,7 +79,7 @@ class _ScrollableListState extends ScrollableState<ScrollableList> {
onExtentsChanged:
_handleExtentsChanged
,
scrollOffset:
scrollOffset
,
mainAxis:
config
.
scrollDirection
,
scrollA
nchor:
config
.
scrollAnchor
,
a
nchor:
config
.
scrollAnchor
,
itemExtent:
config
.
itemExtent
,
itemsWrap:
config
.
itemsWrap
,
padding:
config
.
padding
,
...
...
@@ -94,7 +94,7 @@ class _VirtualListViewport extends VirtualViewport {
this
.
onExtentsChanged
,
this
.
scrollOffset
,
this
.
mainAxis
,
this
.
scrollA
nchor
,
this
.
a
nchor
,
this
.
itemExtent
,
this
.
itemsWrap
,
this
.
padding
,
...
...
@@ -107,7 +107,7 @@ class _VirtualListViewport extends VirtualViewport {
final
ExtentsChangedCallback
onExtentsChanged
;
final
double
scrollOffset
;
final
Axis
mainAxis
;
final
ViewportAnchor
scrollA
nchor
;
final
ViewportAnchor
a
nchor
;
final
double
itemExtent
;
final
bool
itemsWrap
;
final
EdgeDims
padding
;
...
...
@@ -116,7 +116,7 @@ class _VirtualListViewport extends VirtualViewport {
double
get
_leadingPadding
{
switch
(
mainAxis
)
{
case
Axis
.
vertical
:
switch
(
scrollA
nchor
)
{
switch
(
a
nchor
)
{
case
ViewportAnchor
.
start
:
return
padding
.
top
;
case
ViewportAnchor
.
end
:
...
...
@@ -124,7 +124,7 @@ class _VirtualListViewport extends VirtualViewport {
}
break
;
case
Axis
.
horizontal
:
switch
(
scrollA
nchor
)
{
switch
(
a
nchor
)
{
case
ViewportAnchor
.
start
:
return
padding
.
left
;
case
ViewportAnchor
.
end
:
...
...
@@ -167,7 +167,7 @@ class _VirtualListViewportElement extends VirtualViewportElement {
void
updateRenderObject
(
_VirtualListViewport
oldWidget
)
{
renderObject
..
mainAxis
=
widget
.
mainAxis
..
scrollAnchor
=
widget
.
scrollA
nchor
..
anchor
=
widget
.
a
nchor
..
itemExtent
=
widget
.
itemExtent
..
padding
=
widget
.
padding
..
overlayPainter
=
widget
.
overlayPainter
;
...
...
@@ -217,7 +217,7 @@ class _VirtualListViewportElement extends VirtualViewportElement {
_startOffsetBase
=
startItem
*
itemExtent
;
_startOffsetLimit
=
limitItem
*
itemExtent
-
containerExtent
;
if
(
widget
.
scrollA
nchor
==
ViewportAnchor
.
end
)
if
(
widget
.
a
nchor
==
ViewportAnchor
.
end
)
_materializedChildBase
=
(
length
-
_materializedChildBase
-
_materializedChildCount
)
%
length
;
}
...
...
@@ -247,7 +247,7 @@ class ListViewport extends _VirtualListViewport with VirtualViewportFromIterable
ExtentsChangedCallback
onExtentsChanged
,
double
scrollOffset:
0.0
,
Axis
mainAxis:
Axis
.
vertical
,
ViewportAnchor
scrollA
nchor:
ViewportAnchor
.
start
,
ViewportAnchor
a
nchor:
ViewportAnchor
.
start
,
double
itemExtent
,
bool
itemsWrap:
false
,
EdgeDims
padding
,
...
...
@@ -257,7 +257,7 @@ class ListViewport extends _VirtualListViewport with VirtualViewportFromIterable
onExtentsChanged
,
scrollOffset
,
mainAxis
,
scrollA
nchor
,
a
nchor
,
itemExtent
,
itemsWrap
,
padding
,
...
...
@@ -342,7 +342,7 @@ class _ScrollableLazyListState extends ScrollableState<ScrollableLazyList> {
onExtentsChanged:
_handleExtentsChanged
,
scrollOffset:
scrollOffset
,
mainAxis:
config
.
scrollDirection
,
scrollA
nchor:
config
.
scrollAnchor
,
a
nchor:
config
.
scrollAnchor
,
itemExtent:
config
.
itemExtent
,
itemCount:
config
.
itemCount
,
itemBuilder:
config
.
itemBuilder
,
...
...
@@ -357,7 +357,7 @@ class LazyListViewport extends _VirtualListViewport with VirtualViewportFromBuil
ExtentsChangedCallback
onExtentsChanged
,
double
scrollOffset:
0.0
,
Axis
mainAxis:
Axis
.
vertical
,
ViewportAnchor
scrollA
nchor:
ViewportAnchor
.
start
,
ViewportAnchor
a
nchor:
ViewportAnchor
.
start
,
double
itemExtent
,
EdgeDims
padding
,
Painter
overlayPainter
,
...
...
@@ -367,7 +367,7 @@ class LazyListViewport extends _VirtualListViewport with VirtualViewportFromBuil
onExtentsChanged
,
scrollOffset
,
mainAxis
,
scrollA
nchor
,
a
nchor
,
itemExtent
,
false
,
// Don't support wrapping yet.
padding
,
...
...
packages/flutter/lib/src/widgets/virtual_viewport.dart
View file @
d78b78c4
...
...
@@ -51,7 +51,7 @@ abstract class VirtualViewportElement extends RenderObjectElement {
/// Returns the pixel offset for a scroll offset, accounting for the scroll
/// anchor.
double
scrollOffsetToPixelOffset
(
double
scrollOffset
)
{
switch
(
renderObject
.
scrollA
nchor
)
{
switch
(
renderObject
.
a
nchor
)
{
case
ViewportAnchor
.
start
:
return
-
scrollOffset
;
case
ViewportAnchor
.
end
:
...
...
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