Replace usage of FractionalOffset with Alignment (#12348)
Alignment will eventually replace FractionalOffset.
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user