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 library fn; | 5 library fn; |
6 | 6 |
7 import 'app.dart'; | 7 import 'app.dart'; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:collection'; | 9 import 'dart:collection'; |
10 import 'dart:mirrors'; | 10 import 'dart:mirrors'; |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 } | 977 } |
978 | 978 |
979 abstract class App extends Component { | 979 abstract class App extends Component { |
980 | 980 |
981 App() : super(stateful: true) { | 981 App() : super(stateful: true) { |
982 _appView = new _AppView(); | 982 _appView = new _AppView(); |
983 _scheduleComponentForRender(this); | 983 _scheduleComponentForRender(this); |
984 } | 984 } |
985 | 985 |
986 AppView _appView; | 986 AppView _appView; |
| 987 AppView get appView => _appView; |
987 | 988 |
988 void _buildIfDirty() { | 989 void _buildIfDirty() { |
989 assert(_dirty); | 990 assert(_dirty); |
990 assert(!_defunct); | 991 assert(!_defunct); |
991 _trace('$_key rebuilding app...'); | 992 _trace('$_key rebuilding app...'); |
992 _sync(null, null); | 993 _sync(null, null); |
993 if (root.parent == null) | 994 if (root.parent == null) |
994 _appView.root = root; | 995 _appView.root = root; |
995 assert(root.parent is RenderView); | 996 assert(root.parent is RenderView); |
996 } | 997 } |
997 } | 998 } |
998 | 999 |
999 class Text extends Component { | 1000 class Text extends Component { |
1000 Text(this.data) : super(key: '*text*'); | 1001 Text(this.data) : super(key: '*text*'); |
1001 final String data; | 1002 final String data; |
1002 bool get interchangeable => true; | 1003 bool get interchangeable => true; |
1003 UINode build() => new Paragraph(text: data); | 1004 UINode build() => new Paragraph(text: data); |
1004 } | 1005 } |
OLD | NEW |