| 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 '../fn.dart'; | 5 import '../fn.dart'; |
| 6 import '../theme/colors.dart'; |
| 7 import 'ink_well.dart'; |
| 6 import 'material.dart'; | 8 import 'material.dart'; |
| 7 import '../theme/colors.dart'; | |
| 8 | 9 |
| 9 class FloatingActionButton extends Component { | 10 class FloatingActionButton extends Component { |
| 10 // TODO(abarth): We need a better way to become a container for absolutely | 11 // TODO(abarth): We need a better way to become a container for absolutely |
| 11 // positioned elements. | 12 // positioned elements. |
| 12 static final Style _style = new Style(''' | 13 static final Style _style = new Style(''' |
| 13 transform: translateX(0); | 14 transform: translateX(0); |
| 14 width: 56px; | 15 width: 56px; |
| 15 height: 56px; | 16 height: 56px; |
| 16 background-color: ${Red[500]}; | 17 background-color: ${Red[500]}; |
| 17 border-radius: 28px;''' | 18 border-radius: 28px;''' |
| (...skipping 16 matching lines...) Expand all Loading... |
| 34 FloatingActionButton({ Object key, this.content, this.level: 0 }) | 35 FloatingActionButton({ Object key, this.content, this.level: 0 }) |
| 35 : super(key: key); | 36 : super(key: key); |
| 36 | 37 |
| 37 Node build() { | 38 Node build() { |
| 38 List<Node> children = []; | 39 List<Node> children = []; |
| 39 | 40 |
| 40 if (content != null) | 41 if (content != null) |
| 41 children.add(content); | 42 children.add(content); |
| 42 | 43 |
| 43 return new Container( | 44 return new Container( |
| 44 key: "Container", | |
| 45 style: level > 0 ? _style.extend(Material.shadowStyle[level]) : _style, | 45 style: level > 0 ? _style.extend(Material.shadowStyle[level]) : _style, |
| 46 children: [ | 46 children: [new StyleNode(new InkWell(children: children), _clipStyle)] |
| 47 new Material( | |
| 48 key: "Clip", | |
| 49 style: _clipStyle, | |
| 50 children: children | |
| 51 ) | |
| 52 ] | |
| 53 ); | 47 ); |
| 54 } | 48 } |
| 55 } | 49 } |
| OLD | NEW |