| 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 'animated_component.dart'; | |
| 6 import '../animation/animated_value.dart'; | 5 import '../animation/animated_value.dart'; |
| 7 import '../fn2.dart'; | 6 import '../fn2.dart'; |
| 8 import '../theme2/colors.dart'; | 7 import '../theme2/colors.dart'; |
| 8 import '../theme2/shadows.dart'; |
| 9 import 'animated_component.dart'; |
| 9 import 'dart:async'; | 10 import 'dart:async'; |
| 10 import 'dart:math' as math; | 11 import 'dart:math' as math; |
| 11 import 'material.dart'; | 12 import 'material.dart'; |
| 12 import 'popup_menu_item.dart'; | 13 import 'popup_menu_item.dart'; |
| 13 | 14 |
| 14 const double _kMenuOpenDuration = 300.0; | 15 const double _kMenuOpenDuration = 300.0; |
| 15 const double _kMenuCloseDuration = 200.0; | 16 const double _kMenuCloseDuration = 200.0; |
| 16 const double _kMenuCloseDelay = 100.0; | 17 const double _kMenuCloseDelay = 100.0; |
| 17 | 18 |
| 18 enum MenuState { hidden, opening, open, closing } | 19 enum MenuState { hidden, opening, open, closing } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // }); | 92 // }); |
| 92 // } | 93 // } |
| 93 | 94 |
| 94 UINode build() { | 95 UINode build() { |
| 95 int i = 0; | 96 int i = 0; |
| 96 List<UINode> children = new List.from(items.map((List<UINode> item) { | 97 List<UINode> children = new List.from(items.map((List<UINode> item) { |
| 97 double opacity = _opacityFor(i); | 98 double opacity = _opacityFor(i); |
| 98 return new PopupMenuItem(key: i++, children: item, opacity: opacity); | 99 return new PopupMenuItem(key: i++, children: item, opacity: opacity); |
| 99 })); | 100 })); |
| 100 | 101 |
| 102 // border-radius: 2px |
| 103 // inlineStyle: _inlineStyle(), |
| 101 return new ShrinkWrapWidth( | 104 return new ShrinkWrapWidth( |
| 102 child: new Material( | 105 child: new Container( |
| 103 content: new Container( | 106 padding: const EdgeDims.all(8.0), |
| 104 padding: const EdgeDims.all(8.0), | 107 decoration: new BoxDecoration( |
| 105 // border-radius: 2px | 108 backgroundColor: Grey[50], |
| 106 decoration: new BoxDecoration(backgroundColor: Grey[50]), | 109 boxShadow: Shadow[level]), |
| 107 // inlineStyle: _inlineStyle(), | 110 child: new BlockContainer(children: children) |
| 108 child: new BlockContainer(children: children) | |
| 109 ), | |
| 110 level: level | |
| 111 ) | 111 ) |
| 112 ); | 112 ); |
| 113 } | 113 } |
| 114 } | 114 } |
| OLD | NEW |