| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * A View that is composed of child views. | 6 * A View that is composed of child views. |
| 7 */ | 7 */ |
| 8 class CompositeView extends View { | 8 class CompositeView extends View { |
| 9 | 9 |
| 10 List<View> childViews; | 10 List<View> childViews; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 childViews.add(view); | 71 childViews.add(view); |
| 72 // TODO(rnystrom): Container shouldn't be null. Remove this check. | 72 // TODO(rnystrom): Container shouldn't be null. Remove this check. |
| 73 if (container != null) { | 73 if (container != null) { |
| 74 container.nodes.add(view.node); | 74 container.nodes.add(view.node); |
| 75 } | 75 } |
| 76 childViewAdded(view); | 76 childViewAdded(view); |
| 77 return view; | 77 return view; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void removeChild(View view) { | 80 void removeChild(View view) { |
| 81 childViews = childViews.where(bool _(e) { return view != e; }); | 81 childViews = childViews.where(bool _(e) { return view != e; }).toList(); |
| 82 // TODO(rnystrom): Container shouldn't be null. Remove this check. | 82 // TODO(rnystrom): Container shouldn't be null. Remove this check. |
| 83 if (container != null) { | 83 if (container != null) { |
| 84 view.node.remove(); | 84 view.node.remove(); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 } | 87 } |
| OLD | NEW |