From e92d393467c49215b745915b57f959148062910b Mon Sep 17 00:00:00 2001 From: Hixie Date: Mon, 7 Dec 2015 14:44:53 -0800 Subject: [PATCH] AlwaysDismissedPerformance The same as AlwaysCompletePerformance but the exact opposite. --- .../lib/src/animation/performance.dart | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/flutter/lib/src/animation/performance.dart b/packages/flutter/lib/src/animation/performance.dart index 953349da5d..07686d7919 100644 --- a/packages/flutter/lib/src/animation/performance.dart +++ b/packages/flutter/lib/src/animation/performance.dart @@ -73,6 +73,25 @@ class AlwaysCompletePerformance extends PerformanceView { double get progress => 1.0; } const AlwaysCompletePerformance alwaysCompletePerformance = const AlwaysCompletePerformance(); + +class AlwaysDismissedPerformance extends PerformanceView { + const AlwaysDismissedPerformance(); + + void updateVariable(Animatable variable) { + variable.setProgress(0.0, AnimationDirection.forward); + } + + // this performance never changes state + void addListener(VoidCallback listener) { } + void removeListener(VoidCallback listener) { } + void addStatusListener(PerformanceStatusListener listener) { } + void removeStatusListener(PerformanceStatusListener listener) { } + PerformanceStatus get status => PerformanceStatus.dismissed; + AnimationDirection get direction => AnimationDirection.forward; + AnimationDirection get curveDirection => AnimationDirection.forward; + double get progress => 0.0; +} +const AlwaysDismissedPerformance alwaysDismissedPerformance = const AlwaysDismissedPerformance(); class ReversePerformance extends PerformanceView with LazyListenerMixin, LocalPerformanceStatusListenersMixin {