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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 if (_slots[ScaffoldSlots.floatingActionButton] != null) { | 118 if (_slots[ScaffoldSlots.floatingActionButton] != null) { |
119 RenderBox floatingActionButton = _slots[ScaffoldSlots.floatingActionButton
]; | 119 RenderBox floatingActionButton = _slots[ScaffoldSlots.floatingActionButton
]; |
120 Size area = new Size(size.width - kButtonX, size.height - kButtonY); | 120 Size area = new Size(size.width - kButtonX, size.height - kButtonY); |
121 floatingActionButton.layout(new BoxConstraints.loose(area)); | 121 floatingActionButton.layout(new BoxConstraints.loose(area)); |
122 assert(floatingActionButton.parentData is BoxParentData); | 122 assert(floatingActionButton.parentData is BoxParentData); |
123 floatingActionButton.parentData.position = (area - floatingActionButton.si
ze).toPoint(); | 123 floatingActionButton.parentData.position = (area - floatingActionButton.si
ze).toPoint(); |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 void paint(RenderObjectDisplayList canvas) { | 127 void paint(RenderCanvas canvas) { |
128 for (ScaffoldSlots slot in [ScaffoldSlots.body, ScaffoldSlots.statusBar, Sca
ffoldSlots.toolbar, ScaffoldSlots.floatingActionButton, ScaffoldSlots.drawer]) { | 128 for (ScaffoldSlots slot in [ScaffoldSlots.body, ScaffoldSlots.statusBar, Sca
ffoldSlots.toolbar, ScaffoldSlots.floatingActionButton, ScaffoldSlots.drawer]) { |
129 RenderBox box = _slots[slot]; | 129 RenderBox box = _slots[slot]; |
130 if (box != null) { | 130 if (box != null) { |
131 assert(box.parentData is BoxParentData); | 131 assert(box.parentData is BoxParentData); |
132 canvas.paintChild(box, box.parentData.position); | 132 canvas.paintChild(box, box.parentData.position); |
133 } | 133 } |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 void hitTestChildren(HitTestResult result, { Point position }) { | 137 void hitTestChildren(HitTestResult result, { Point position }) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 void syncRenderObject(Widget old) { | 210 void syncRenderObject(Widget old) { |
211 super.syncRenderObject(old); | 211 super.syncRenderObject(old); |
212 _toolbar = syncChild(_toolbar, old is Scaffold ? old._toolbar : null, Scaffo
ldSlots.toolbar); | 212 _toolbar = syncChild(_toolbar, old is Scaffold ? old._toolbar : null, Scaffo
ldSlots.toolbar); |
213 _body = syncChild(_body, old is Scaffold ? old._body : null, ScaffoldSlots.b
ody); | 213 _body = syncChild(_body, old is Scaffold ? old._body : null, ScaffoldSlots.b
ody); |
214 _statusBar = syncChild(_statusBar, old is Scaffold ? old._statusBar : null,
ScaffoldSlots.statusBar); | 214 _statusBar = syncChild(_statusBar, old is Scaffold ? old._statusBar : null,
ScaffoldSlots.statusBar); |
215 _drawer = syncChild(_drawer, old is Scaffold ? old._drawer : null, ScaffoldS
lots.drawer); | 215 _drawer = syncChild(_drawer, old is Scaffold ? old._drawer : null, ScaffoldS
lots.drawer); |
216 _floatingActionButton = syncChild(_floatingActionButton, old is Scaffold ? o
ld._floatingActionButton : null, ScaffoldSlots.floatingActionButton); | 216 _floatingActionButton = syncChild(_floatingActionButton, old is Scaffold ? o
ld._floatingActionButton : null, ScaffoldSlots.floatingActionButton); |
217 } | 217 } |
218 | 218 |
219 } | 219 } |
OLD | NEW |