Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 import '../theme2/edges.dart'; | |
| 6 import '../theme2/colors.dart'; | |
| 7 import '../rendering/flex.dart'; | |
| 8 import 'button_base.dart'; | |
| 9 import 'ink_well.dart'; | |
| 10 import 'material.dart'; | |
| 11 import 'wrappers.dart'; | |
| 12 | |
| 13 class RaisedButton extends ButtonBase { | |
| 14 | |
| 15 RaisedButton({ Object key, this.child, this.onTap }) : super(key: key); | |
| 16 | |
| 17 UINode child; | |
| 18 int level; | |
| 19 Function onTap; | |
| 20 | |
| 21 void syncFields(RaisedButton source) { | |
| 22 child = source.child; | |
| 23 level = source.level; | |
| 24 onTap = source.onTap; | |
| 25 super.syncFields(source); | |
| 26 } | |
| 27 | |
| 28 UINode buildContent() { | |
| 29 return new EventListenerNode( | |
| 30 new Container( | |
| 31 height: 36.0, | |
| 32 constraints: new BoxConstraints(minWidth: 88.0), | |
| 33 margin: new EdgeDims.all(4.0), | |
| 34 child: new Material( | |
| 35 edge: MaterialEdge.card, | |
| 36 child: new InkWell( | |
| 37 child: new Container( | |
| 38 padding: new EdgeDims.symmetric(horizontal: 8.0), | |
| 39 child: new Flex( | |
| 40 [child], | |
| 41 justifyContent: FlexJustifyContent.center, | |
| 42 alignItems: FlexAlignItems.center | |
| 43 ) | |
|
abarth-chromium
2015/06/12 03:08:04
We could have a RenderObject that did:
new Foo(ch
Hixie
2015/06/12 17:36:38
On it.
| |
| 44 ) | |
| 45 ), | |
| 46 level: highlight ? 2 : 1, // TODO(ianh): animate this | |
|
abarth-chromium
2015/06/12 03:08:04
Material should be the one that implicitly animate
Hixie
2015/06/12 17:36:38
Will move the comment.
| |
| 47 color: highlight ? const Color(0xFFD6D6D6) : Grey[300] // TODO(ianh): animate this | |
|
abarth-chromium
2015/06/12 03:08:04
0xFFD6D6D6 -> This color doesn't have a name?
I t
Hixie
2015/06/12 17:36:38
Agreed. Weirdly D6D6D6 doesn't have a name current
| |
| 48 ) | |
| 49 ), | |
| 50 onGestureTap: (_) { if (onTap != null) onTap(); } | |
|
abarth-chromium
2015/06/12 03:08:04
Is there a reason we create this event listeners i
Hixie
2015/06/12 17:36:38
It seems really weird to me that a widget whose en
| |
| 51 ); | |
| 52 } | |
| 53 | |
| 54 } | |
| OLD | NEW |