Files
engine/examples/rendering/transform.dart
T

29 lines
796 B
Dart
Raw Normal View History

2015-06-03 10:20:33 -07:00
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:sky' as sky;
2015-08-18 21:39:51 -07:00
import 'package:sky/rendering.dart';
2015-06-03 10:20:33 -07:00
void main() {
RenderDecoratedBox green = new RenderDecoratedBox(
2015-06-15 15:51:56 -07:00
decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00))
);
RenderConstrainedBox box = new RenderConstrainedBox(
additionalConstraints: new BoxConstraints.tight(const sky.Size(200.0, 200.0)),
2015-06-15 15:51:56 -07:00
child: green
);
2015-06-03 10:20:33 -07:00
Matrix4 transform = new Matrix4.identity();
RenderTransform spin = new RenderTransform(
transform: transform,
child: box
);
2015-06-03 10:20:33 -07:00
spin.rotateZ(1.0);
RenderFlex flex = new RenderFlex();
flex.add(spin);
2015-09-26 12:37:27 -07:00
new FlutterBinding(root: flex);
2015-06-03 10:20:33 -07:00
}