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
995fd27e
Commit
995fd27e
authored
Oct 24, 2016
by
Ian Hickson
Committed by
GitHub
Oct 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More Block doc improvements (#6481)
Mostly around pointing people towards Block more aggressively.
parent
a9790222
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
14 deletions
+34
-14
list.dart
packages/flutter/lib/src/material/list.dart
+7
-3
two_level_list.dart
packages/flutter/lib/src/material/two_level_list.dart
+1
-0
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+10
-1
lazy_block.dart
packages/flutter/lib/src/widgets/lazy_block.dart
+5
-1
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+6
-6
scrollable_list.dart
packages/flutter/lib/src/widgets/scrollable_list.dart
+5
-3
No files found.
packages/flutter/lib/src/material/list.dart
View file @
995fd27e
...
@@ -48,9 +48,13 @@ Map<MaterialListType, double> kListItemExtent = const <MaterialListType, double>
...
@@ -48,9 +48,13 @@ Map<MaterialListType, double> kListItemExtent = const <MaterialListType, double>
///
///
/// See also:
/// See also:
///
///
/// * [ListItem]
/// * [Block], which shows heterogeneous widgets in a list and makes the list
/// * [ScrollableList]
/// scrollable if necessary.
/// * [TwoLevelList]
/// * [ListItem], to show content in a [MaterialList] using material design
/// conventions.
/// * [ScrollableList], on which this widget is based.
/// * [TwoLevelList], for lists that have subsections that can collapse and
/// expand.
/// * [ScrollableGrid]
/// * [ScrollableGrid]
/// * <https://material.google.com/components/lists.html>
/// * <https://material.google.com/components/lists.html>
class
MaterialList
extends
StatelessWidget
{
class
MaterialList
extends
StatelessWidget
{
...
...
packages/flutter/lib/src/material/two_level_list.dart
View file @
995fd27e
...
@@ -255,6 +255,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> with SingleTickerProv
...
@@ -255,6 +255,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> with SingleTickerProv
///
///
/// * [TwoLevelSublist]
/// * [TwoLevelSublist]
/// * [TwoLevelListItem]
/// * [TwoLevelListItem]
/// * [MaterialList], for lists that only have one level.
class
TwoLevelList
extends
StatelessWidget
{
class
TwoLevelList
extends
StatelessWidget
{
/// Creates a scrollable list of items that can expand and collapse.
/// Creates a scrollable list of items that can expand and collapse.
///
///
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
995fd27e
...
@@ -1406,7 +1406,7 @@ class Viewport extends SingleChildRenderObjectWidget {
...
@@ -1406,7 +1406,7 @@ class Viewport extends SingleChildRenderObjectWidget {
///
///
/// See also:
/// See also:
///
///
/// * [Block]
(which combines block layout with scrolling)
/// * [Block]
, which combines block layout with scrolling.
class
BlockBody
extends
MultiChildRenderObjectWidget
{
class
BlockBody
extends
MultiChildRenderObjectWidget
{
/// Creates a block layout widget.
/// Creates a block layout widget.
///
///
...
@@ -1951,6 +1951,13 @@ class Flex extends MultiChildRenderObjectWidget {
...
@@ -1951,6 +1951,13 @@ class Flex extends MultiChildRenderObjectWidget {
///
///
/// For details about the flex layout algorithm, see [RenderFlex]. To control
/// For details about the flex layout algorithm, see [RenderFlex]. To control
/// the flex of child widgets, see the [Flexible] widget.
/// the flex of child widgets, see the [Flexible] widget.
///
/// The Row widget does not scroll (and in general it is considered an error to
/// have more children in a Row than will fit in the available room). If you
/// have a line of widgets and want them to be able to scroll if there is
/// insufficient room, consider using a [Block].
///
/// For a vertical variant, see [Column].
class
Row
extends
Flex
{
class
Row
extends
Flex
{
/// Creates a horizontal array of children.
/// Creates a horizontal array of children.
///
///
...
@@ -1984,6 +1991,8 @@ class Row extends Flex {
...
@@ -1984,6 +1991,8 @@ class Row extends Flex {
/// to have more children in a Column than will fit in the available room). If
/// to have more children in a Column than will fit in the available room). If
/// you have a list of widgets and want them to be able to scroll if there is
/// you have a list of widgets and want them to be able to scroll if there is
/// insufficient room, consider using a [Block].
/// insufficient room, consider using a [Block].
///
/// For a horizontal variant, see [Row].
class
Column
extends
Flex
{
class
Column
extends
Flex
{
/// Creates a vertical array of children.
/// Creates a vertical array of children.
///
///
...
...
packages/flutter/lib/src/widgets/lazy_block.dart
View file @
995fd27e
...
@@ -191,9 +191,13 @@ class LazyBlockChildren extends LazyBlockDelegate {
...
@@ -191,9 +191,13 @@ class LazyBlockChildren extends LazyBlockDelegate {
/// [scrollOffset] is expensive because [LazyBlock] computes the size of every
/// [scrollOffset] is expensive because [LazyBlock] computes the size of every
/// child between the old scroll offset and the new scroll offset.
/// child between the old scroll offset and the new scroll offset.
///
///
/// Prefer [ScrollableList] when all the children have the same size because
/// Prefer [ScrollableL
azyL
ist] when all the children have the same size because
/// it can use that property to be more efficient. Prefer [ScrollableViewport]
/// it can use that property to be more efficient. Prefer [ScrollableViewport]
/// when there is only one child.
/// when there is only one child.
///
/// Consider [Block] if you have a small number of children that will only
/// scroll in unusual circumstances (e.g. when the user's device is smaller than
/// expected).
class
LazyBlock
extends
StatelessWidget
{
class
LazyBlock
extends
StatelessWidget
{
/// Creates an infinite scrolling list of variable height children.
/// Creates an infinite scrolling list of variable height children.
///
///
...
...
packages/flutter/lib/src/widgets/scrollable.dart
View file @
995fd27e
...
@@ -61,14 +61,14 @@ typedef double SnapOffsetCallback(double scrollOffset, Size containerSize);
...
@@ -61,14 +61,14 @@ typedef double SnapOffsetCallback(double scrollOffset, Size containerSize);
/// A base class for scrollable widgets.
/// A base class for scrollable widgets.
///
///
/// If you have a list of widgets and want them to be able to scroll if there is
/// insufficient room, consider using [Block].
///
/// Commonly used classes that are based on Scrollable include [ScrollableList],
/// Commonly used classes that are based on Scrollable include [ScrollableList],
/// [ScrollableGrid], and [ScrollableViewport].
/// [ScrollableGrid], and [ScrollableViewport].
///
///
/// Widgets that subclass [Scrollable] typically use state objects that subclass
/// Widgets that subclass [Scrollable] typically use state objects that subclass
/// [ScrollableState].
/// [ScrollableState].
///
/// If you have a list of widgets and want them to be able to scroll if there is
/// insufficient room, consider using [Block].
class
Scrollable
extends
StatefulWidget
{
class
Scrollable
extends
StatefulWidget
{
/// Initializes fields for subclasses.
/// Initializes fields for subclasses.
///
///
...
@@ -916,11 +916,11 @@ class ScrollNotification extends Notification {
...
@@ -916,11 +916,11 @@ class ScrollNotification extends Notification {
///
///
/// See also:
/// See also:
///
///
/// * [Block], if your single child is a [Column].
/// * [ScrollableList], if you have many identically-sized children.
/// * [ScrollableList], if you have many identically-sized children.
/// * [PageableList], if you have children that each take the entire screen.
/// * [PageableList], if you have children that each take the entire screen.
/// * [ScrollableGrid], if your children are in a grid pattern.
/// * [ScrollableGrid], if your children are in a grid pattern.
/// * [LazyBlock], if you have many children of varying sizes.
/// * [LazyBlock], if you have many children of varying sizes.
/// * [Block], if your single child is a [BlockBody] or a [Column].
class
ScrollableViewport
extends
StatelessWidget
{
class
ScrollableViewport
extends
StatelessWidget
{
/// Creates a simple scrolling widget that has a single child.
/// Creates a simple scrolling widget that has a single child.
///
///
...
@@ -1050,9 +1050,9 @@ class ScrollableViewport extends StatelessWidget {
...
@@ -1050,9 +1050,9 @@ class ScrollableViewport extends StatelessWidget {
///
///
/// See also:
/// See also:
///
///
/// * [
ScrollableViewport], if you only have one child
.
/// * [
LazyBlock], if you have many children with varying heights
.
/// * [ScrollableList], if all your children are the same height.
/// * [ScrollableList], if all your children are the same height.
/// * [
LazyBlock], if you have children with varying heights
.
/// * [
ScrollableViewport], if you only have one child
.
class
Block
extends
StatelessWidget
{
class
Block
extends
StatelessWidget
{
/// Creates a scrollable array of children.
/// Creates a scrollable array of children.
Block
({
Block
({
...
...
packages/flutter/lib/src/widgets/scrollable_list.dart
View file @
995fd27e
...
@@ -18,14 +18,16 @@ import 'virtual_viewport.dart';
...
@@ -18,14 +18,16 @@ import 'virtual_viewport.dart';
/// uses an [Iterable] list of children. That makes [ScrollableList] suitable
/// uses an [Iterable] list of children. That makes [ScrollableList] suitable
/// for a large (but not extremely large or infinite) list of children.
/// for a large (but not extremely large or infinite) list of children.
///
///
/// [ScrollableList] differs from [LazyBlock] in that [ScrollableList] requires
/// [ScrollableList] differs from [Block] and [LazyBlock] in that
/// each of its children to be the same size. That makes [ScrollableList] more
/// [ScrollableList] requires each of its children to be the same size. That
/// efficient but less flexible than [LazyBlock].
/// makes [ScrollableList] more efficient but less flexible than [Block] and
/// [LazyBlock].
///
///
/// Prefer [ScrollableViewport] when there is only one child.
/// Prefer [ScrollableViewport] when there is only one child.
///
///
/// See also:
/// See also:
///
///
/// * [Block].
/// * [ScrollableLazyList].
/// * [ScrollableLazyList].
/// * [LazyBlock].
/// * [LazyBlock].
/// * [ScrollableViewport].
/// * [ScrollableViewport].
...
...
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