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

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

Issue 1019023003: Improve Material ink effects (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
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 '../fn.dart'; 5 import '../fn.dart';
6 import 'button_base.dart'; 6 import 'button_base.dart';
7 import 'ink_well.dart';
7 import 'material.dart'; 8 import 'material.dart';
8 9
9 typedef void ValueChanged(value); 10 typedef void ValueChanged(value);
10 11
11 class Radio extends ButtonBase { 12 class Radio extends ButtonBase {
12 Object value; 13 Object value;
13 Object groupValue; 14 Object groupValue;
14 ValueChanged onChanged; 15 ValueChanged onChanged;
15 16
16 static final Style _style = new Style(''' 17 static final Style _style = new Style('''
(...skipping 30 matching lines...) Expand all
47 48
48 Radio({ 49 Radio({
49 Object key, 50 Object key,
50 this.onChanged, 51 this.onChanged,
51 this.value, 52 this.value,
52 this.groupValue 53 this.groupValue
53 }) : super(key: key); 54 }) : super(key: key);
54 55
55 Node buildContent() { 56 Node buildContent() {
56 return new EventTarget( 57 return new EventTarget(
57 new Material( 58 new InkWell(
58 style: highlight ? _highlightStyle : _style, 59 style: highlight ? _highlightStyle : _style,
59 children: value == groupValue ? [new Container(style: _dotStyle )] : [] 60 children: value == groupValue ? [new Container(style: _dotStyle )] : []
60 ), 61 ),
61 onGestureTap: _handleClick 62 onGestureTap: _handleClick
62 ); 63 );
63 } 64 }
64 65
65 void _handleClick(_) { 66 void _handleClick(_) {
66 onChanged(value); 67 onChanged(value);
67 } 68 }
68 } 69 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698