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

Side by Side Diff: sky/sdk/lib/widgets/button_base.dart

Issue 1226113007: Add @override annotation to known overriden methods (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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/sdk/lib/widgets/block_viewport.dart ('k') | sky/sdk/lib/widgets/card.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 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'basic.dart'; 5 import 'basic.dart';
6 6
7 abstract class ButtonBase extends StatefulComponent { 7 abstract class ButtonBase extends StatefulComponent {
8 8
9 ButtonBase({ String key, this.highlight: false }) : super(key: key); 9 ButtonBase({ String key, this.highlight: false }) : super(key: key);
10 10
11 bool highlight; 11 bool highlight;
12 12
13 @override
13 void syncFields(ButtonBase source) { 14 void syncFields(ButtonBase source) {
14 highlight = source.highlight; 15 highlight = source.highlight;
15 } 16 }
16 17
17 void _handlePointerDown(_) { 18 void _handlePointerDown(_) {
18 setState(() { 19 setState(() {
19 highlight = true; 20 highlight = true;
20 }); 21 });
21 } 22 }
22 void _handlePointerUp(_) { 23 void _handlePointerUp(_) {
23 setState(() { 24 setState(() {
24 highlight = false; 25 highlight = false;
25 }); 26 });
26 } 27 }
27 void _handlePointerCancel(_) { 28 void _handlePointerCancel(_) {
28 setState(() { 29 setState(() {
29 highlight = false; 30 highlight = false;
30 }); 31 });
31 } 32 }
32 33
34 @override
33 Widget build() { 35 Widget build() {
34 return new Listener( 36 return new Listener(
35 child: buildContent(), 37 child: buildContent(),
36 onPointerDown: _handlePointerDown, 38 onPointerDown: _handlePointerDown,
37 onPointerUp: _handlePointerUp, 39 onPointerUp: _handlePointerUp,
38 onPointerCancel: _handlePointerCancel 40 onPointerCancel: _handlePointerCancel
39 ); 41 );
40 } 42 }
41 43
42 Widget buildContent(); 44 Widget buildContent();
43 45
44 } 46 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/block_viewport.dart ('k') | sky/sdk/lib/widgets/card.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698