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

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

Issue 1209233002: Let's hide double.INFINITY a bit more, by providing cleaner APIs for the cases where we're currentl… (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 | « sky/sdk/lib/widgets/basic.dart ('k') | sky/sdk/lib/widgets/tabs.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 '../rendering/box.dart'; 5 import '../rendering/box.dart';
6 import '../rendering/object.dart'; 6 import '../rendering/object.dart';
7 import '../theme/view_configuration.dart'; 7 import '../theme/view_configuration.dart';
8 import 'widget.dart'; 8 import 'widget.dart';
9 9
10 enum ScaffoldSlots { 10 enum ScaffoldSlots {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 this[slot] = null; 68 this[slot] = null;
69 return slot; 69 return slot;
70 } 70 }
71 } 71 }
72 return null; 72 return null;
73 } 73 }
74 74
75 bool get sizedByParent => true; 75 bool get sizedByParent => true;
76 void performResize() { 76 void performResize() {
77 size = constraints.constrain(Size.infinite); 77 size = constraints.constrain(Size.infinite);
78 assert(size.width < double.INFINITY); 78 assert(!size.isInfinite);
79 assert(size.height < double.INFINITY);
80 } 79 }
81 80
82 // TODO(eseidel): These change based on device size! 81 // TODO(eseidel): These change based on device size!
83 // http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keyl ines-keylines-spacing 82 // http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keyl ines-keylines-spacing
84 static const kButtonX = 16.0; // left from right edge of body 83 static const kButtonX = 16.0; // left from right edge of body
85 static const kButtonY = 16.0; // up from bottom edge of body 84 static const kButtonY = 16.0; // up from bottom edge of body
86 85
87 void performLayout() { 86 void performLayout() {
88 double bodyHeight = size.height; 87 double bodyHeight = size.height;
89 double bodyPosition = 0.0; 88 double bodyPosition = 0.0;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 void syncRenderObject(Widget old) { 213 void syncRenderObject(Widget old) {
215 super.syncRenderObject(old); 214 super.syncRenderObject(old);
216 _toolbar = syncChild(_toolbar, old is Scaffold ? old._toolbar : null, Scaffo ldSlots.toolbar); 215 _toolbar = syncChild(_toolbar, old is Scaffold ? old._toolbar : null, Scaffo ldSlots.toolbar);
217 _body = syncChild(_body, old is Scaffold ? old._body : null, ScaffoldSlots.b ody); 216 _body = syncChild(_body, old is Scaffold ? old._body : null, ScaffoldSlots.b ody);
218 _statusBar = syncChild(_statusBar, old is Scaffold ? old._statusBar : null, ScaffoldSlots.statusBar); 217 _statusBar = syncChild(_statusBar, old is Scaffold ? old._statusBar : null, ScaffoldSlots.statusBar);
219 _drawer = syncChild(_drawer, old is Scaffold ? old._drawer : null, ScaffoldS lots.drawer); 218 _drawer = syncChild(_drawer, old is Scaffold ? old._drawer : null, ScaffoldS lots.drawer);
220 _floatingActionButton = syncChild(_floatingActionButton, old is Scaffold ? o ld._floatingActionButton : null, ScaffoldSlots.floatingActionButton); 219 _floatingActionButton = syncChild(_floatingActionButton, old is Scaffold ? o ld._floatingActionButton : null, ScaffoldSlots.floatingActionButton);
221 } 220 }
222 221
223 } 222 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/basic.dart ('k') | sky/sdk/lib/widgets/tabs.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698