mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Merge pull request #198 from Hixie/card
Remove redundant operator== and hashCode functions in card example.
This commit is contained in:
commit
b30f63a7eb
@ -28,8 +28,6 @@ class CardModel {
|
||||
AnimationPerformance performance;
|
||||
String get label => "Item $value";
|
||||
String get key => value.toString();
|
||||
bool operator ==(other) => other is CardModel && other.value == value;
|
||||
int get hashCode => 373 * 37 * value.hashCode;
|
||||
}
|
||||
|
||||
class ShrinkingCard extends AnimatedComponent {
|
||||
|
||||
@ -54,11 +54,12 @@ class Timeline {
|
||||
double end: 1.0
|
||||
}) {
|
||||
assert(!_animation.isAnimating);
|
||||
|
||||
assert(duration > Duration.ZERO);
|
||||
return _animation.start(new TweenSimulation(duration, begin, end));
|
||||
}
|
||||
|
||||
Future animateTo(double target, { Duration duration }) {
|
||||
assert(duration > Duration.ZERO);
|
||||
return _start(duration: duration, begin: value, end: target);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user