Spinning Square example for the RenderObject API.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1178783002.
This commit is contained in:
Hixie 2015-06-10 17:27:49 -07:00
parent 55b1e79bbe
commit ff34b29fff

View File

@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:sky'; import 'dart:sky' as sky;
import 'package:sky/framework/rendering/object.dart';
import 'package:sky/framework/rendering/box.dart'; import 'package:sky/framework/rendering/box.dart';
class RenderSolidColorBox extends RenderDecoratedBox { class RenderSolidColorBox extends RenderDecoratedBox {
@ -41,7 +42,7 @@ class RenderSolidColorBox extends RenderDecoratedBox {
size = constraints.constrain(desiredSize); size = constraints.constrain(desiredSize);
} }
void handlePointer(PointerEvent event) { void handleEvent(sky.Event event, BoxHitTestEntry entry) {
if (event.type == 'pointerdown') if (event.type == 'pointerdown')
decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000)); decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000));
else if (event.type == 'pointerup') else if (event.type == 'pointerup')