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
605a636e
Commit
605a636e
authored
Oct 21, 2016
by
Hans Muller
Committed by
GitHub
Oct 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Pageable itemCount public (#6438)
parent
e3fb94f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
pageable_list.dart
packages/flutter/lib/src/widgets/pageable_list.dart
+11
-11
No files found.
packages/flutter/lib/src/widgets/pageable_list.dart
View file @
605a636e
...
...
@@ -89,7 +89,8 @@ abstract class Pageable extends Scrollable {
/// The animation curve to use when animating to a given page.
final
Curve
curve
;
int
get
_itemCount
;
/// The number of items, one per page, to display.
int
get
itemCount
;
}
/// A widget that pages through an iterable list of children.
...
...
@@ -142,7 +143,7 @@ class PageableList extends Pageable {
final
Iterable
<
Widget
>
children
;
@override
int
get
_
itemCount
=>
children
?.
length
??
0
;
int
get
itemCount
=>
children
?.
length
??
0
;
@override
PageableListState
<
PageableList
>
createState
()
=>
new
PageableListState
<
PageableList
>();
...
...
@@ -175,7 +176,7 @@ class PageableLazyList extends Pageable {
ValueChanged
<
int
>
onPageChanged
,
Duration
duration:
const
Duration
(
milliseconds:
200
),
Curve
curve:
Curves
.
ease
,
this
.
itemCount
,
this
.
itemCount
:
0
,
this
.
itemBuilder
})
:
super
(
key:
key
,
...
...
@@ -194,14 +195,12 @@ class PageableLazyList extends Pageable {
);
/// The total number of list items.
@override
final
int
itemCount
;
/// A function that returns the pages themselves.
final
ItemListBuilder
itemBuilder
;
@override
int
get
_itemCount
=>
itemCount
??
0
;
@override
_PageableLazyListState
createState
()
=>
new
_PageableLazyListState
();
}
...
...
@@ -212,10 +211,11 @@ class PageableLazyList extends Pageable {
///
/// Subclasses typically override [buildContent] to build viewports.
abstract
class
PageableState
<
T
extends
Pageable
>
extends
ScrollableState
<
T
>
{
int
get
_itemCount
=>
config
.
_
itemCount
;
int
get
_itemCount
=>
config
.
itemCount
;
int
_previousItemCount
;
double
get
_pixelsPerScrollUnit
{
/// Convert from the item based scroll units to logical pixels.
double
get
pixelsPerScrollUnit
{
final
RenderBox
box
=
context
.
findRenderObject
();
if
(
box
==
null
||
!
box
.
hasSize
)
return
0.0
;
...
...
@@ -231,13 +231,13 @@ abstract class PageableState<T extends Pageable> extends ScrollableState<T> {
@override
double
pixelOffsetToScrollOffset
(
double
pixelOffset
)
{
final
double
pixelsPerScrollUnit
=
_
pixelsPerScrollUnit
;
return
super
.
pixelOffsetToScrollOffset
(
pixelsPerScrollUnit
==
0.0
?
0.0
:
pixelOffset
/
pixelsPerScrollU
nit
);
final
double
unit
=
pixelsPerScrollUnit
;
return
super
.
pixelOffsetToScrollOffset
(
unit
==
0.0
?
0.0
:
pixelOffset
/
u
nit
);
}
@override
double
scrollOffsetToPixelOffset
(
double
scrollOffset
)
{
return
super
.
scrollOffsetToPixelOffset
(
scrollOffset
*
_
pixelsPerScrollUnit
);
return
super
.
scrollOffsetToPixelOffset
(
scrollOffset
*
pixelsPerScrollUnit
);
}
int
_scrollOffsetToPageIndex
(
double
scrollOffset
)
{
...
...
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