Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: sky/framework/fn.dart

Issue 1134163003: [Effen] Use the checkbox widget in the stocks app. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fix tests Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/framework/fn.dart
diff --git a/sky/framework/fn.dart b/sky/framework/fn.dart
index 29caedab9276e9801743d4acb639129d1846c760..906b7078ae63ad1ed24338ed68a8d2f8c7b9b151 100644
--- a/sky/framework/fn.dart
+++ b/sky/framework/fn.dart
@@ -320,31 +320,6 @@ class EventListenerNode extends ContentNode {
}
}
-class Text extends SkyNodeWrapper {
- final String data;
-
- // Text nodes are special cases of having non-unique keys (which don't need
- // to be assigned as part of the API). Since they are unique in not having
- // children, there's little point to reordering, so we always just re-assign
- // the data.
- Text(this.data) : super(key:'*text*');
-
- static final Text _emptyText = new Text(null);
-
- SkyNodeWrapper get _emptyNode => _emptyText;
-
- RenderCSSText _root;
- RenderCSS _createNode() {
- return new RenderCSSText(this, this.data);
- }
-
- void _syncNode(SkyNodeWrapper old) {
- if (old == _emptyText)
- return; // we set inside _createNode();
- _root.data = data;
- }
-}
-
final List<UINode> _emptyList = new List<UINode>();
abstract class SkyElementWrapper extends SkyNodeWrapper {
@@ -594,6 +569,36 @@ class FlexContainer extends SkyElementWrapper {
}
}
+class Text extends SkyElementWrapper {
+
+ RenderCSSText _root;
+ RenderCSSText _createNode() => new RenderCSSText(this, this.data);
+
+ static final Text _emptyText = new Text('');
+
+ SkyNodeWrapper get _emptyNode => _emptyText;
+
+ final String data;
+
+ // Text nodes are special cases of having non-unique keys (which don't need
+ // to be assigned as part of the API). Since they are unique in not having
+ // children, there's little point to reordering, so we always just re-assign
+ // the data.
+ Text(this.data, {
+ Style style,
+ String inlineStyle
+ }) : super(
+ key: '*text*',
+ style: style,
+ inlineStyle: inlineStyle
+ );
+
+ void _syncNode(UINode old) {
+ super._syncNode(old);
+ _root.data = data;
+ }
+}
+
class Image extends SkyElementWrapper {
RenderCSSImage _root;

Powered by Google App Engine
This is Rietveld 408576698