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

Unified Diff: sky/examples/stocks2/lib/stock_arrow.dart

Issue 1174023003: Remove one more use of mirrors: Components now have to explicitly sync their fields. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: sky/examples/stocks2/lib/stock_arrow.dart
diff --git a/sky/examples/stocks2/lib/stock_arrow.dart b/sky/examples/stocks2/lib/stock_arrow.dart
index a13cbe41998f85a7a469a334fc2c0fd2e41295cc..cadfb7159ca80e47cdeb23e7a0c213b793a6bc64 100644
--- a/sky/examples/stocks2/lib/stock_arrow.dart
+++ b/sky/examples/stocks2/lib/stock_arrow.dart
@@ -16,6 +16,11 @@ class StockArrow extends Component {
StockArrow({ Object key, this.percentChange }) : super(key: key);
+ void syncFields(StockArrow source) {
+ percentChange = source.percentChange;
+ super.syncFields(source);
+ }
+
int _colorIndexForPercentChange(double percentChange) {
double maxPercent = 10.0;
double normalizedPercentChange = math.min(percentChange.abs(), maxPercent) / maxPercent;

Powered by Google App Engine
This is Rietveld 408576698