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

Side by Side Diff: sky/examples/fn/widgets/button.dart

Issue 975863003: Don't hardcode the list of events types in fn (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: More careful event syncing 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/examples/fn/lib/node.dart ('k') | sky/examples/fn/widgets/buttonbase.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 part of widgets;
2 2
3 class Button extends ButtonBase { 3 class Button extends ButtonBase {
4 4
5 static Style _style = new Style(''' 5 static Style _style = new Style('''
6 transform: translateX(0); 6 transform: translateX(0);
7 display: inline-flex; 7 display: inline-flex;
8 border-radius: 4px; 8 border-radius: 4px;
9 justify-content: center; 9 justify-content: center;
10 align-items: center; 10 align-items: center;
11 border: 1px solid blue; 11 border: 1px solid blue;
12 -webkit-user-select: none; 12 -webkit-user-select: none;
13 margin: 5px;''' 13 margin: 5px;'''
14 ); 14 );
15 15
16 static Style _highlightStyle = new Style(''' 16 static Style _highlightStyle = new Style('''
17 transform: translateX(0); 17 transform: translateX(0);
18 display: inline-flex; 18 display: inline-flex;
19 border-radius: 4px; 19 border-radius: 4px;
20 justify-content: center; 20 justify-content: center;
21 align-items: center; 21 align-items: center;
22 border: 1px solid blue; 22 border: 1px solid blue;
23 -webkit-user-select: none; 23 -webkit-user-select: none;
24 margin: 5px; 24 margin: 5px;
25 background-color: orange;''' 25 background-color: orange;'''
26 ); 26 );
27 27
28 Node content; 28 Node content;
29 sky.EventListener onClick;
30 29
31 Button({ Object key, this.content, this.onClick }) : super(key: key); 30 Button({ Object key, this.content }) : super(key: key);
32 31
33 Node render() { 32 Node render() {
34 return new Container( 33 return new Container(
35 key: 'Button', 34 key: 'Button',
36 style: _highlight ? _highlightStyle : _style, 35 style: _highlight ? _highlightStyle : _style,
37 onClick: onClick,
38 onPointerDown: _handlePointerDown,
39 onPointerUp: _handlePointerUp,
40 onPointerCancel: _handlePointerCancel,
41 children: [super.render(), content] 36 children: [super.render(), content]
42 ); 37 );
43 } 38 }
44 } 39 }
OLDNEW
« no previous file with comments | « sky/examples/fn/lib/node.dart ('k') | sky/examples/fn/widgets/buttonbase.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698