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

Side by Side Diff: sky/framework/components/button_base.dart

Issue 993033003: Move example fn widgets into sky/framework/components (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « sky/framework/components/button.dart ('k') | sky/framework/components/checkbox.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 part of widgets; 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.
2 4
3 abstract class ButtonBase extends MaterialComponent { 5 import '../fn.dart';
6 import 'material.dart';
4 7
5 bool _highlight = false; 8 abstract class ButtonBase extends Material {
9 bool highlight = false;
6 10
7 ButtonBase({ Object key }) : super(key: key) { 11 ButtonBase({ Object key }) : super(key: key) {
8 events.listen('pointerdown', _handlePointerDown); 12 events.listen('pointerdown', _handlePointerDown);
9 events.listen('pointerup', _handlePointerUp); 13 events.listen('pointerup', _handlePointerUp);
10 events.listen('pointercancel', _handlePointerCancel); 14 events.listen('pointercancel', _handlePointerCancel);
11 } 15 }
12 16
13 void _handlePointerDown(_) { 17 void _handlePointerDown(_) {
14 setState(() { 18 setState(() {
15 _highlight = true; 19 highlight = true;
16 }); 20 });
17 } 21 }
18 void _handlePointerUp(_) { 22 void _handlePointerUp(_) {
19 setState(() { 23 setState(() {
20 _highlight = false; 24 highlight = false;
21 }); 25 });
22 } 26 }
23 void _handlePointerCancel(_) { 27 void _handlePointerCancel(_) {
24 setState(() { 28 setState(() {
25 _highlight = false; 29 highlight = false;
26 }); 30 });
27 } 31 }
28 } 32 }
OLDNEW
« no previous file with comments | « sky/framework/components/button.dart ('k') | sky/framework/components/checkbox.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698