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

Unified Diff: sky/framework/fn.dart

Issue 1128743003: [Effen] Convert action_bar.dart to using a FlexContainer. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: make the 'direction' argument have a default value 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
« no previous file with comments | « sky/framework/components/action_bar.dart ('k') | sky/framework/layout.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/fn.dart
diff --git a/sky/framework/fn.dart b/sky/framework/fn.dart
index 78672cef03e26a44518c6b2cc199ae49f8ecf27b..1a1118c07e56a04fcb7f0cf7d067e53e6d3bef28 100644
--- a/sky/framework/fn.dart
+++ b/sky/framework/fn.dart
@@ -543,6 +543,37 @@ class Container extends SkyElementWrapper {
);
}
+class FlexContainer extends SkyElementWrapper {
+
+ RenderCSSFlex _root;
+ RenderCSSFlex _createNode() => new RenderCSSFlex(this, this.direction);
+
+ static final FlexContainer _emptyContainer = new FlexContainer();
+ // direction doesn't matter if it's empty
+
+ SkyNodeWrapper get _emptyNode => _emptyContainer;
+
+ final FlexDirection direction;
+
+ FlexContainer({
+ Object key,
+ List<UINode> children,
+ Style style,
+ String inlineStyle,
+ this.direction: FlexDirection.Row
+ }) : super(
+ key: key,
+ children: children,
+ style: style,
+ inlineStyle: inlineStyle
+ );
+
+ void _syncNode(UINode old) {
+ super._syncNode(old);
+ _root.direction = direction;
+ }
+}
+
class Image extends SkyElementWrapper {
RenderCSSImage _root;
« no previous file with comments | « sky/framework/components/action_bar.dart ('k') | sky/framework/layout.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698