| 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 enum MaterialButtonTheme { light, dark } | 10 enum MaterialButtonTheme { light, dark } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 Color get color; | 36 Color get color; |
| 37 int get level; | 37 int get level; |
| 38 | 38 |
| 39 Widget buildContent() { | 39 Widget buildContent() { |
| 40 Widget contents = new Container( | 40 Widget contents = new Container( |
| 41 padding: new EdgeDims.symmetric(horizontal: 8.0), | 41 padding: new EdgeDims.symmetric(horizontal: 8.0), |
| 42 child: new Center(child: child) // TODO(ianh): figure out a way to compell
the child to have gray text when disabled... | 42 child: new Center(child: child) // TODO(ianh): figure out a way to compell
the child to have gray text when disabled... |
| 43 ); | 43 ); |
| 44 return new EventListenerNode( | 44 return new Listener( |
| 45 new Container( | 45 child: new Container( |
| 46 height: 36.0, | 46 height: 36.0, |
| 47 constraints: new BoxConstraints(minWidth: 88.0), | 47 constraints: new BoxConstraints(minWidth: 88.0), |
| 48 margin: new EdgeDims.all(8.0), | 48 margin: new EdgeDims.all(8.0), |
| 49 child: new Material( | 49 child: new Material( |
| 50 child: enabled ? new InkWell(child: contents) : contents, | 50 child: enabled ? new InkWell(child: contents) : contents, |
| 51 level: level, | 51 level: level, |
| 52 color: color | 52 color: color |
| 53 ) | 53 ) |
| 54 ), | 54 ), |
| 55 onGestureTap: (_) { if (onPressed != null && enabled) onPressed(); } | 55 onGestureTap: (_) { if (onPressed != null && enabled) onPressed(); } |
| 56 ); | 56 ); |
| 57 } | 57 } |
| 58 | 58 |
| 59 } | 59 } |
| OLD | NEW |