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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 if (_slots[slot] == child) { | 70 if (_slots[slot] == child) { |
71 this[slot] = null; | 71 this[slot] = null; |
72 return slot; | 72 return slot; |
73 } | 73 } |
74 } | 74 } |
75 return null; | 75 return null; |
76 } | 76 } |
77 | 77 |
78 bool get sizedByParent => true; | 78 bool get sizedByParent => true; |
79 void performResize() { | 79 void performResize() { |
80 size = constraints.constrain(Size.infinite); | 80 size = constraints.biggest; |
81 assert(!size.isInfinite); | 81 assert(!size.isInfinite); |
82 } | 82 } |
83 | 83 |
84 // TODO(eseidel): These change based on device size! | 84 // TODO(eseidel): These change based on device size! |
85 // http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keyl
ines-keylines-spacing | 85 // http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keyl
ines-keylines-spacing |
86 static const kButtonX = 16.0; // left from right edge of body | 86 static const kButtonX = 16.0; // left from right edge of body |
87 static const kButtonY = 16.0; // up from bottom edge of body | 87 static const kButtonY = 16.0; // up from bottom edge of body |
88 | 88 |
89 void performLayout() { | 89 void performLayout() { |
90 double bodyHeight = size.height; | 90 double bodyHeight = size.height; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 void syncRenderObject(Widget old) { | 216 void syncRenderObject(Widget old) { |
217 super.syncRenderObject(old); | 217 super.syncRenderObject(old); |
218 _toolbar = syncChild(_toolbar, old is Scaffold ? old._toolbar : null, Scaffo
ldSlots.toolbar); | 218 _toolbar = syncChild(_toolbar, old is Scaffold ? old._toolbar : null, Scaffo
ldSlots.toolbar); |
219 _body = syncChild(_body, old is Scaffold ? old._body : null, ScaffoldSlots.b
ody); | 219 _body = syncChild(_body, old is Scaffold ? old._body : null, ScaffoldSlots.b
ody); |
220 _statusBar = syncChild(_statusBar, old is Scaffold ? old._statusBar : null,
ScaffoldSlots.statusBar); | 220 _statusBar = syncChild(_statusBar, old is Scaffold ? old._statusBar : null,
ScaffoldSlots.statusBar); |
221 _drawer = syncChild(_drawer, old is Scaffold ? old._drawer : null, ScaffoldS
lots.drawer); | 221 _drawer = syncChild(_drawer, old is Scaffold ? old._drawer : null, ScaffoldS
lots.drawer); |
222 _floatingActionButton = syncChild(_floatingActionButton, old is Scaffold ? o
ld._floatingActionButton : null, ScaffoldSlots.floatingActionButton); | 222 _floatingActionButton = syncChild(_floatingActionButton, old is Scaffold ? o
ld._floatingActionButton : null, ScaffoldSlots.floatingActionButton); |
223 } | 223 } |
224 | 224 |
225 } | 225 } |
OLD | NEW |