Spinning Square example for the RenderObject API.
R=abarth@chromium.org Review URL: https://codereview.chromium.org/1178783002.
This commit is contained in:
parent
55b1e79bbe
commit
ff34b29fff
@ -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')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user