Open cudajo opened 3 years ago
I too am having this issue
Starting from line 222
got me this fixed. I'm not sure about any drawbacks of this solution but I'm a bit skeptic that the things , done in this package, are done on purpose, and I'm missing something
_ac = new AnimationController(
vsync: this,
duration: const Duration(milliseconds: 300),
value: widget.defaultPanelState == PanelState.CLOSED
? 0.0
: 1.0 //set the default panel state (i.e. set initial value of _ac)
)
..addListener(() {
if (widget.onPanelSlide != null) widget.onPanelSlide!(_ac.value);
})
..addStatusListener((status) {
if (widget.onPanelOpened != null && status == AnimationStatus.completed)
widget.onPanelOpened!();
if (widget.onPanelClosed != null && status == AnimationStatus.dismissed)
widget.onPanelClosed!();
});
I have a
SlidingUpPanel
that is in closed state when I manually call the panel controller'sanimatePanelToSnapPoint()
.Listening on the different panel states as the sliding starts -
onPanelSlide(0.0)
is triggered first, but then immediately followed byonPanelClosed()
being triggered as well. After this, additionalonPanelSlide(x.x)
calls are made until the panel has reached its snap point. I assume thatonPanelClosed()
really shouldn't trigger in this case, right? As it already has triggered when the panel was closed, it should not trigger again since the panel is actually "opening"...Could someone please try to reproduce this? Am I doing (or assuming) something wrong? Thanks!