| 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 'package:sky/widgets/theme.dart'; | 5 import 'package:sky/widgets/theme.dart'; |
| 6 | 6 |
| 7 import '../rendering/flex.dart'; | 7 import '../rendering/flex.dart'; |
| 8 import '../theme/shadows.dart'; | 8 import '../theme/shadows.dart'; |
| 9 import '../theme/view_configuration.dart'; | 9 import '../theme/view_configuration.dart'; |
| 10 import 'basic.dart'; | 10 import 'basic.dart'; |
| 11 import 'default_text_style.dart'; | 11 import 'default_text_style.dart'; |
| 12 | 12 |
| 13 class ToolBar extends Component { | 13 class ToolBar extends Component { |
| 14 | 14 |
| 15 ToolBar({ | 15 ToolBar({ |
| 16 String key, | 16 String key, |
| 17 this.left, | 17 this.left, |
| 18 this.center, | 18 this.center, |
| 19 this.right, | 19 this.right, |
| 20 this.backgroundColor | 20 this.backgroundColor |
| 21 }) : super(key: key); | 21 }) : super(key: key); |
| 22 | 22 |
| 23 final Widget left; | 23 final Widget left; |
| 24 final Widget center; | 24 final Widget center; |
| 25 final List<Widget> right; | 25 final List<Widget> right; |
| 26 final Color backgroundColor; | 26 final Color backgroundColor; |
| 27 | 27 |
| 28 @override |
| 28 Widget build() { | 29 Widget build() { |
| 29 List<Widget> children = new List<Widget>(); | 30 List<Widget> children = new List<Widget>(); |
| 30 if (left != null) | 31 if (left != null) |
| 31 children.add(left); | 32 children.add(left); |
| 32 | 33 |
| 33 if (center != null) { | 34 if (center != null) { |
| 34 children.add( | 35 children.add( |
| 35 new Flexible( | 36 new Flexible( |
| 36 child: new Padding( | 37 child: new Padding( |
| 37 child: new DefaultTextStyle( | 38 child: new DefaultTextStyle( |
| (...skipping 16 matching lines...) Expand all Loading... |
| 54 ), | 55 ), |
| 55 padding: new EdgeDims.symmetric(horizontal: 8.0), | 56 padding: new EdgeDims.symmetric(horizontal: 8.0), |
| 56 decoration: new BoxDecoration( | 57 decoration: new BoxDecoration( |
| 57 backgroundColor: backgroundColor == null ? Theme.of(this).primaryColor :
backgroundColor, | 58 backgroundColor: backgroundColor == null ? Theme.of(this).primaryColor :
backgroundColor, |
| 58 boxShadow: shadows[2] | 59 boxShadow: shadows[2] |
| 59 ) | 60 ) |
| 60 ); | 61 ); |
| 61 } | 62 } |
| 62 | 63 |
| 63 } | 64 } |
| OLD | NEW |