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 '../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 Loading... |
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 Loading... |
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 } |
OLD | NEW |