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
8ac14f86
Commit
8ac14f86
authored
Sep 15, 2016
by
Dragoș Tiselice
Committed by
GitHub
Sep 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced FlexDirection with Axis. (#5896)
Fixes #4618.
parent
4259266b
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
60 deletions
+52
-60
flex_layout.dart
examples/layers/rendering/flex_layout.dart
+2
-2
spinning_mixed.dart
examples/layers/widgets/spinning_mixed.dart
+1
-1
flex.dart
packages/flutter/lib/src/rendering/flex.dart
+37
-45
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+5
-5
box_test.dart
packages/flutter/test/rendering/box_test.dart
+1
-1
flex_test.dart
packages/flutter/test/rendering/flex_test.dart
+6
-6
No files found.
examples/layers/rendering/flex_layout.dart
View file @
8ac14f86
...
...
@@ -10,7 +10,7 @@ import 'package:flutter/rendering.dart';
import
'src/solid_color_box.dart'
;
void
main
(
)
{
RenderFlex
table
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
);
RenderFlex
table
=
new
RenderFlex
(
direction:
Axis
.
vertical
);
void
addAlignmentRow
(
CrossAxisAlignment
crossAxisAlignment
)
{
TextStyle
style
=
const
TextStyle
(
color:
const
Color
(
0xFF000000
));
...
...
@@ -50,7 +50,7 @@ void main() {
const
TextStyle
style
=
const
TextStyle
(
color:
const
Color
(
0xFF000000
));
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
TextSpan
(
style:
style
,
text:
'
$justify
'
));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
EdgeInsets
.
only
(
top:
20.0
)));
RenderFlex
row
=
new
RenderFlex
(
direction:
FlexDirection
.
horizontal
);
RenderFlex
row
=
new
RenderFlex
(
direction:
Axis
.
horizontal
);
row
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0xFFFFCCCC
),
desiredSize:
new
Size
(
80.0
,
60.0
)));
row
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0xFFCCFFCC
),
desiredSize:
new
Size
(
64.0
,
60.0
)));
row
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0xFFCCCCFF
),
desiredSize:
new
Size
(
160.0
,
60.0
)));
...
...
examples/layers/widgets/spinning_mixed.dart
View file @
8ac14f86
...
...
@@ -93,7 +93,7 @@ void main() {
RenderProxyBox
proxy
=
new
RenderProxyBox
();
attachWidgetTreeToRenderTree
(
proxy
);
RenderFlex
flexRoot
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
);
RenderFlex
flexRoot
=
new
RenderFlex
(
direction:
Axis
.
vertical
);
addFlexChildSolidColor
(
flexRoot
,
const
Color
(
0xFFFF00FF
),
flex:
1
);
flexRoot
.
add
(
proxy
);
addFlexChildSolidColor
(
flexRoot
,
const
Color
(
0xFF0000FF
),
flex:
1
);
...
...
packages/flutter/lib/src/rendering/flex.dart
View file @
8ac14f86
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/basic.dart
View file @
8ac14f86
...
...
@@ -20,7 +20,7 @@ export 'package:flutter/rendering.dart' show
CustomClipper
,
CustomPainter
,
FixedColumnCountGridDelegate
,
FlexDirection
,
Axis
,
FlowDelegate
,
FlowPaintingContext
,
FractionalOffsetTween
,
...
...
@@ -1823,7 +1823,7 @@ class Flex extends MultiChildRenderObjectWidget {
/// [CrossAxisAlignment.baseline], then [textBaseline] must not be null.
Flex
({
Key
key
,
this
.
direction
:
FlexDirection
.
horizontal
,
this
.
direction
:
Axis
.
horizontal
,
this
.
mainAxisAlignment
:
MainAxisAlignment
.
start
,
this
.
mainAxisSize
:
MainAxisSize
.
max
,
this
.
crossAxisAlignment
:
CrossAxisAlignment
.
center
,
...
...
@@ -1838,7 +1838,7 @@ class Flex extends MultiChildRenderObjectWidget {
}
/// The direction to use as the main axis.
final
FlexDirection
direction
;
final
Axis
direction
;
/// How the children should be placed along the main axis.
final
MainAxisAlignment
mainAxisAlignment
;
...
...
@@ -1902,7 +1902,7 @@ class Row extends Flex {
})
:
super
(
children:
children
,
key:
key
,
direction:
FlexDirection
.
horizontal
,
direction:
Axis
.
horizontal
,
mainAxisAlignment:
mainAxisAlignment
,
mainAxisSize:
mainAxisSize
,
crossAxisAlignment:
crossAxisAlignment
,
...
...
@@ -1930,7 +1930,7 @@ class Column extends Flex {
})
:
super
(
children:
children
,
key:
key
,
direction:
FlexDirection
.
vertical
,
direction:
Axis
.
vertical
,
mainAxisAlignment:
mainAxisAlignment
,
mainAxisSize:
mainAxisSize
,
crossAxisAlignment:
crossAxisAlignment
,
...
...
packages/flutter/test/rendering/box_test.dart
View file @
8ac14f86
...
...
@@ -39,7 +39,7 @@ void main() {
);
RenderBox
flex
=
new
RenderFlex
(
children:
<
RenderBox
>[
padding
],
direction:
FlexDirection
.
vertical
,
direction:
Axis
.
vertical
,
crossAxisAlignment:
CrossAxisAlignment
.
stretch
);
RenderBox
outer
=
new
RenderDecoratedBox
(
...
...
packages/flutter/test/rendering/flex_test.dart
View file @
8ac14f86
...
...
@@ -24,7 +24,7 @@ void main() {
additionalConstraints:
const
BoxConstraints
.
expand
()
);
RenderFlex
flex
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
,
direction:
Axis
.
vertical
,
children:
<
RenderBox
>[
new
RenderConstrainedBox
(
additionalConstraints:
new
BoxConstraints
.
tightFor
(
height:
200.0
)),
flexible
,
...
...
@@ -46,7 +46,7 @@ void main() {
additionalConstraints:
const
BoxConstraints
.
expand
()
);
RenderFlex
flex
=
new
RenderFlex
(
direction:
FlexDirection
.
horizontal
,
direction:
Axis
.
horizontal
,
children:
<
RenderBox
>[
new
RenderConstrainedBox
(
additionalConstraints:
new
BoxConstraints
.
tightFor
(
width:
200.0
)),
flexible
,
...
...
@@ -65,7 +65,7 @@ void main() {
test
(
'Vertical Flipped Constraints'
,
()
{
RenderFlex
flex
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
,
direction:
Axis
.
vertical
,
children:
<
RenderBox
>[
new
RenderAspectRatio
(
aspectRatio:
1.0
),
]
...
...
@@ -81,7 +81,7 @@ void main() {
test
(
'Defaults'
,
()
{
RenderFlex
flex
=
new
RenderFlex
();
expect
(
flex
.
crossAxisAlignment
,
equals
(
CrossAxisAlignment
.
center
));
expect
(
flex
.
direction
,
equals
(
FlexDirection
.
horizontal
));
expect
(
flex
.
direction
,
equals
(
Axis
.
horizontal
));
});
test
(
'Parent data'
,
()
{
...
...
@@ -129,7 +129,7 @@ void main() {
expect
(
box2
.
size
.
width
,
equals
(
100.0
));
expect
(
box2
.
size
.
height
,
equals
(
100.0
));
flex
.
direction
=
FlexDirection
.
vertical
;
flex
.
direction
=
Axis
.
vertical
;
pumpFrame
();
expect
(
box1
.
size
.
width
,
equals
(
100.0
));
expect
(
box1
.
size
.
height
,
equals
(
0.0
));
...
...
@@ -157,7 +157,7 @@ void main() {
expect
(
getOffset
(
box3
).
dx
,
equals
(
350.0
));
expect
(
box3
.
size
.
width
,
equals
(
100.0
));
flex
.
direction
=
FlexDirection
.
vertical
;
flex
.
direction
=
Axis
.
vertical
;
pumpFrame
();
expect
(
getOffset
(
box1
).
dy
,
equals
(
25.0
));
expect
(
box1
.
size
.
height
,
equals
(
100.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