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

Unified Diff: sky/examples/stocks-fn/stocksapp.dart

Issue 971183002: Initial commit of Effen reactive framework experiment for Sky (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/examples/stocks-fn/stocks.sky ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/stocks-fn/stocksapp.dart
diff --git a/sky/examples/stocks-fn/stocksapp.dart b/sky/examples/stocks-fn/stocksapp.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c9ec0359ab567e028929cfe9d8aa6553a66ede16
--- /dev/null
+++ b/sky/examples/stocks-fn/stocksapp.dart
@@ -0,0 +1,101 @@
+library stocksapp;
+
+import '../fn/lib/fn.dart';
+import '../fn/widgets/widgets.dart';
+import 'dart:collection';
+import 'dart:math';
+import 'dart:sky' as sky;
+
+part 'companylist.dart';
+part 'stockarrow.dart';
+part 'stocklist.dart';
+part 'stockrow.dart';
+
+class StocksApp extends App {
+
+ DrawerAnimation _drawerAnimation = new DrawerAnimation();
+
+ static Style _style = new Style('''
+ display: flex;
+ flex-direction: column;
+ height: -webkit-fill-available;
+ font-family: 'Roboto Regular', 'Helvetica';
+ font-size: 16px;'''
+ );
+
+ static Style _iconStyle = new Style('''
+ padding: 8px;
+ margin: 0 4px;'''
+ );
+
+ static Style _titleStyle = new Style('''
+ flex: 1;
+ margin: 0 4px;'''
+ );
+
+ StocksApp() : super();
+
+ Node render() {
+ var drawer = new Drawer(
+ onPositionChanged: _drawerAnimation.onPositionChanged,
+ handleMaskFling: _drawerAnimation.handleFlingStart,
+ handleMaskTap: _drawerAnimation.handleMaskTap,
+ handlePointerCancel: _drawerAnimation.handlePointerCancel,
+ handlePointerDown: _drawerAnimation.handlePointerDown,
+ handlePointerMove: _drawerAnimation.handlePointerMove,
+ handlePointerUp: _drawerAnimation.handlePointerUp,
+ children: [
+ new DrawerHeader(
+ children: [new Text('Stocks')]
+ ),
+ new MenuItem(
+ key: 'Inbox',
+ icon: 'content/inbox',
+ children: [new Text('Inbox')]
+ ),
+ new MenuDivider(
+ ),
+ new MenuItem(
+ key: 'Drafts',
+ icon: 'content/drafts',
+ children: [new Text('Drafts')]
+ ),
+ new MenuItem(
+ key: 'Settings',
+ icon: 'action/settings',
+ children: [new Text('Settings')]
+ ),
+ new MenuItem(
+ key: 'Help & Feedback',
+ icon: 'action/help',
+ children: [new Text('Help & Feedback')]
+ )
+ ]
+ );
+
+ var toolbar = new Toolbar(
+ children: [
+ new Icon(key: 'menu', style: _iconStyle,
+ onClick: _drawerAnimation.toggle,
+ size: 24,
+ type: 'navigation/menu_white'),
+ new Container(
+ style: _titleStyle,
+ children: [new Text('I am a stocks app')]
+ ),
+ new Icon(key: 'search', style: _iconStyle,
+ size: 24,
+ type: 'action/search_white'),
+ new Icon(key: 'more_white', style: _iconStyle,
+ size: 24,
+ type: 'navigation/more_vert_white')
+ ]
+ );
+
+ return new Container(
+ key: 'StocksApp',
+ style: _style,
+ children: [drawer, toolbar, new Stocklist(stocks: oracle.stocks)]
+ );
+ }
+}
« no previous file with comments | « sky/examples/stocks-fn/stocks.sky ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698