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
e0515f31
Commit
e0515f31
authored
Oct 27, 2016
by
Ian Hickson
Committed by
GitHub
Oct 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweaks to the Flex documentation. (#6547)
parent
7acc9965
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+34
-7
parent_data_test.dart
packages/flutter/test/widget/parent_data_test.dart
+1
-1
No files found.
packages/flutter/lib/src/widgets/basic.dart
View file @
e0515f31
...
...
@@ -1879,15 +1879,30 @@ class GridPlacementData<DataType> extends ParentDataWidget<GridRenderObjectWidge
///
/// For details about the flex layout algorithm, see [RenderFlex]. To control
/// the flex of child widgets, see the [Flexible] widget.
///
/// The Flex widget allows you to control the axis along which the children
/// are placed (horizontal or vertical). If you know the axis in advance, then
/// consider using a [Row] (if it's horizontal) or [Column] (if it's vertical)
/// instead, since that will be less verbose.
///
/// The Flex widget does not scroll (and in general it is considered an error to
/// have more children in a Flex than will fit in the available room). If you
/// have some widgets and want them to be able to scroll if there is
/// insufficient room, consider using a [Block].
///
/// If you only have one child, then rather than using [Flex], [Row], or
/// [Column], consider using [Align] or [Center] to position the child.
class
Flex
extends
MultiChildRenderObjectWidget
{
/// Creates a flex layout.
///
/// The [direction] is required.
///
/// The [direction], [mainAxisAlignment], and [crossAxisAlignment] arguments
/// must not be null. If [crossAxisAlignment] is
/// [CrossAxisAlignment.baseline], then [textBaseline] must not be null.
Flex
({
Key
key
,
this
.
direction
:
Axis
.
horizontal
,
@required
this
.
direction
,
this
.
mainAxisAlignment
:
MainAxisAlignment
.
start
,
this
.
mainAxisSize
:
MainAxisSize
.
max
,
this
.
crossAxisAlignment
:
CrossAxisAlignment
.
center
,
...
...
@@ -1902,6 +1917,11 @@ class Flex extends MultiChildRenderObjectWidget {
}
/// The direction to use as the main axis.
///
/// If you know the axis in advance, then consider using a [Row] (if it's
/// horizontal) or [Column] (if it's vertical) instead of a [Flex], since that
/// will be less verbose. (For [Row] and [Column] this property is fixed to
/// the appropriate axis.)
final
Axis
direction
;
/// How the children should be placed along the main axis.
...
...
@@ -1958,6 +1978,9 @@ class Flex extends MultiChildRenderObjectWidget {
/// insufficient room, consider using a [Block].
///
/// For a vertical variant, see [Column].
///
/// If you only have one child, then consider using [Align] or [Center] to
/// position the child.
class
Row
extends
Flex
{
/// Creates a horizontal array of children.
///
...
...
@@ -1993,6 +2016,9 @@ class Row extends Flex {
/// insufficient room, consider using a [Block].
///
/// For a horizontal variant, see [Row].
///
/// If you only have one child, then consider using [Align] or [Center] to
/// position the child.
class
Column
extends
Flex
{
/// Creates a vertical array of children.
///
...
...
@@ -2017,14 +2043,15 @@ class Column extends Flex {
);
}
/// A widget that controls how a child of a [
Flex], [Row], or [Column
] flexes.
/// A widget that controls how a child of a [
Row], [Column], or [Flex
] flexes.
///
/// A [Flexible] widget must be a descendant of a [
Flex], [Row], or [Column
],
/// and the path from the [Flexible] widget to its enclosing [
Flex], [Row
], or
/// [
Column] must contain only [StatelessWidget]s or [StatefulWidget]s (not
///
other
kinds of widgets, like [RenderObjectWidget]s).
/// A [Flexible] widget must be a descendant of a [
Row], [Column], or [Flex
],
/// and the path from the [Flexible] widget to its enclosing [
Row], [Column
], or
/// [
Flex] must contain only [StatelessWidget]s or [StatefulWidget]s (not other
/// kinds of widgets, like [RenderObjectWidget]s).
class
Flexible
extends
ParentDataWidget
<
Flex
>
{
/// Creates a widget that controls how a child of a [Flex], [Row], or [Column] flexes.
/// Creates a widget that controls how a child of a [Row], [Column], or [Flex]
/// flexes.
Flexible
({
Key
key
,
this
.
flex
:
1
,
...
...
packages/flutter/test/widget/parent_data_test.dart
View file @
e0515f31
...
...
@@ -265,7 +265,7 @@ void main() {
await
tester
.
pumpWidget
(
new
Container
(
child:
new
Flex
(
child:
new
Row
(
children:
<
Widget
>[
new
Positioned
(
top:
6.0
,
...
...
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