diff --git a/examples/stocks2/lib/stock_app.dart b/examples/stocks2/lib/stock_app.dart index 84ac7c08a9..6888a4dec2 100644 --- a/examples/stocks2/lib/stock_app.dart +++ b/examples/stocks2/lib/stock_app.dart @@ -20,7 +20,7 @@ import 'package:sky/widgets/popup_menu.dart'; import 'package:sky/widgets/radio.dart'; import 'package:sky/widgets/scaffold.dart'; import 'package:sky/widgets/tool_bar.dart'; -import 'package:sky/widgets/ui_node.dart'; +import 'package:sky/widgets/widget.dart'; import 'stock_data.dart'; import 'stock_list.dart'; @@ -151,7 +151,7 @@ class StocksApp extends App { ); } - UINode buildToolBar() { + Widget buildToolBar() { return new ToolBar( left: new IconButton( icon: 'navigation/menu_white', @@ -170,7 +170,7 @@ class StocksApp extends App { } // TODO(abarth): Should we factor this into a SearchBar in the framework? - UINode buildSearchBar() { + Widget buildSearchBar() { return new ToolBar( left: new IconButton( icon: 'navigation/arrow_back_grey600', @@ -183,7 +183,7 @@ class StocksApp extends App { ); } - void addMenuToOverlays(List overlays) { + void addMenuToOverlays(List overlays) { if (_menuController == null) return; overlays.add(new ModalOverlay( @@ -195,8 +195,8 @@ class StocksApp extends App { onDismiss: _handleMenuHide)); } - UINode build() { - List overlays = [ + Widget build() { + List overlays = [ new Scaffold( toolbar: _isSearching ? buildSearchBar() : buildToolBar(), body: new Stocklist(stocks: _stocks, query: _searchQuery), @@ -214,8 +214,8 @@ class StocksApp extends App { void main() { print("starting stocks app!"); App app = new StocksApp(); - UINodeAppView.appView.onFrame = () { + WidgetAppView.appView.onFrame = () { // uncomment this for debugging: - // UINodeAppView.appView.debugDumpRenderTree(); + // WidgetAppView.appView.debugDumpRenderTree(); }; } diff --git a/examples/stocks2/lib/stock_arrow.dart b/examples/stocks2/lib/stock_arrow.dart index 3b717f9eda..893f37526b 100644 --- a/examples/stocks2/lib/stock_arrow.dart +++ b/examples/stocks2/lib/stock_arrow.dart @@ -28,7 +28,7 @@ class StockArrow extends Component { return colors.Red[_colorIndexForPercentChange(percentChange)]; } - UINode build() { + Widget build() { // TODO(jackson): This should change colors with the theme Color color = _colorForPercentChange(percentChange); const double kSize = 40.0; diff --git a/examples/stocks2/lib/stock_list.dart b/examples/stocks2/lib/stock_list.dart index f2c20641fb..4b36783d18 100644 --- a/examples/stocks2/lib/stock_list.dart +++ b/examples/stocks2/lib/stock_list.dart @@ -25,7 +25,7 @@ class Stocklist extends FixedHeightScrollable { super.syncFields(source); } - List buildItems(int start, int count) { + List buildItems(int start, int count) { var filteredStocks = stocks.where((stock) { return query == null || stock.symbol.contains(new RegExp(query, caseSensitive: false)); diff --git a/examples/stocks2/lib/stock_menu.dart b/examples/stocks2/lib/stock_menu.dart index 2b9df0b894..3d6450d27a 100644 --- a/examples/stocks2/lib/stock_menu.dart +++ b/examples/stocks2/lib/stock_menu.dart @@ -20,7 +20,7 @@ class StockMenu extends Component { final bool autorefresh; final ValueChanged onAutorefreshChanged; - UINode build() { + Widget build() { var checkbox = new Checkbox( value: this.autorefresh, onChanged: this.onAutorefreshChanged diff --git a/examples/stocks2/lib/stock_row.dart b/examples/stocks2/lib/stock_row.dart index 32f1c81fe7..7e3ee7d163 100644 --- a/examples/stocks2/lib/stock_row.dart +++ b/examples/stocks2/lib/stock_row.dart @@ -19,13 +19,13 @@ class StockRow extends Component { static const double kHeight = 79.0; - UINode build() { + Widget build() { String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}"; String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%"; if (stock.percentChange > 0) changeInPrice = "+" + changeInPrice; - List children = [ + List children = [ new Container( child: new StockArrow(percentChange: stock.percentChange), margin: const EdgeDims.only(right: 5.0)), diff --git a/examples/widgets/container.dart b/examples/widgets/container.dart index e049abe89f..68e734864d 100644 --- a/examples/widgets/container.dart +++ b/examples/widgets/container.dart @@ -8,7 +8,7 @@ import 'package:sky/widgets/raised_button.dart'; import 'package:sky/widgets/basic.dart'; class ContainerApp extends App { - UINode build() { + Widget build() { return new Flex([ new Container( key: 'a', diff --git a/examples/widgets/hello_widgets.dart b/examples/widgets/hello_widgets.dart index 59b6a230d1..bc914c8d24 100644 --- a/examples/widgets/hello_widgets.dart +++ b/examples/widgets/hello_widgets.dart @@ -5,7 +5,7 @@ import 'package:sky/widgets/basic.dart'; class HelloWorldApp extends App { - UINode build() { + Widget build() { return new Text('Hello, fn2!'); } } diff --git a/examples/raw/navigation.dart b/examples/widgets/navigation.dart similarity index 100% rename from examples/raw/navigation.dart rename to examples/widgets/navigation.dart diff --git a/examples/widgets/sector.dart b/examples/widgets/sector.dart index af1f1b98d8..e8beeaf8b1 100644 --- a/examples/widgets/sector.dart +++ b/examples/widgets/sector.dart @@ -14,7 +14,7 @@ import 'package:sky/widgets/material.dart'; import 'package:sky/widgets/raised_button.dart'; import 'package:sky/widgets/scaffold.dart'; import 'package:sky/widgets/tool_bar.dart'; -import 'package:sky/widgets/ui_node.dart'; +import 'package:sky/widgets/widget.dart'; import '../rendering/sector_layout.dart'; @@ -72,7 +72,7 @@ class SectorApp extends App { }); } - UINode build() { + Widget build() { return new Scaffold( toolbar: new ToolBar( center: new Text('Sector Layout in a Widget Tree', style: white.title), @@ -91,7 +91,7 @@ class SectorApp extends App { new Container( padding: new EdgeDims.all(4.0), margin: new EdgeDims.only(right: 10.0), - child: new UINodeToRenderBoxAdapter(sectorAddIcon) + child: new WidgetToRenderBoxAdapter(sectorAddIcon) ), new Text('ADD SECTOR'), ]) @@ -106,7 +106,7 @@ class SectorApp extends App { new Container( padding: new EdgeDims.all(4.0), margin: new EdgeDims.only(right: 10.0), - child: new UINodeToRenderBoxAdapter(sectorRemoveIcon) + child: new WidgetToRenderBoxAdapter(sectorRemoveIcon) ), new Text('REMOVE SECTOR'), ]) @@ -124,7 +124,7 @@ class SectorApp extends App { border: new Border.all(new BorderSide(color: new Color(0xFF000000))) ), padding: new EdgeDims.all(8.0), - child: new UINodeToRenderBoxAdapter(sectors) + child: new WidgetToRenderBoxAdapter(sectors) ) ), ], @@ -138,8 +138,8 @@ class SectorApp extends App { void main() { App app = new SectorApp(); - UINodeAppView.appView.onFrame = () { + WidgetAppView.appView.onFrame = () { // uncomment this for debugging: - // UINodeAppView.appView.debugDumpRenderTree(); + // WidgetAppView.appView.debugDumpRenderTree(); }; } diff --git a/examples/widgets/spinning_mixed.dart b/examples/widgets/spinning_mixed.dart index 4efa0dcb4c..1de1fcdf24 100644 --- a/examples/widgets/spinning_mixed.dart +++ b/examples/widgets/spinning_mixed.dart @@ -9,7 +9,7 @@ import 'package:sky/rendering/box.dart'; import 'package:sky/rendering/flex.dart'; import 'package:sky/widgets/basic.dart'; import 'package:sky/widgets/raised_button.dart'; -import 'package:sky/widgets/ui_node.dart'; +import 'package:sky/widgets/widget.dart'; import 'package:vector_math/vector_math.dart'; import '../lib/solid_color_box.dart'; @@ -26,7 +26,7 @@ void addFlexChildSolidColor(RenderFlex parent, sky.Color backgroundColor, { int class Rectangle extends Component { Rectangle(this.color, { String key }) : super(key: key); final Color color; - UINode build() { + Widget build() { return new Flexible( child: new Container( decoration: new BoxDecoration(backgroundColor: color) @@ -35,7 +35,7 @@ class Rectangle extends Component { } } -UINode builder() { +Widget builder() { return new Flex([ new Rectangle(const Color(0xFF00FFFF), key: 'a'), new Container( @@ -74,18 +74,18 @@ void rotate(double timeStamp) { } void main() { - // Because we're going to use UINodes, we want to initialise its + // Because we're going to use Widgets, we want to initialise its // AppView, not use the default one. We don't really need to do - // this, because RenderBoxToUINodeAdapter does it for us, but + // this, because RenderBoxToWidgetAdapter does it for us, but // it's good practice in case we happen to not have a - // RenderBoxToUINodeAdapter in our tree at startup, or in case we + // RenderBoxToWidgetAdapter in our tree at startup, or in case we // want a renderViewOverride. - UINodeAppView.initUINodeAppView(); + WidgetAppView.initWidgetAppView(); RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical); RenderProxyBox proxy = new RenderProxyBox(); - new RenderBoxToUINodeAdapter(proxy, builder); // adds itself to proxy + new RenderBoxToWidgetAdapter(proxy, builder); // adds itself to proxy addFlexChildSolidColor(flexRoot, const sky.Color(0xFFFF00FF), flex: 1); flexRoot.add(proxy); @@ -94,6 +94,6 @@ void main() { transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity()); RenderPadding root = new RenderPadding(padding: new EdgeDims.all(20.0), child: transformBox); - UINodeAppView.appView.root = root; + WidgetAppView.appView.root = root; addPersistentFrameCallback(rotate); }