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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « sky/examples/stocks-fn/stocks.sky ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 library stocksapp;
2
3 import '../fn/lib/fn.dart';
4 import '../fn/widgets/widgets.dart';
5 import 'dart:collection';
6 import 'dart:math';
7 import 'dart:sky' as sky;
8
9 part 'companylist.dart';
10 part 'stockarrow.dart';
11 part 'stocklist.dart';
12 part 'stockrow.dart';
13
14 class StocksApp extends App {
15
16 DrawerAnimation _drawerAnimation = new DrawerAnimation();
17
18 static Style _style = new Style('''
19 display: flex;
20 flex-direction: column;
21 height: -webkit-fill-available;
22 font-family: 'Roboto Regular', 'Helvetica';
23 font-size: 16px;'''
24 );
25
26 static Style _iconStyle = new Style('''
27 padding: 8px;
28 margin: 0 4px;'''
29 );
30
31 static Style _titleStyle = new Style('''
32 flex: 1;
33 margin: 0 4px;'''
34 );
35
36 StocksApp() : super();
37
38 Node render() {
39 var drawer = new Drawer(
40 onPositionChanged: _drawerAnimation.onPositionChanged,
41 handleMaskFling: _drawerAnimation.handleFlingStart,
42 handleMaskTap: _drawerAnimation.handleMaskTap,
43 handlePointerCancel: _drawerAnimation.handlePointerCancel,
44 handlePointerDown: _drawerAnimation.handlePointerDown,
45 handlePointerMove: _drawerAnimation.handlePointerMove,
46 handlePointerUp: _drawerAnimation.handlePointerUp,
47 children: [
48 new DrawerHeader(
49 children: [new Text('Stocks')]
50 ),
51 new MenuItem(
52 key: 'Inbox',
53 icon: 'content/inbox',
54 children: [new Text('Inbox')]
55 ),
56 new MenuDivider(
57 ),
58 new MenuItem(
59 key: 'Drafts',
60 icon: 'content/drafts',
61 children: [new Text('Drafts')]
62 ),
63 new MenuItem(
64 key: 'Settings',
65 icon: 'action/settings',
66 children: [new Text('Settings')]
67 ),
68 new MenuItem(
69 key: 'Help & Feedback',
70 icon: 'action/help',
71 children: [new Text('Help & Feedback')]
72 )
73 ]
74 );
75
76 var toolbar = new Toolbar(
77 children: [
78 new Icon(key: 'menu', style: _iconStyle,
79 onClick: _drawerAnimation.toggle,
80 size: 24,
81 type: 'navigation/menu_white'),
82 new Container(
83 style: _titleStyle,
84 children: [new Text('I am a stocks app')]
85 ),
86 new Icon(key: 'search', style: _iconStyle,
87 size: 24,
88 type: 'action/search_white'),
89 new Icon(key: 'more_white', style: _iconStyle,
90 size: 24,
91 type: 'navigation/more_vert_white')
92 ]
93 );
94
95 return new Container(
96 key: 'StocksApp',
97 style: _style,
98 children: [drawer, toolbar, new Stocklist(stocks: oracle.stocks)]
99 );
100 }
101 }
OLDNEW
« 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