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

Unified Diff: sky/examples/stocks-fn/lib/stock_app.dart

Issue 1027813002: Introduce Scaffold to Sky framework (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | sky/framework/components/drawer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/stocks-fn/lib/stock_app.dart
diff --git a/sky/examples/stocks-fn/lib/stock_app.dart b/sky/examples/stocks-fn/lib/stock_app.dart
index 87f5e6dca7706b6947b6b880276559e4e569a808..c2ef40d7a4f955f612bee3910aba6760e15709fc 100644
--- a/sky/examples/stocks-fn/lib/stock_app.dart
+++ b/sky/examples/stocks-fn/lib/stock_app.dart
@@ -11,6 +11,7 @@ import 'package:sky/framework/components/input.dart';
import 'package:sky/framework/components/menu_divider.dart';
import 'package:sky/framework/components/menu_item.dart';
import 'package:sky/framework/components/popup_menu.dart';
+import 'package:sky/framework/components/scaffold.dart';
import 'package:sky/framework/fn.dart';
import 'package:sky/framework/theme/typography.dart' as typography;
import 'stock_data.dart';
@@ -22,14 +23,6 @@ class StocksApp extends App {
DrawerController _drawerController = new DrawerController();
PopupMenuController _menuController;
- static Style _style = new Style('''
- display: flex;
- flex-direction: column;
- height: -webkit-fill-available;
- ${typography.typeface};
- ${typography.black.body1};'''
- );
-
static Style _iconStyle = new Style('''
padding: 8px;'''
);
@@ -40,10 +33,6 @@ class StocksApp extends App {
${typography.white.title};'''
);
- static Style _stocklistHeight = new Style('''
- flex: 1;'''
- );
-
List<Stock> _sortedStocks;
bool _isSearching = false;
bool _isShowingMenu = false;
@@ -114,7 +103,7 @@ class StocksApp extends App {
title = new Text('Stocks');
}
- var toolbar = new ActionBar(
+ var actionBar = new ActionBar(
children: [
new EventTarget(
new Icon(key: 'menu', style: _iconStyle,
@@ -141,25 +130,10 @@ class StocksApp extends App {
]
);
- 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);
-
- var children = [
- new Container(
- key: 'Content',
- style: _style,
- children: [toolbar, list]
- ),
- fab,
- drawer
- ];
+ List<Node> overlays = [];
if (_menuController != null) {
- var menu = new EventTarget(
+ overlays.add(new EventTarget(
new StockMenu(controller: _menuController),
onGestureTap: (_) {
// TODO(abarth): We should close the menu when you tap away from the
@@ -169,10 +143,16 @@ class StocksApp extends App {
_menuController = null;
});
}
- );
- children.add(menu);
+ ));
}
- return new Container(key: 'StocksApp', children: children);
+ return new Scaffold(
+ actionBar: actionBar,
+ content: new Stocklist(stocks: _sortedStocks, query: _searchQuery),
+ fab: new FloatingActionButton(
+ content: new Icon(type: 'content/add_white', size: 24), level: 3),
+ drawer: drawer,
+ overlays: overlays
+ );
}
}
« no previous file with comments | « no previous file | sky/framework/components/drawer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698