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

Side by Side Diff: sky/examples/stocks-fn/stockarrow.dart

Issue 1006053002: Allow Effen Styles to be extendable (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: sdfsd 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 | « no previous file | sky/examples/stocks-fn/stockrow.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 styles: [_style], 77 style: _style,
78 children: [ 78 children: [
79 new Container( 79 new Container(
80 inlineStyle: 'border-$type-color: $border', 80 inlineStyle: 'border-$type-color: $border',
81 styles: [up ? _upStyle : _downStyle] 81 style: up ? _upStyle : _downStyle
82 ) 82 )
83 ] 83 ]
84 ); 84 );
85 } 85 }
86 } 86 }
OLDNEW
« no previous file with comments | « no previous file | sky/examples/stocks-fn/stockrow.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698