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

Side by Side Diff: sky/examples/fn/widgets/radio.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/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 transform: translateX(0);
11 display: inline-block;
12 -webkit-user-select: none;
13 width: 14px;
14 height: 14px;
15 border-radius: 7px;
16 border: 1px solid blue;
17 margin: 0 5px;'''
18 );
19
20 static Style _highlightStyle = new Style('''
21 transform: translateX(0);
22 display: inline-block;
23 -webkit-user-select: none;
24 width: 14px;
25 height: 14px;
26 border-radius: 7px;
27 border: 1px solid blue;
28 margin: 0 5px;
29 background-color: orange;'''
30 );
31
32 static Style _dotStyle = new Style('''
33 -webkit-user-select: none;
34 width: 10px;
35 height: 10px;
36 border-radius: 5px;
37 background-color: black;
38 margin: 2px;'''
39 );
40
41 Radio({
42 Object key,
43 this.onChanged,
44 this.value,
45 this.groupValue
46 }) : super(key: key);
47
48 Node build() {
49 return new Container(
50 style: _highlight ? _highlightStyle : _style,
51 children: value == groupValue ?
52 [super.build(), new Container( style : _dotStyle )] : [super.build()]
53 )..events.listen('click', _handleClick);
54 }
55
56 void _handleClick(_) {
57 onChanged(value);
58 }
59 }
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