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

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

Issue 971183002: Initial commit of Effen reactive framework experiment for Sky (Closed) Base URL: https://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/examples/fn/widgets/menuitem.dart ('k') | sky/examples/fn/widgets/toolbar.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 part of widgets;
2
3 class Radio extends ButtonBase {
4
5 Object value;
6 Object groupValue;
7 ValueChanged onChanged;
8
9 static Style _style = new Style('''
10 display: inline-block;
11 -webkit-user-select: none;
12 width: 14px;
13 height: 14px;
14 border-radius: 7px;
15 border: 1px solid blue;
16 margin: 0 5px;'''
17 );
18
19 static Style _highlightStyle = new Style('''
20 display: inline-block;
21 -webkit-user-select: none;
22 width: 14px;
23 height: 14px;
24 border-radius: 7px;
25 border: 1px solid blue;
26 margin: 0 5px;
27 background-color: orange;'''
28 );
29
30 static Style _dotStyle = new Style('''
31 -webkit-user-select: none;
32 width: 10px;
33 height: 10px;
34 border-radius: 5px;
35 background-color: black;
36 margin: 2px;'''
37 );
38
39 Radio({
40 Object key,
41 this.onChanged,
42 this.value,
43 this.groupValue
44 }) : super(key: key);
45
46 Node render() {
47 return new Container(
48 style: _highlight ? _highlightStyle : _style,
49 onClick: _handleClick,
50 onPointerDown: _handlePointerDown,
51 onPointerUp: _handlePointerUp,
52 onPointerCancel: _handlePointerCancel,
53 children: value == groupValue ?
54 [new Container( style : _dotStyle )] : null
55 );
56 }
57
58 void _handleClick(sky.Event e) {
59 onChanged(value);
60 }
61 }
OLDNEW
« no previous file with comments | « sky/examples/fn/widgets/menuitem.dart ('k') | sky/examples/fn/widgets/toolbar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698