OLD | NEW |
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 '../theme2/colors.dart'; | 5 import '../theme2/colors.dart'; |
6 import '../theme2/edges.dart'; | 6 import '../theme2/edges.dart'; |
7 import 'basic.dart'; | 7 import 'basic.dart'; |
8 import 'button_base.dart'; | 8 import 'button_base.dart'; |
9 import 'ink_well.dart'; | 9 import 'ink_well.dart'; |
10 import 'material.dart'; | 10 import 'material.dart'; |
11 | 11 |
12 enum RaisedButtonTheme { light, dark } | 12 enum RaisedButtonTheme { light, dark } |
13 | 13 |
14 class RaisedButton extends ButtonBase { | 14 class RaisedButton extends ButtonBase { |
15 | 15 |
16 RaisedButton({ | 16 RaisedButton({ |
17 Object key, | 17 String key, |
18 this.child, | 18 this.child, |
19 this.enabled: true, | 19 this.enabled: true, |
20 this.onPressed, | 20 this.onPressed, |
21 this.theme: RaisedButtonTheme.light | 21 this.theme: RaisedButtonTheme.light |
22 }) : super(key: key); | 22 }) : super(key: key); |
23 | 23 |
24 UINode child; | 24 UINode child; |
25 bool enabled; | 25 bool enabled; |
26 Function onPressed; | 26 Function onPressed; |
27 RaisedButtonTheme theme; | 27 RaisedButtonTheme theme; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 child: enabled ? new InkWell(child: contents) : contents, | 68 child: enabled ? new InkWell(child: contents) : contents, |
69 level: enabled ? (highlight ? 2 : 1) : 0, | 69 level: enabled ? (highlight ? 2 : 1) : 0, |
70 color: color | 70 color: color |
71 ) | 71 ) |
72 ), | 72 ), |
73 onGestureTap: (_) { if (onPressed != null && enabled) onPressed(); } | 73 onGestureTap: (_) { if (onPressed != null && enabled) onPressed(); } |
74 ); | 74 ); |
75 } | 75 } |
76 | 76 |
77 } | 77 } |
OLD | NEW |