Replace usage of FractionalOffset with Alignment (#12348)

Alignment will eventually replace FractionalOffset.
This commit is contained in:
Adam Barth
2017-10-02 00:06:24 -07:00
committed by GitHub
parent 2b126bcd0d
commit 0044ea2dbb
28 changed files with 62 additions and 62 deletions

View File

@@ -13,7 +13,7 @@ void main() {
// The root of our render tree is a RenderPositionedBox, which centers its
// child both vertically and horizontally.
root: new RenderPositionedBox(
alignment: FractionalOffset.center,
alignment: Alignment.center,
// We use a RenderParagraph to display the text 'Hello, world.' without
// any explicit styling.
child: new RenderParagraph(

View File

@@ -34,12 +34,12 @@ void main() {
// spin.
final RenderTransform spin = new RenderTransform(
transform: new Matrix4.identity(),
alignment: FractionalOffset.center,
alignment: Alignment.center,
child: square
);
// Finally, we center the spinning green square...
final RenderBox root = new RenderPositionedBox(
alignment: FractionalOffset.center,
alignment: Alignment.center,
child: spin
);
// and attach it to the window.

View File

@@ -100,7 +100,7 @@ void main() {
flexRoot.add(proxy);
addFlexChildSolidColor(flexRoot, const Color(0xFF0000FF), flex: 1);
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity(), alignment: FractionalOffset.center);
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity(), alignment: Alignment.center);
final RenderPadding root = new RenderPadding(padding: const EdgeInsets.all(80.0), child: transformBox);
binding.renderView.child = root;