This reverts commit b39e315e5cb9a9c51ebdf3242a108084378a1d9b.
This commit is contained in:
parent
90a3d8e3ca
commit
a9151779aa
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'dart:ui' show Color, Rect, Size, hashValues;
|
import 'dart:ui' show Color, Size, Rect;
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
@ -260,21 +260,6 @@ class Tween<T extends dynamic> extends Animatable<T> {
|
|||||||
return lerp(t);
|
return lerp(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
return hashValues(begin, end);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(dynamic other) {
|
|
||||||
if (identical(this, other))
|
|
||||||
return true;
|
|
||||||
if (other.runtimeType != runtimeType)
|
|
||||||
return false;
|
|
||||||
final Tween<T> typedOther = other;
|
|
||||||
return typedOther.begin == begin && typedOther.end == end;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => '$runtimeType($begin \u2192 $end)';
|
String toString() => '$runtimeType($begin \u2192 $end)';
|
||||||
}
|
}
|
||||||
|
@ -93,18 +93,4 @@ void main() {
|
|||||||
expect(tween.lerp(0.5), 100.0);
|
expect(tween.lerp(0.5), 100.0);
|
||||||
expect(tween.lerp(1.0), 100.0);
|
expect(tween.lerp(1.0), 100.0);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Tween equals', () {
|
|
||||||
final Tween<double> doubleTween1 = Tween<double>(begin: 10, end: 22);
|
|
||||||
final Tween<double> doubleTween2 = Tween<double>(begin: 10, end: 22);
|
|
||||||
final Tween<double> doubleTween3 = Tween<double>(begin: 33, end: 44);
|
|
||||||
final Tween<int> intTween = Tween<int>(begin: 33, end: 44);
|
|
||||||
final Tween<double> constantTween = ConstantTween<double>(10);
|
|
||||||
|
|
||||||
expect(doubleTween1 == doubleTween1, isTrue);
|
|
||||||
expect(doubleTween1 == doubleTween2, isTrue);
|
|
||||||
expect(doubleTween2 == doubleTween3, isFalse);
|
|
||||||
expect(doubleTween2 == intTween, isFalse);
|
|
||||||
expect(doubleTween1 == constantTween, isFalse);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user