| OLD | NEW |
| 1 library stocksapp; | 1 library stocksapp; |
| 2 | 2 |
| 3 import '../../framework/fn.dart'; | 3 import '../../framework/fn.dart'; |
| 4 import '../data/stocks.dart'; | 4 import '../data/stocks.dart'; |
| 5 import '../fn/widgets/widgets.dart'; | 5 import '../fn/widgets/widgets.dart'; |
| 6 import 'dart:math'; | 6 import 'dart:math'; |
| 7 | 7 |
| 8 part 'stockarrow.dart'; | 8 part 'stockarrow.dart'; |
| 9 part 'stocklist.dart'; | 9 part 'stocklist.dart'; |
| 10 part 'stockrow.dart'; | 10 part 'stockrow.dart'; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 static Style _iconStyle = new Style(''' | 24 static Style _iconStyle = new Style(''' |
| 25 padding: 8px; | 25 padding: 8px; |
| 26 margin: 0 4px;''' | 26 margin: 0 4px;''' |
| 27 ); | 27 ); |
| 28 | 28 |
| 29 static Style _titleStyle = new Style(''' | 29 static Style _titleStyle = new Style(''' |
| 30 flex: 1; | 30 flex: 1; |
| 31 margin: 0 4px;''' | 31 margin: 0 4px;''' |
| 32 ); | 32 ); |
| 33 | 33 |
| 34 StocksApp() : super(); | 34 List<Stock> _sortedStocks; |
| 35 |
| 36 StocksApp() : super() { |
| 37 _sortedStocks = oracle.stocks; |
| 38 _sortedStocks.sort((a, b) => a.symbol.compareTo(b.symbol)); |
| 39 } |
| 35 | 40 |
| 36 Node build() { | 41 Node build() { |
| 37 var drawer = new Drawer( | 42 var drawer = new Drawer( |
| 38 animation: _drawerAnimation, | 43 animation: _drawerAnimation, |
| 39 children: [ | 44 children: [ |
| 40 new DrawerHeader( | 45 new DrawerHeader( |
| 41 children: [new Text('Stocks')] | 46 children: [new Text('Stocks')] |
| 42 ), | 47 ), |
| 43 new MenuItem( | 48 new MenuItem( |
| 44 key: 'Inbox', | 49 key: 'Inbox', |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 91 |
| 87 var fab = new FloatingActionButton(content: new Icon( | 92 var fab = new FloatingActionButton(content: new Icon( |
| 88 type: 'content/add_white', size: 24)); | 93 type: 'content/add_white', size: 24)); |
| 89 | 94 |
| 90 return new Container( | 95 return new Container( |
| 91 key: 'StocksApp', | 96 key: 'StocksApp', |
| 92 children: [ | 97 children: [ |
| 93 new Container( | 98 new Container( |
| 94 key: 'Content', | 99 key: 'Content', |
| 95 style: _style, | 100 style: _style, |
| 96 children: [toolbar, new Stocklist(stocks: oracle.stocks)] | 101 children: [toolbar, new Stocklist(stocks: _sortedStocks)] |
| 97 ), | 102 ), |
| 98 fab, | 103 fab, |
| 99 drawer, | 104 drawer, |
| 100 ] | 105 ] |
| 101 ); | 106 ); |
| 102 } | 107 } |
| 103 } | 108 } |
| OLD | NEW |