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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 _drawer = drawer, | 171 _drawer = drawer, |
172 _floatingActionButton = floatingActionButton, | 172 _floatingActionButton = floatingActionButton, |
173 super(key: key); | 173 super(key: key); |
174 | 174 |
175 UINode _toolbar; | 175 UINode _toolbar; |
176 UINode _body; | 176 UINode _body; |
177 UINode _statusBar; | 177 UINode _statusBar; |
178 UINode _drawer; | 178 UINode _drawer; |
179 UINode _floatingActionButton; | 179 UINode _floatingActionButton; |
180 | 180 |
181 RenderScaffold get root => super.root as RenderScaffold; | 181 RenderScaffold get root { RenderScaffold result = super.root; return result; } |
182 RenderScaffold createNode() => new RenderScaffold(); | 182 RenderScaffold createNode() => new RenderScaffold(); |
183 | 183 |
184 void insert(RenderObjectWrapper child, ScaffoldSlots slot) { | 184 void insert(RenderObjectWrapper child, ScaffoldSlots slot) { |
185 root[slot] = child != null ? child.root : null; | 185 root[slot] = child != null ? child.root : null; |
186 } | 186 } |
187 | 187 |
188 void removeChild(UINode node) { | 188 void removeChild(UINode node) { |
189 assert(node != null); | 189 assert(node != null); |
190 root.remove(node.root); | 190 root.remove(node.root); |
191 super.removeChild(node); | 191 super.removeChild(node); |
(...skipping 16 matching lines...) Expand all Loading... |
208 void syncRenderObject(UINode old) { | 208 void syncRenderObject(UINode old) { |
209 super.syncRenderObject(old); | 209 super.syncRenderObject(old); |
210 _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); |
211 _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); |
212 _statusBar = syncChild(_statusBar, old is Scaffold ? old._statusBar : null,
ScaffoldSlots.statusBar); | 212 _statusBar = syncChild(_statusBar, old is Scaffold ? old._statusBar : null,
ScaffoldSlots.statusBar); |
213 _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); |
214 _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); |
215 } | 215 } |
216 | 216 |
217 } | 217 } |
OLD | NEW |