SwipeTo
SwipeTo copied to clipboard
Right/Left Swipe Not Provided
Please resolved this issue , this is issue occur when widget update value swipe listen null to listen
please add didUpdateWidget method , in swipe_to.dart class
Hi @varindergroove Would you be able to provide more information here or a sample psudo code to reproduce this same at a time? Thanks.
I went to swipe left/right functionality disable or enable on the same widget. firstly swipe = true, after then swipe = false, but swipe functionality is enable not callback is disable. i went to proper disable functionality. I review your code , i observe your miss the didUpdateWidget code
this code add in didUpdateWidget method,
@varindergroove Well, to do that from the Widget which you've wrapped under SwipeTo
pass null dynamically based on your condition with setState
so it can take effect.
SwipeTo(
child: const Align(
alignment: Alignment.centerLeft,
child: MessageViewWidget(
label: 'Hey You! Swipe me right 👉🏿',
),
),
onRightSwipe: _swipeEnabled
? (details) {
// _displayInputBottomSheet(true);
log("Swipped");
}
: null,
)
If your case is yet different share working sample code so I can make changes.
@Purvik I same implementation like this, but in some condition same widget swipe enable and after then change condition swipe disable. but in your code your internal swipe gestures in enable because in your code if will change the state your will pass empty gestures , i share previous screenshot.
@varindergroove Seems like can be understood by an example only. If possible, please clone this package and switch to branch https://github.com/Purvik/SwipeTo/tree/PR25-on-widget-update
there we can get updated example of it. You can make change & reproduce scenario so can be taken cared further.