mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Moving these files into sky/framework will make them easier to use from the SDK. Also, this CL also splits up the giant "widgets" library into smaller libraries, one per component. TBR=eseidel@chromium.org Review URL: https://codereview.chromium.org/993033003
33 lines
759 B
Dart
33 lines
759 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 '../fn.dart';
|
|
import 'material.dart';
|
|
|
|
abstract class ButtonBase extends Material {
|
|
bool highlight = false;
|
|
|
|
ButtonBase({ Object key }) : super(key: key) {
|
|
events.listen('pointerdown', _handlePointerDown);
|
|
events.listen('pointerup', _handlePointerUp);
|
|
events.listen('pointercancel', _handlePointerCancel);
|
|
}
|
|
|
|
void _handlePointerDown(_) {
|
|
setState(() {
|
|
highlight = true;
|
|
});
|
|
}
|
|
void _handlePointerUp(_) {
|
|
setState(() {
|
|
highlight = false;
|
|
});
|
|
}
|
|
void _handlePointerCancel(_) {
|
|
setState(() {
|
|
highlight = false;
|
|
});
|
|
}
|
|
}
|