[Effen] add StyleNode

This patch adds a new (non-Render) StyleNode which takes two arguments: A (content) node, which it wraps and a Style object.

This allows for styles to be applied to Nodes which are constructed elsewhere (e.g. passed in as arguments).

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1027653002
This commit is contained in:
Rafael Weinstein
2015-03-16 12:27:25 -07:00
parent 11155a2b72
commit 7ff22a955c

View File

@@ -40,6 +40,10 @@ class StocksApp extends App {
${typography.white.title};'''
);
static Style _stocklistHeight = new Style('''
flex: 1;'''
);
List<Stock> _sortedStocks;
bool _isSearching = false;
bool _isShowingMenu = false;
@@ -137,7 +141,9 @@ class StocksApp extends App {
]
);
var list = new Stocklist(stocks: _sortedStocks, query: _searchQuery);
var list = new StyleNode(
new Stocklist(stocks: _sortedStocks, query: _searchQuery),
_stocklistHeight);
var fab = new FloatingActionButton(content: new Icon(
type: 'content/add_white', size: 24), level: 3);