SwipeTo icon indicating copy to clipboard operation
SwipeTo copied to clipboard

Right/Left Swipe Not Provided

Open varindergroove opened this issue 1 year ago • 5 comments

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

varindergroove avatar Jan 25 '24 09:01 varindergroove

Hi @varindergroove Would you be able to provide more information here or a sample psudo code to reproduce this same at a time? Thanks.

Purvik avatar Feb 13 '24 09:02 Purvik

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 image

this code add in didUpdateWidget method,

varindergroove avatar Feb 15 '24 12:02 varindergroove

@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 avatar Mar 04 '24 14:03 Purvik

@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 avatar Mar 05 '24 04:03 varindergroove

@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.

Purvik avatar Mar 05 '24 09:03 Purvik