OLD | NEW |
1 part of stocksapp; | 1 part of stocksapp; |
2 | 2 |
3 class StockArrow extends Component { | 3 class StockArrow extends Component { |
4 | 4 |
5 double percentChange; | 5 double percentChange; |
6 | 6 |
7 static Style _style = new Style(''' | 7 static Style _style = new Style(''' |
8 width: 40px; | 8 width: 40px; |
9 height: 40px; | 9 height: 40px; |
10 display: flex; | 10 display: flex; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 return _kRedColors[_colorIndexForPercentChange(percentChange)]; | 67 return _kRedColors[_colorIndexForPercentChange(percentChange)]; |
68 } | 68 } |
69 | 69 |
70 Node build() { | 70 Node build() { |
71 String border = _colorForPercentChange(percentChange).toString(); | 71 String border = _colorForPercentChange(percentChange).toString(); |
72 bool up = percentChange > 0; | 72 bool up = percentChange > 0; |
73 String type = up ? 'bottom' : 'top'; | 73 String type = up ? 'bottom' : 'top'; |
74 | 74 |
75 return new Container( | 75 return new Container( |
76 inlineStyle: 'border-color: $border', | 76 inlineStyle: 'border-color: $border', |
77 style: _style, | 77 styles: [_style], |
78 children: [ | 78 children: [ |
79 new Container( | 79 new Container( |
80 inlineStyle: 'border-$type-color: $border', | 80 inlineStyle: 'border-$type-color: $border', |
81 style: up ? _upStyle : _downStyle | 81 styles: [up ? _upStyle : _downStyle] |
82 ) | 82 ) |
83 ] | 83 ] |
84 ); | 84 ); |
85 } | 85 } |
86 } | 86 } |
OLD | NEW |