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

Unified Diff: packages/charted/lib/core/interpolators/interpolators.dart

Issue 2213693002: Updated charted DEP to 0.4.X (Closed) Base URL: https://github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « packages/charted/lib/core/interpolators/easing.dart ('k') | packages/charted/lib/core/scales.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/charted/lib/core/interpolators/interpolators.dart
diff --git a/packages/charted/lib/core/interpolators/interpolators.dart b/packages/charted/lib/core/interpolators/interpolators.dart
index 56dc9df7fc6ef8f275fcdca0e55b5e58d394ff8c..7be1f2429b3e31975c3763e69b7737accdfafd2b 100644
--- a/packages/charted/lib/core/interpolators/interpolators.dart
+++ b/packages/charted/lib/core/interpolators/interpolators.dart
@@ -25,7 +25,8 @@ List<InterpolatorGenerator> _interpolators = [createInterpolatorByType];
/// more interpolators are added, one of the internal implementations are
/// selected by the type of [a] and [b].
Interpolator createInterpolatorFromRegistry(a, b) {
- var fn, i = _interpolators.length;
+ Interpolator fn;
+ int i = _interpolators.length;
while (--i >= 0 && fn == null) {
fn = _interpolators[i](a, b);
}
@@ -37,17 +38,21 @@ Interpolator createInterpolatorFromRegistry(a, b) {
/// Usage note: Use this method only when type of [a] and [b] are not known.
/// When used, this function will prevent tree shaking of all built-in
/// interpolators.
-Interpolator createInterpolatorByType(a, b) => (a is List && b is List)
- ? createListInterpolator(a, b)
- : (a is Map && b is Map)
- ? createMapInterpolator(a, b)
- : (a is String && b is String)
- ? createStringInterpolator(a, b)
- : (a is num && b is num)
- ? createNumberInterpolator(a, b)
- : (a is Color && b is Color)
- ? createRgbColorInterpolator(a, b)
- : (t) => (t <= 0.5) ? a : b;
+Interpolator createInterpolatorByType(a, b) {
+ if (a is List && b is List) {
+ return createListInterpolator(a, b);
+ } else if (a is Map && b is Map) {
+ return createMapInterpolator(a, b);
+ } else if (a is String && b is String) {
+ return createStringInterpolator(a, b);
+ } else if (a is num && b is num) {
+ return createNumberInterpolator(a, b);
+ } else if (a is Color && b is Color) {
+ return createRgbColorInterpolator(a, b);
+ } else {
+ return (t) => (t <= 0.5) ? a : b;
+ }
+}
//
// Implementations of InterpolatorGenerator
« no previous file with comments | « packages/charted/lib/core/interpolators/easing.dart ('k') | packages/charted/lib/core/scales.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698