| 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 '../theme2/view_configuration.dart'; | 7 import '../theme2/view_configuration.dart'; |
| 8 import 'widget.dart'; | 8 import 'widget.dart'; |
| 9 | 9 |
| 10 enum ScaffoldSlots { | 10 enum ScaffoldSlots { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 Widget _toolbar; | 175 Widget _toolbar; |
| 176 Widget _body; | 176 Widget _body; |
| 177 Widget _statusBar; | 177 Widget _statusBar; |
| 178 Widget _drawer; | 178 Widget _drawer; |
| 179 Widget _floatingActionButton; | 179 Widget _floatingActionButton; |
| 180 | 180 |
| 181 RenderScaffold get root => super.root; | 181 RenderScaffold get root => super.root; |
| 182 RenderScaffold createNode() => new RenderScaffold(); | 182 RenderScaffold createNode() => new RenderScaffold(); |
| 183 | 183 |
| 184 void insert(RenderObjectWrapper child, ScaffoldSlots slot) { | 184 void insertChildRoot(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 detachChildRoot(RenderObjectWrapper child) { | 188 void detachChildRoot(RenderObjectWrapper child) { |
| 189 final root = this.root; // TODO(ianh): Remove this once the analyzer is clev
erer | 189 final root = this.root; // TODO(ianh): Remove this once the analyzer is clev
erer |
| 190 assert(root is RenderScaffold); | 190 assert(root is RenderScaffold); |
| 191 assert(root == child.root.parent); | 191 assert(root == child.root.parent); |
| 192 root.remove(child.root); | 192 root.remove(child.root); |
| 193 assert(root == this.root); // TODO(ianh): Remove this once the analyzer is c
leverer | 193 assert(root == this.root); // TODO(ianh): Remove this once the analyzer is c
leverer |
| 194 } | 194 } |
| (...skipping 15 matching lines...) Expand all 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 |