FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
115 stars 19 forks source link

SwipeableStack widget. Card slippage when swiping #3521

Open dmenshikov opened 1 month ago

dmenshikov commented 1 month ago

Can we access your project?

Current Behavior

When you swipe a card in a stack, the next card in line is also swipe.

Expected Behavior

When you swipe a card in a stack, the next card in the queue is displayed.

Steps to Reproduce

  1. Add widget SwipeableStack
  2. Setting up a query to a collection from firebase. Query type "List of documents".Filter by parameter "training" = "false"
  3. Setting up the action when swiping a card down. When the card is swiped down, the current document changes the parameter from "false" to "true"
  4. Start testing
  5. Swipe the card down. Slowly. It will be more visible this way.

Reproducible from Blank

Bug Report Code (Required)

IT4gjMrlvJFIochE1rruLe9V/SQXNnI+a4c0utoaRQgaCIz2B7M+Y/ilVEpVOPG0T0FtPlmZrGcJ7t3emvHTL/VdZE6Ybp84/rViURXzRkCWeKqnBcyOf25/AplYBVTH1MOJvR54IrNuLS0M2F7zCe6UdAzaHpO3DUgvR+aYJZOK2SrDX1iXc2URm05KZDPz

Visual documentation

screencast

Environment

- FlutterFlow version: FlutterFlow v4.1.79+ released July 30, 2024
Flutter version is 3.22.2
- Platform: Web
- Browser name and version: Chrome, V 127.0.6533.73, official
- Operating system and version affected: Mac OS Sanoma 14.5 (23F79)

Additional Information

If a card is marked for practice, it should not be in the vocabulary card pile.

Alezanello commented 1 month ago

Hello!

I've been able to replicate this issue. It seems that the card in the back is being skipped for some reason. This doesn't happen when the query is set to Single Time Query. To investigate further, I created a test case that checks both scenarios and resets the fields to a false state, with a list at the bottom to see the status of each card. I'll send this to the engineering team for a closer look and a possible fix. Feel free to run the test I made in case you notice something I didn't: Test Case.

One thing you can try, though I haven't tested it myself, is to query the documents in the action builder "On Page Load" and set the documents in a list of documents in the page state. When you swipe the card down, you could remove the card from the list of documents variable and update Firebase based on that reference. This way, the Dynamic Children are generated based on the Page State list of documents variable and not a streaming query.

Best regards,
Azanello

dmenshikov commented 1 month ago

Hello Azanello,

Thank you for your detailed response and for replicating the issue. I will wait for the engineering team's feedback.

In the meantime, I'll test the solution you suggested and see how it works.