| 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 'dart:sky' as sky; | 5 import 'dart:sky' as sky; |
| 6 | 6 |
| 7 import 'package:sky/painting/text_style.dart'; | 7 import 'package:sky/painting/text_style.dart'; |
| 8 import 'package:sky/theme/colors.dart' as colors; | 8 import 'package:sky/theme/colors.dart' as colors; |
| 9 import 'package:sky/widgets/basic.dart'; | 9 import 'package:sky/widgets/basic.dart'; |
| 10 import 'package:sky/widgets/button_base.dart'; | 10 import 'package:sky/widgets/button_base.dart'; |
| 11 import 'package:sky/widgets/default_text_style.dart'; | 11 import 'package:sky/widgets/default_text_style.dart'; |
| 12 import 'package:sky/widgets/icon.dart'; | 12 import 'package:sky/widgets/icon.dart'; |
| 13 import 'package:sky/widgets/ink_well.dart'; | 13 import 'package:sky/widgets/ink_well.dart'; |
| 14 import 'package:sky/widgets/theme.dart'; | 14 import 'package:sky/widgets/theme.dart'; |
| 15 import 'package:sky/widgets/widget.dart'; | 15 import 'package:sky/widgets/widget.dart'; |
| 16 | 16 |
| 17 class MenuItem extends ButtonBase { | 17 class DrawerItem extends ButtonBase { |
| 18 MenuItem({ String key, this.icon, this.children, this.onPressed, this.selected
: false }) | 18 DrawerItem({ String key, this.icon, this.children, this.onPressed, this.select
ed: false }) |
| 19 : super(key: key); | 19 : super(key: key); |
| 20 | 20 |
| 21 String icon; | 21 String icon; |
| 22 List<Widget> children; | 22 List<Widget> children; |
| 23 Function onPressed; | 23 Function onPressed; |
| 24 bool selected; | 24 bool selected; |
| 25 | 25 |
| 26 void syncFields(MenuItem source) { | 26 void syncFields(DrawerItem source) { |
| 27 icon = source.icon; | 27 icon = source.icon; |
| 28 children = source.children; | 28 children = source.children; |
| 29 onPressed = source.onPressed; | 29 onPressed = source.onPressed; |
| 30 selected = source.selected; | 30 selected = source.selected; |
| 31 super.syncFields(source); | 31 super.syncFields(source); |
| 32 } | 32 } |
| 33 | 33 |
| 34 TextStyle _getTextStyle(ThemeData themeData) { | 34 TextStyle _getTextStyle(ThemeData themeData) { |
| 35 TextStyle result = themeData.text.body2; | 35 TextStyle result = themeData.text.body2; |
| 36 if (selected) | 36 if (selected) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 child: new Container( | 89 child: new Container( |
| 90 height: 48.0, | 90 height: 48.0, |
| 91 decoration: new BoxDecoration(backgroundColor: _getBackgroundColor(theme
Data)), | 91 decoration: new BoxDecoration(backgroundColor: _getBackgroundColor(theme
Data)), |
| 92 child: new InkWell( | 92 child: new InkWell( |
| 93 child: new Flex(flexChildren) | 93 child: new Flex(flexChildren) |
| 94 ) | 94 ) |
| 95 ) | 95 ) |
| 96 ); | 96 ); |
| 97 } | 97 } |
| 98 } | 98 } |
| OLD | NEW |