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
0cbd190b
Commit
0cbd190b
authored
Aug 25, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #832 from Hixie/positioner
Introduce Align widget for aligning children.
parents
7f0f22ab
4a2fb5d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
basic.dart
packages/flutter/lib/widgets/basic.dart
+16
-4
No files found.
packages/flutter/lib/widgets/basic.dart
View file @
0cbd190b
...
...
@@ -183,14 +183,26 @@ class Padding extends OneChildRenderObjectWrapper {
}
}
class
Center
extends
OneChildRenderObjectWrapper
{
Center
({
Key
key
,
Widget
child
})
class
Align
extends
OneChildRenderObjectWrapper
{
Align
({
Key
key
,
this
.
horizontal
:
0.5
,
this
.
vertical
:
0.5
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
RenderPositionedBox
createNode
()
=>
new
RenderPositionedBox
();
final
double
horizontal
;
final
double
vertical
;
RenderPositionedBox
createNode
()
=>
new
RenderPositionedBox
(
horizontal:
horizontal
,
vertical:
vertical
);
RenderPositionedBox
get
renderObject
=>
super
.
renderObject
;
// Nothing to sync, so we don't implement syncRenderObject()
void
syncRenderObject
(
SizedBox
old
)
{
super
.
syncRenderObject
(
old
);
renderObject
.
horizontal
=
horizontal
;
renderObject
.
vertical
=
vertical
;
}
}
class
Center
extends
Align
{
Center
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
}
class
SizedBox
extends
OneChildRenderObjectWrapper
{
...
...
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