| 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 '../fn2.dart'; | 5 import '../fn2.dart'; |
| 6 import '../rendering/box.dart'; | 6 import '../rendering/box.dart'; |
| 7 import '../rendering/object.dart'; | 7 import '../rendering/object.dart'; |
| 8 import '../theme2/view_configuration.dart'; | 8 import '../theme2/view_configuration.dart'; |
| 9 | 9 |
| 10 enum ScaffoldSlots { | 10 enum ScaffoldSlots { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.width < double.INFINITY); |
| 79 assert(size.height < double.INFINITY); | 79 assert(size.height < double.INFINITY); |
| 80 } | 80 } |
| 81 | 81 |
| 82 // 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 static const kButtonX = 16.0; // left from right edge of body | 84 static const kButtonX = 16.0; // left from right edge of body |
| 83 static const kButtonY = 16.0; // up from bottom edge of body | 85 static const kButtonY = 16.0; // up from bottom edge of body |
| 84 | 86 |
| 85 void performLayout() { | 87 void performLayout() { |
| 86 double bodyHeight = size.height; | 88 double bodyHeight = size.height; |
| 87 double bodyPosition = 0.0; | 89 double bodyPosition = 0.0; |
| 88 if (_slots[ScaffoldSlots.toolbar] != null) { | 90 if (_slots[ScaffoldSlots.toolbar] != null) { |
| 89 RenderBox toolbar = _slots[ScaffoldSlots.toolbar]; | 91 RenderBox toolbar = _slots[ScaffoldSlots.toolbar]; |
| 90 double toolbarHeight = kToolBarHeight + kNotificationAreaHeight; | 92 double toolbarHeight = kToolBarHeight + kNotificationAreaHeight; |
| 91 toolbar.layout(new BoxConstraints.tight(new Size(size.width, toolbarHeight
))); | 93 toolbar.layout(new BoxConstraints.tight(new Size(size.width, toolbarHeight
))); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 void syncRenderObject(UINode old) { | 208 void syncRenderObject(UINode old) { |
| 207 super.syncRenderObject(old); | 209 super.syncRenderObject(old); |
| 208 _toolbar = syncChild(_toolbar, old is Scaffold ? old._toolbar : null, Scaffo
ldSlots.toolbar); | 210 _toolbar = syncChild(_toolbar, old is Scaffold ? old._toolbar : null, Scaffo
ldSlots.toolbar); |
| 209 _body = syncChild(_body, old is Scaffold ? old._body : null, ScaffoldSlots.b
ody); | 211 _body = syncChild(_body, old is Scaffold ? old._body : null, ScaffoldSlots.b
ody); |
| 210 _statusbar = syncChild(_statusbar, old is Scaffold ? old._statusbar : null,
ScaffoldSlots.statusBar); | 212 _statusbar = syncChild(_statusbar, old is Scaffold ? old._statusbar : null,
ScaffoldSlots.statusBar); |
| 211 _drawer = syncChild(_drawer, old is Scaffold ? old._drawer : null, ScaffoldS
lots.drawer); | 213 _drawer = syncChild(_drawer, old is Scaffold ? old._drawer : null, ScaffoldS
lots.drawer); |
| 212 _floatingActionButton = syncChild(_floatingActionButton, old is Scaffold ? o
ld._floatingActionButton : null, ScaffoldSlots.floatingActionButton); | 214 _floatingActionButton = syncChild(_floatingActionButton, old is Scaffold ? o
ld._floatingActionButton : null, ScaffoldSlots.floatingActionButton); |
| 213 } | 215 } |
| 214 | 216 |
| 215 } | 217 } |
| OLD | NEW |