Baseflow / octo_image

A multifunctional Flutter image widget
https://baseflow.com/
MIT License
156 stars 23 forks source link

Fade transition not disposing child when duration is zero #34

Closed AshishSingh2001 closed 1 month ago

AshishSingh2001 commented 2 months ago

🐛 Bug Report

When we use FadeWidget with direction reverse and duration zero it is not disposing the child when the animation is completed.

The root cause of this issue is that animationController doesn't give callbacks to the listener when the duration is zero

Related Issue - https://github.com/Baseflow/flutter_cached_network_image/issues/942

Expected behavior

The widget should be disposed

Reproduction steps

We are able to reproduce this with the following code, where the blinkingRedDot widget never gets disposed

BlinkingRedDot is a inifnite is widget which blinks infinitely with a animation controller

   FadeWidget(
      child: BlinkingRedDot(),
      direction: AnimationDirection.reverse,
      duration: Duration(milliseconds: 0),
    );

Configuration

Version: 2.0.0

Platform: