Skip to content

Commit

Permalink
Merge pull request #35 from AshishSingh2001/fix/issue-34
Browse files Browse the repository at this point in the history
fix(issue-34): dispose child when duration is zero
  • Loading branch information
martijn00 authored Aug 1, 2024
2 parents 2636cf0 + 2979f31 commit 1e39513
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/src/image/fade_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ class _FadeWidgetState extends State<FadeWidget>

hideWidget = false;
if (widget.direction == AnimationDirection.reverse) {
opacity.addStatusListener(animationStatusChange);
if (widget.duration == Duration.zero) {
hideWidget = true;
} else {
opacity.addStatusListener(animationStatusChange);
}
}
}

Expand All @@ -85,7 +89,11 @@ class _FadeWidgetState extends State<FadeWidget>

hideWidget = false;
if (widget.direction == AnimationDirection.reverse) {
opacity.addStatusListener(animationStatusChange);
if (widget.duration == Duration.zero) {
hideWidget = true;
} else {
opacity.addStatusListener(animationStatusChange);
}
}
}

Expand Down

0 comments on commit 1e39513

Please sign in to comment.