OLD | NEW |
1 library stocksapp; | 1 library stocksapp; |
2 | 2 |
3 import '../../framework/fn.dart'; | 3 import '../../framework/fn.dart'; |
4 import '../../framework/components/drawer.dart'; | 4 import '../../framework/components/drawer.dart'; |
5 import '../../framework/components/drawer_header.dart'; | 5 import '../../framework/components/drawer_header.dart'; |
6 import '../../framework/components/fixed_height_scrollable.dart'; | 6 import '../../framework/components/fixed_height_scrollable.dart'; |
7 import '../../framework/components/floating_action_button.dart'; | 7 import '../../framework/components/floating_action_button.dart'; |
8 import '../../framework/components/icon.dart'; | 8 import '../../framework/components/icon.dart'; |
9 import '../../framework/components/input.dart'; | 9 import '../../framework/components/input.dart'; |
10 import '../../framework/components/material.dart'; | 10 import '../../framework/components/material.dart'; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 void _handleSearchQueryChanged(query) { | 58 void _handleSearchQueryChanged(query) { |
59 setState(() { | 59 setState(() { |
60 _searchQuery = query; | 60 _searchQuery = query; |
61 }); | 61 }); |
62 } | 62 } |
63 | 63 |
64 Node build() { | 64 Node build() { |
65 var drawer = new Drawer( | 65 var drawer = new Drawer( |
66 animation: _drawerAnimation, | 66 animation: _drawerAnimation, |
| 67 level: 3, |
67 children: [ | 68 children: [ |
68 new DrawerHeader( | 69 new DrawerHeader( |
69 children: [new Text('Stocks')] | 70 children: [new Text('Stocks')] |
70 ), | 71 ), |
71 new MenuItem( | 72 new MenuItem( |
72 key: 'Inbox', | 73 key: 'Inbox', |
73 icon: 'content/inbox', | 74 icon: 'content/inbox', |
74 children: [new Text('Inbox')] | 75 children: [new Text('Inbox')] |
75 ), | 76 ), |
76 new MenuDivider( | 77 new MenuDivider( |
(...skipping 19 matching lines...) Expand all Loading... |
96 Node title; | 97 Node title; |
97 if (_isSearching) { | 98 if (_isSearching) { |
98 title = new Input(focused: true, placeholder: 'Search stocks', | 99 title = new Input(focused: true, placeholder: 'Search stocks', |
99 onChanged: _handleSearchQueryChanged); | 100 onChanged: _handleSearchQueryChanged); |
100 } else { | 101 } else { |
101 title = new Text('I am a stocks app'); | 102 title = new Text('I am a stocks app'); |
102 } | 103 } |
103 | 104 |
104 var toolbar = new Toolbar( | 105 var toolbar = new Toolbar( |
105 children: [ | 106 children: [ |
106 new Icon(key: 'menu', style: _iconStyle, | 107 new Icon(key: 'menu', styles: [_iconStyle], |
107 size: 24, | 108 size: 24, |
108 type: 'navigation/menu_white') | 109 type: 'navigation/menu_white') |
109 ..events.listen('click', _drawerAnimation.toggle), | 110 ..events.listen('click', _drawerAnimation.toggle), |
110 new Container( | 111 new Container( |
111 style: _titleStyle, | 112 styles: [_titleStyle], |
112 children: [title] | 113 children: [title] |
113 ), | 114 ), |
114 new Icon(key: 'search', style: _iconStyle, | 115 new Icon(key: 'search', styles: [_iconStyle], |
115 size: 24, | 116 size: 24, |
116 type: 'action/search_white') | 117 type: 'action/search_white') |
117 ..events.listen('click', _handleSearchClick), | 118 ..events.listen('click', _handleSearchClick), |
118 new Icon(key: 'more_white', style: _iconStyle, | 119 new Icon(key: 'more_white', styles: [_iconStyle], |
119 size: 24, | 120 size: 24, |
120 type: 'navigation/more_vert_white') | 121 type: 'navigation/more_vert_white') |
121 ] | 122 ] |
122 ); | 123 ); |
123 | 124 |
124 var list = new Stocklist(stocks: _sortedStocks, query: _searchQuery); | 125 var list = new Stocklist(stocks: _sortedStocks, query: _searchQuery); |
125 | 126 |
126 var fab = new FloatingActionButton(content: new Icon( | 127 var fab = new FloatingActionButton(content: new Icon( |
127 type: 'content/add_white', size: 24)); | 128 type: 'content/add_white', size: 24), level: 3); |
128 | 129 |
129 return new Container( | 130 return new Container( |
130 key: 'StocksApp', | 131 key: 'StocksApp', |
131 children: [ | 132 children: [ |
132 new Container( | 133 new Container( |
133 key: 'Content', | 134 key: 'Content', |
134 style: _style, | 135 styles: [_style], |
135 children: [toolbar, list] | 136 children: [toolbar, list] |
136 ), | 137 ), |
137 fab, | 138 fab, |
138 drawer, | 139 drawer, |
139 ] | 140 ] |
140 ); | 141 ); |
141 } | 142 } |
142 } | 143 } |
OLD | NEW |