Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: sky/framework/components/popup_menu.dart

Issue 1104233003: [Effen] fix some dart warnings (mostly unused imports) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/framework/components/material.dart ('k') | sky/framework/components/popup_menu_item.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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'; 5 import 'animated_component.dart';
6 import '../animation/animated_value.dart'; 6 import '../animation/animated_value.dart';
7 import '../fn.dart'; 7 import '../fn.dart';
8 import '../theme/colors.dart'; 8 import '../theme/colors.dart';
9 import '../theme/view-configuration.dart';
10 import 'dart:async'; 9 import 'dart:async';
11 import 'dart:math' as math; 10 import 'dart:math' as math;
12 import 'dart:sky' as sky;
13 import 'material.dart'; 11 import 'material.dart';
14 import 'popup_menu_item.dart'; 12 import 'popup_menu_item.dart';
15 13
16 const double _kMenuOpenDuration = 300.0; 14 const double _kMenuOpenDuration = 300.0;
17 const double _kMenuCloseDuration = 200.0; 15 const double _kMenuCloseDuration = 200.0;
18 const double _kMenuCloseDelay = 100.0; 16 const double _kMenuCloseDelay = 100.0;
19 17
20 enum MenuState { Hidden, Opening, Open, Closing } 18 enum MenuState { Hidden, Opening, Open, Closing }
21 19
22 class PopupMenuController { 20 class PopupMenuController {
(...skipping 14 matching lines...) Expand all
37 Future _closeState; 35 Future _closeState;
38 close() async { 36 close() async {
39 var result = new Completer(); 37 var result = new Completer();
40 _closeState = result.future; 38 _closeState = result.future;
41 if ((_state == MenuState.Opening) || (_state == MenuState.Open)) { 39 if ((_state == MenuState.Opening) || (_state == MenuState.Open)) {
42 _state = MenuState.Closing; 40 _state = MenuState.Closing;
43 await position.animateTo(0.0, _kMenuCloseDuration, initialDelay: _kMenuClo seDelay); 41 await position.animateTo(0.0, _kMenuCloseDuration, initialDelay: _kMenuClo seDelay);
44 _state = MenuState.Hidden; 42 _state = MenuState.Hidden;
45 _closeState = null; 43 _closeState = null;
46 result.complete(); 44 result.complete();
47 return; 45 return result.future;
48 } 46 }
49 assert(_closeState != null); 47 assert(_closeState != null);
50 return _closeState; 48 return _closeState;
51 } 49 }
52 } 50 }
53 51
54 class PopupMenu extends AnimatedComponent { 52 class PopupMenu extends AnimatedComponent {
55 static final Style _style = new Style(''' 53 static final Style _style = new Style('''
56 border-radius: 2px; 54 border-radius: 2px;
57 padding: 8px 0; 55 padding: 8px 0;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 106
109 return new Material( 107 return new Material(
110 content: new Container( 108 content: new Container(
111 style: _style, 109 style: _style,
112 inlineStyle: _inlineStyle(), 110 inlineStyle: _inlineStyle(),
113 children: children 111 children: children
114 ), 112 ),
115 level: level); 113 level: level);
116 } 114 }
117 } 115 }
OLDNEW
« no previous file with comments | « sky/framework/components/material.dart ('k') | sky/framework/components/popup_menu_item.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698