Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: sky/sdk/lib/framework/components2/button_base.dart

Issue 1177243002: Refactor fn2.dart, since it breached our 1000-line threshold. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 import '../fn2.dart';
6
7 abstract class ButtonBase extends Component {
8
9 ButtonBase({ Object key, this.highlight: false }) : super(key: key);
10
11 bool highlight;
12
13 void syncFields(ButtonBase source) {
14 highlight = source.highlight;
15 }
16
17 void _handlePointerDown(_) {
18 setState(() {
19 highlight = true;
20 });
21 }
22 void _handlePointerUp(_) {
23 setState(() {
24 highlight = false;
25 });
26 }
27 void _handlePointerCancel(_) {
28 setState(() {
29 highlight = false;
30 });
31 }
32
33 UINode build() {
34 return new EventListenerNode(
35 buildContent(),
36 onPointerDown: _handlePointerDown,
37 onPointerUp: _handlePointerUp,
38 onPointerCancel: _handlePointerCancel
39 );
40 }
41
42 UINode buildContent();
43
44 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/framework/components2/button.dart ('k') | sky/sdk/lib/framework/components2/checkbox.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698