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 'basic.dart'; | 5 import 'basic.dart'; |
6 import 'button_base.dart'; | 6 import 'button_base.dart'; |
7 import 'ink_well.dart'; | 7 import 'ink_well.dart'; |
8 import 'material.dart'; | 8 import 'material.dart'; |
9 | 9 |
10 // Rather than using this class directly, please use FlatButton or RaisedButton. | 10 // Rather than using this class directly, please use FlatButton or RaisedButton. |
(...skipping 24 matching lines...) Expand all Loading... |
35 Widget contents = new Container( | 35 Widget contents = new Container( |
36 padding: new EdgeDims.symmetric(horizontal: 8.0), | 36 padding: new EdgeDims.symmetric(horizontal: 8.0), |
37 child: new Center(child: child) // TODO(ianh): figure out a way to compell
the child to have gray text when disabled... | 37 child: new Center(child: child) // TODO(ianh): figure out a way to compell
the child to have gray text when disabled... |
38 ); | 38 ); |
39 return new Listener( | 39 return new Listener( |
40 child: new Container( | 40 child: new Container( |
41 height: 36.0, | 41 height: 36.0, |
42 constraints: new BoxConstraints(minWidth: 88.0), | 42 constraints: new BoxConstraints(minWidth: 88.0), |
43 margin: new EdgeDims.all(8.0), | 43 margin: new EdgeDims.all(8.0), |
44 child: new Material( | 44 child: new Material( |
| 45 type: MaterialType.button, |
45 child: enabled ? new InkWell(child: contents) : contents, | 46 child: enabled ? new InkWell(child: contents) : contents, |
46 level: level, | 47 level: level, |
47 color: color | 48 color: color |
48 ) | 49 ) |
49 ), | 50 ), |
50 onGestureTap: (_) { if (onPressed != null && enabled) onPressed(); } | 51 onGestureTap: (_) { if (onPressed != null && enabled) onPressed(); } |
51 ); | 52 ); |
52 } | 53 } |
53 | 54 |
54 } | 55 } |
OLD | NEW |