diff --git a/examples/stocks-fn/stockarrow.dart b/examples/stocks-fn/stockarrow.dart index 82e52815d2..63cebf5502 100644 --- a/examples/stocks-fn/stockarrow.dart +++ b/examples/stocks-fn/stockarrow.dart @@ -74,11 +74,11 @@ class StockArrow extends Component { return new Container( inlineStyle: 'border-color: $border', - style: _style, + styles: [_style], children: [ new Container( inlineStyle: 'border-$type-color: $border', - style: up ? _upStyle : _downStyle + styles: [up ? _upStyle : _downStyle] ) ] ); diff --git a/examples/stocks-fn/stockrow.dart b/examples/stocks-fn/stockrow.dart index 6eb9df6480..cacb3c0d89 100644 --- a/examples/stocks-fn/stockrow.dart +++ b/examples/stocks-fn/stockrow.dart @@ -47,23 +47,23 @@ class StockRow extends Component { ), new Container( key: 'Ticker', - style: _tickerStyle, + styles: [_tickerStyle], children: [new Text(stock.symbol)] ), new Container( key: 'LastSale', - style: _lastSaleStyle, + styles: [_lastSaleStyle], children: [new Text(lastSale)] ), new Container( key: 'Change', - style: _changeStyle, + styles: [_changeStyle], children: [new Text(changeInPrice)] ) ]; return new Material( - style: _style, + styles: [_style], children: children ); } diff --git a/examples/stocks-fn/stocksapp.dart b/examples/stocks-fn/stocksapp.dart index 77cb6ef4e6..d392d659c7 100644 --- a/examples/stocks-fn/stocksapp.dart +++ b/examples/stocks-fn/stocksapp.dart @@ -64,6 +64,7 @@ class StocksApp extends App { Node build() { var drawer = new Drawer( animation: _drawerAnimation, + level: 3, children: [ new DrawerHeader( children: [new Text('Stocks')] @@ -103,19 +104,19 @@ class StocksApp extends App { var toolbar = new Toolbar( children: [ - new Icon(key: 'menu', style: _iconStyle, + new Icon(key: 'menu', styles: [_iconStyle], size: 24, type: 'navigation/menu_white') ..events.listen('click', _drawerAnimation.toggle), new Container( - style: _titleStyle, + styles: [_titleStyle], children: [title] ), - new Icon(key: 'search', style: _iconStyle, + new Icon(key: 'search', styles: [_iconStyle], size: 24, type: 'action/search_white') ..events.listen('click', _handleSearchClick), - new Icon(key: 'more_white', style: _iconStyle, + new Icon(key: 'more_white', styles: [_iconStyle], size: 24, type: 'navigation/more_vert_white') ] @@ -124,14 +125,14 @@ class StocksApp extends App { var list = new Stocklist(stocks: _sortedStocks, query: _searchQuery); var fab = new FloatingActionButton(content: new Icon( - type: 'content/add_white', size: 24)); + type: 'content/add_white', size: 24), level: 3); return new Container( key: 'StocksApp', children: [ new Container( key: 'Content', - style: _style, + styles: [_style], children: [toolbar, list] ), fab, diff --git a/examples/widgets-fn/main.sky b/examples/widgets-fn/main.sky new file mode 100644 index 0000000000..c7c304f909 --- /dev/null +++ b/examples/widgets-fn/main.sky @@ -0,0 +1,15 @@ +#!mojo mojo:sky_viewer + + + + + diff --git a/examples/widgets-fn/widgets_app.dart b/examples/widgets-fn/widgets_app.dart new file mode 100644 index 0000000000..eaaa0a58ed --- /dev/null +++ b/examples/widgets-fn/widgets_app.dart @@ -0,0 +1,12 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import '../../framework/fn.dart'; +import '../../framework/components/button.dart'; + +class WidgetsApp extends App { + Node build() { + return new Button(content: new Text('Go'), level: 1); + } +}