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
3437b770
Commit
3437b770
authored
Aug 30, 2017
by
Adam Barth
Committed by
GitHub
Aug 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for RTL to Wrap (#11809)
Fixes #11389
parent
d3415137
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
579 additions
and
23 deletions
+579
-23
flex.dart
packages/flutter/lib/src/rendering/flex.dart
+2
-2
wrap.dart
packages/flutter/lib/src/rendering/wrap.dart
+183
-12
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+81
-4
wrap_test.dart
packages/flutter/test/widgets/wrap_test.dart
+313
-5
No files found.
packages/flutter/lib/src/rendering/flex.dart
View file @
3437b770
...
...
@@ -359,8 +359,8 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
/// Determines the order to lay children out horizontally and how to interpret
/// `start` and `end` in the horizontal direction.
///
/// If the [direction] is [Axis.horizontal], this controls
which order
/// children are p
ainted in
(left-to-right or right-to-left), and the meaning
/// If the [direction] is [Axis.horizontal], this controls
the order in which
/// children are p
ositioned
(left-to-right or right-to-left), and the meaning
/// of the [mainAxisAlignment] property's [MainAxisAlignment.start] and
/// [MainAxisAlignment.end] values.
///
...
...
packages/flutter/lib/src/rendering/wrap.dart
View file @
3437b770
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/basic.dart
View file @
3437b770
...
...
@@ -2740,9 +2740,9 @@ class Flex extends MultiChildRenderObjectWidget {
///
/// Defaults to the ambient [Directionality].
///
/// If the [direction] is [Axis.horizontal], this controls
which order
///
children are painted in (left-to-right or right-to-left), and the meaning
/// of the [mainAxisAlignment] property's [MainAxisAlignment.start] and
/// If the [direction] is [Axis.horizontal], this controls
the order in which
///
the children are positioned (left-to-right or right-to-left), and the
///
meaning
of the [mainAxisAlignment] property's [MainAxisAlignment.start] and
/// [MainAxisAlignment.end] values.
///
/// If the [direction] is [Axis.horizontal], and either the
...
...
@@ -3321,6 +3321,12 @@ class Wrap extends MultiChildRenderObjectWidget {
///
/// By default, the wrap layout is horizontal and both the children and the
/// runs are aligned to the start.
///
/// The [textDirection] argument defaults to the ambient [Directionality], if
/// any. If there is no ambient directionality, and a text direction is going
/// to be necessary to decide which direction to lay the children in or to
/// disambiguate `start` or `end` values for the main or cross axis
/// directions, the [textDirection] must not be null.
Wrap
({
Key
key
,
this
.
direction
:
Axis
.
horizontal
,
...
...
@@ -3329,6 +3335,8 @@ class Wrap extends MultiChildRenderObjectWidget {
this
.
runAlignment
:
WrapAlignment
.
start
,
this
.
runSpacing
:
0.0
,
this
.
crossAxisAlignment
:
WrapCrossAlignment
.
start
,
this
.
textDirection
,
this
.
verticalDirection
:
VerticalDirection
.
down
,
List
<
Widget
>
children:
const
<
Widget
>[],
})
:
super
(
key:
key
,
children:
children
);
...
...
@@ -3412,6 +3420,58 @@ class Wrap extends MultiChildRenderObjectWidget {
/// other in the cross axis.
final
WrapCrossAlignment
crossAxisAlignment
;
/// Determines the order to lay children out horizontally and how to interpret
/// `start` and `end` in the horizontal direction.
///
/// Defaults to the ambient [Directionality].
///
/// If the [direction] is [Axis.horizontal], this controls order in which the
/// children are positioned (left-to-right or right-to-left), and the meaning
/// of the [alignment] property's [WrapAlignment.start] and
/// [WrapAlignment.end] values.
///
/// If the [direction] is [Axis.horizontal], and either the
/// [alignment] is either [WrapAlignment.start] or [WrapAlignment.end], or
/// there's more than one child, then the [textDirection] (or the ambient
/// [Directionality]) must not be null.
///
/// If the [direction] is [Axis.vertical], this controls the order in which
/// runs are positioned, the meaning of the [runAlignment] property's
/// [WrapAlignment.start] and [WrapAlignment.end] values, as well as the
/// [crossAxisAlignment] property's [WrapCrossAlignment.start] and
/// [WrapCrossAlignment.end] values.
///
/// If the [direction] is [Axis.vertical], and either the
/// [runAlignment] is either [WrapAlignment.start] or [WrapAlignment.end], the
/// [crossAxisAlignment] is either [WrapCrossAlignment.start] or
/// [WrapCrossAlignment.end], or there's more than one child, then the
/// [textDirection] (or the ambient [Directionality]) must not be null.
final
TextDirection
textDirection
;
/// Determines the order to lay children out vertically and how to interpret
/// `start` and `end` in the vertical direction.
///
/// If the [direction] is [Axis.vertical], this controls which order children
/// are painted in (down or up), the meaning of the [alignment] property's
/// [WrapAlignment.start] and [WrapAlignment.end] values.
///
/// If the [direction] is [Axis.vertical], and either the [alignment]
/// is either [WrapAlignment.start] or [WrapAlignment.end], or there's
/// more than one child, then the [verticalDirection] must not be null.
///
/// If the [direction] is [Axis.horizontal], this controls the order in which
/// runs are positioned, the meaning of the [runAlignment] property's
/// [WrapAlignment.start] and [WrapAlignment.end] values, as well as the
/// [crossAxisAlignment] property's [WrapCrossAlignment.start] and
/// [WrapCrossAlignment.end] values.
///
/// If the [direction] is [Axis.horizontal], and either the
/// [runAlignment] is either [WrapAlignment.start] or [WrapAlignment.end], the
/// [crossAxisAlignment] is either [WrapCrossAlignment.start] or
/// [WrapCrossAlignment.end], or there's more than one child, then the
/// [verticalDirection] must not be null.
final
VerticalDirection
verticalDirection
;
@override
RenderWrap
createRenderObject
(
BuildContext
context
)
{
return
new
RenderWrap
(
...
...
@@ -3421,6 +3481,8 @@ class Wrap extends MultiChildRenderObjectWidget {
runAlignment:
runAlignment
,
runSpacing:
runSpacing
,
crossAxisAlignment:
crossAxisAlignment
,
textDirection:
textDirection
??
Directionality
.
of
(
context
),
verticalDirection:
verticalDirection
,
);
}
...
...
@@ -3432,7 +3494,22 @@ class Wrap extends MultiChildRenderObjectWidget {
..
spacing
=
spacing
..
runAlignment
=
runAlignment
..
runSpacing
=
runSpacing
..
crossAxisAlignment
=
crossAxisAlignment
;
..
crossAxisAlignment
=
crossAxisAlignment
..
textDirection
=
textDirection
??
Directionality
.
of
(
context
)
..
verticalDirection
=
verticalDirection
;
}
@override
void
debugFillProperties
(
DiagnosticPropertiesBuilder
description
)
{
super
.
debugFillProperties
(
description
);
description
.
add
(
new
EnumProperty
<
Axis
>(
'direction'
,
direction
));
description
.
add
(
new
EnumProperty
<
WrapAlignment
>(
'alignment'
,
alignment
));
description
.
add
(
new
DoubleProperty
(
'spacing'
,
spacing
));
description
.
add
(
new
EnumProperty
<
WrapAlignment
>(
'runAlignment'
,
runAlignment
));
description
.
add
(
new
DoubleProperty
(
'runSpacing'
,
runSpacing
));
description
.
add
(
new
DoubleProperty
(
'crossAxisAlignment'
,
runSpacing
));
description
.
add
(
new
EnumProperty
<
TextDirection
>(
'textDirection'
,
textDirection
,
defaultValue:
null
));
description
.
add
(
new
EnumProperty
<
VerticalDirection
>(
'verticalDirection'
,
verticalDirection
,
defaultValue:
VerticalDirection
.
down
));
}
}
...
...
packages/flutter/test/widgets/wrap_test.dart
View file @
3437b770
This diff is collapsed.
Click to expand it.
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