FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
130 stars 26 forks source link

Using the `Swipable Stack Current Element` causes build to fail #2324

Closed untersalmberger closed 9 months ago

untersalmberger commented 9 months ago

Has your issue been reported?

Current Behavior

Using the Swipable Stack Current Element value on an Image widget's Path property, when the Image widgets are generated as children within the SwipeableStack widget, causes the build to fail.

Expected Behavior

Using the Swipable Stack Current Element value on an Image widget's Path property, when the Image widgets are generated as children within the SwipeableStack widget, should show the images with their respective paths in the swipeable stack.

Steps to Reproduce

  1. Start a new project w/o firebase
  2. Add an app constant of type ImagePath and call it theImagePaths, make it a list, add a few items
  3. Create a new page
  4. Place the SwipeableStack widget on the page
  5. Select the SwipeableStack widget, go to Generating Children From Variable, give the variable a name (like imagePaths) and set the value of the variable to the before created constant theImagePaths, save the variable
  6. Remove all SwipeableStack pages except the first
  7. On the remaining SwipeableStack page select the Image widget, set the Path property to Swipable Stack Current Element
  8. Run the app in test mode

Reproducible from Blank

Bug Report Code (Required)

IT8ghc+A5Yh1ocdD7q6JY8dFijoUCDs/a7gvjupqEAgafJSvBI13duP8XExDXbGBam1cJWaGmm0zwMmLhdrAU+0nCByJbLpZ/5N+TjvNTni5V7a2CJaOZUB6TOlMC0vDzpuZrRZAAO12LlVm3WGMG+eiVgPDQrmxDEYZBPykB9/XnVapHADgG30Jg1ZSfCvr

Context

I am currently blocked to build a more complex swipeable stack where access to the current element (in my case a struct with arrays included) is required to build the elements within the swipable stack. Usually there is a workaround to address the current element by indexing the list with the index of the current element, but when the list elements contain another list there seems to be a limitation that I cannot select the nested list.

Visual documentation

Screenshot 2024-02-09 at 16 24 19

Screenshot 2024-02-09 at 16 25 25

Additional Info

The issue is that the Image builder uses index instead of imagePathsIndex (or in fact it should use the just defined variable imagePathsItem, which currently remains unused). index is available in the event handlers, but not in the itemBuilder:

Screenshot 2024-02-09 at 16 26 47

The project with the issue can be found here: https://app.flutterflow.io/project/swipable-stack-index-issue-r66g9n?tab=uiBuilder&page=HomePage

Environment

- FlutterFlow version: 4.1
- Platform: Web, also VSCode after having pushed the source code to GitHub
- Browser name and version: Version 121.0.6167.139 (Official Build) (x86_64)
- Operating system and version affected: MacOS Sonoma Version 14.2.1
hariprasadms commented 9 months ago

Hi @untersalmberger - I looked at your project. Below variable mapping is the issue. It should be the variable from the generated from image list. Please close the issue once you are able to see it is working.

image