mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This moves input.dart to editing2/, since that way we can define the layering as strictly unidirectional. It also reorders a bunch of imports to fit the style guide. I removed the old remnants of the widgets example, and put the fn2 examples into the examples/widgets/ directory, to parallel the framework directory names. R=abarth@chromium.org Review URL: https://codereview.chromium.org/1177243002.
45 lines
902 B
Dart
45 lines
902 B
Dart
// 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 'wrappers.dart';
|
|
|
|
abstract class ButtonBase extends Component {
|
|
|
|
ButtonBase({ Object key, this.highlight: false }) : super(key: key);
|
|
|
|
bool highlight;
|
|
|
|
void syncFields(ButtonBase source) {
|
|
highlight = source.highlight;
|
|
}
|
|
|
|
void _handlePointerDown(_) {
|
|
setState(() {
|
|
highlight = true;
|
|
});
|
|
}
|
|
void _handlePointerUp(_) {
|
|
setState(() {
|
|
highlight = false;
|
|
});
|
|
}
|
|
void _handlePointerCancel(_) {
|
|
setState(() {
|
|
highlight = false;
|
|
});
|
|
}
|
|
|
|
UINode build() {
|
|
return new EventListenerNode(
|
|
buildContent(),
|
|
onPointerDown: _handlePointerDown,
|
|
onPointerUp: _handlePointerUp,
|
|
onPointerCancel: _handlePointerCancel
|
|
);
|
|
}
|
|
|
|
UINode buildContent();
|
|
|
|
}
|