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
ba520e70
Commit
ba520e70
authored
Jun 23, 2017
by
Ian Hickson
Committed by
GitHub
Jun 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some clarifications for ListView constructors (#10907)
parent
9a6a3e1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
scroll_view.dart
packages/flutter/lib/src/widgets/scroll_view.dart
+16
-6
No files found.
packages/flutter/lib/src/widgets/scroll_view.dart
View file @
ba520e70
...
...
@@ -438,6 +438,9 @@ class ListView extends BoxScrollView {
/// children because constructing the [List] requires doing work for every
/// child that could possibly be displayed in the list view instead of just
/// those children that are actually visible.
///
/// It is usually more efficient to create children on demand using [new
/// ListView.builder].
ListView
({
Key
key
,
Axis
scrollDirection:
Axis
.
vertical
,
...
...
@@ -466,11 +469,18 @@ class ListView extends BoxScrollView {
/// number of children because the builder is called only for those children
/// that are actually visible.
///
/// Providing a non-null
[itemCount]
improves the ability of the [ListView] to
/// Providing a non-null
`itemCount`
improves the ability of the [ListView] to
/// estimate the maximum scroll extent.
///
/// [itemBuilder] will be called only with indices greater than or equal to
/// zero and less than [itemCount].
/// The `itemBuilder` callback will be called only with indices greater than
/// or equal to zero and less than `itemCount`.
///
/// The `itemBuilder` should actually create the widget instances when called.
/// Avoid using a builder that returns a previously-constructed widget; if the
/// list view's children are created in advance, or all at once when the
/// [ListView] itself is created, it is more efficient to use [new ListView].
/// Even more efficient, however, is to create the instances on demand using
/// this constructor's `itemBuilder` callback.
ListView
.
builder
({
Key
key
,
Axis
scrollDirection:
Axis
.
vertical
,
...
...
@@ -623,11 +633,11 @@ class GridView extends BoxScrollView {
/// number of children because the builder is called only for those children
/// that are actually visible.
///
/// Providing a non-null
[itemCount]
improves the ability of the [GridView] to
/// Providing a non-null
`itemCount`
improves the ability of the [GridView] to
/// estimate the maximum scroll extent.
///
///
[itemBuilder]
will be called only with indices greater than or equal to
/// zero and less than
[itemCount]
.
///
`itemBuilder`
will be called only with indices greater than or equal to
/// zero and less than
`itemCount`
.
///
/// The [gridDelegate] argument must not be null.
GridView
.
builder
({
...
...
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