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 // TODO(eseidel): This needs to change based on device size? | 12 // TODO(eseidel): This needs to change based on device size? |
13 // http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylin
es-keylines-spacing | 13 // http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylin
es-keylines-spacing |
14 const double _kSize = 56.0; | 14 const double _kSize = 56.0; |
15 | 15 |
16 class FloatingActionButton extends ButtonBase { | 16 class FloatingActionButton extends ButtonBase { |
17 | 17 |
18 FloatingActionButton({ String key, this.child }) : super(key: key); | 18 FloatingActionButton({ String key, this.child }) : super(key: key); |
19 | 19 |
20 final UINode child; | 20 final Widget child; |
21 | 21 |
22 UINode buildContent() { | 22 Widget buildContent() { |
23 return new Material( | 23 return new Material( |
24 child: new ClipOval( | 24 child: new ClipOval( |
25 child: new Container( | 25 child: new Container( |
26 width: _kSize, | 26 width: _kSize, |
27 height: _kSize, | 27 height: _kSize, |
28 child: new InkWell(child: new Center(child: child)) | 28 child: new InkWell(child: new Center(child: child)) |
29 ) | 29 ) |
30 ), | 30 ), |
31 color: Red[500], | 31 color: Red[500], |
32 edge: MaterialEdge.circle, | 32 edge: MaterialEdge.circle, |
33 level: highlight ? 3 : 2 | 33 level: highlight ? 3 : 2 |
34 ); | 34 ); |
35 } | 35 } |
36 | 36 |
37 } | 37 } |
OLD | NEW |