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 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
8 import 'dart:sky' as sky; | 8 import 'dart:sky' as sky; |
9 | 9 |
10 import '../base/hit_test.dart'; | 10 import '../base/hit_test.dart'; |
11 import '../rendering/box.dart'; | 11 import '../rendering/box.dart'; |
12 import '../rendering/object.dart'; | 12 import '../rendering/object.dart'; |
13 import '../rendering/sky_binding.dart'; | 13 import '../rendering/sky_binding.dart'; |
14 | 14 |
15 export '../rendering/box.dart' show BoxConstraints, BoxDecoration, Border, Borde
rSide, EdgeDims; | 15 export '../rendering/box.dart' show BoxConstraints, BoxDecoration, Border, Borde
rSide, EdgeDims; |
16 export '../rendering/flex.dart' show FlexDirection; | 16 export '../rendering/flex.dart' show FlexDirection; |
17 export '../rendering/object.dart' show Point, Size, Rect, Color, Paint, Path; | 17 export '../rendering/object.dart' show Point, Offset, Size, Rect, Color, Paint,
Path; |
18 | 18 |
19 final bool _shouldLogRenderDuration = false; | 19 final bool _shouldLogRenderDuration = false; |
20 | 20 |
21 typedef void WidgetTreeWalker(Widget); | 21 typedef void WidgetTreeWalker(Widget); |
22 | 22 |
23 // All Effen nodes derive from Widget. All nodes have a _parent, a _key and | 23 // All Effen nodes derive from Widget. All nodes have a _parent, a _key and |
24 // can be sync'd. | 24 // can be sync'd. |
25 abstract class Widget { | 25 abstract class Widget { |
26 | 26 |
27 Widget({ String key }) : _key = key { | 27 Widget({ String key }) : _key = key { |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 if (root.parent == null) { | 999 if (root.parent == null) { |
1000 // we haven't attached it yet | 1000 // we haven't attached it yet |
1001 assert(_container.child == null); | 1001 assert(_container.child == null); |
1002 _container.child = root; | 1002 _container.child = root; |
1003 } | 1003 } |
1004 assert(root.parent == _container); | 1004 assert(root.parent == _container); |
1005 } | 1005 } |
1006 | 1006 |
1007 Widget build() => builder(); | 1007 Widget build() => builder(); |
1008 } | 1008 } |
OLD | NEW |