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

Side by Side Diff: sky/sdk/lib/widgets/popup_menu.dart

Issue 1233143004: syncFields() should not sync something you set up in initState(). They are separate concepts. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | no next file » | 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 'dart:async'; 5 import 'dart:async';
6 import 'dart:math' as math; 6 import 'dart:math' as math;
7 import 'dart:sky' as sky; 7 import 'dart:sky' as sky;
8 8
9 import 'package:sky/animation/animation_performance.dart'; 9 import 'package:sky/animation/animation_performance.dart';
10 import 'package:sky/painting/box_painter.dart'; 10 import 'package:sky/painting/box_painter.dart';
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 backgroundColor: Grey[50], 102 backgroundColor: Grey[50],
103 borderRadius: 2.0, 103 borderRadius: 2.0,
104 boxShadow: shadows[level])); 104 boxShadow: shadows[level]));
105 watch(controller.performance); 105 watch(controller.performance);
106 } 106 }
107 107
108 void syncFields(PopupMenu source) { 108 void syncFields(PopupMenu source) {
109 controller = source.controller; 109 controller = source.controller;
110 items = source.items; 110 items = source.items;
111 level = source.level; 111 level = source.level;
112 _painter = source._painter;
113 super.syncFields(source); 112 super.syncFields(source);
114 } 113 }
115 114
116 BoxPainter _painter; 115 BoxPainter _painter;
117 116
118 double _opacityFor(int i) { 117 double _opacityFor(int i) {
119 assert(controller.position.value != null); 118 assert(controller.position.value != null);
120 if (controller.position.value == null || controller.position.value == 1.0) 119 if (controller.position.value == null || controller.position.value == 1.0)
121 return 1.0; 120 return 1.0;
122 double unit = 1.0 / items.length; 121 double unit = 1.0 / items.length;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ) 158 )
160 ) 159 )
161 ) 160 )
162 ) 161 )
163 ) 162 )
164 ) 163 )
165 ); 164 );
166 } 165 }
167 166
168 } 167 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698