Skip to content

Feature : support for a list of 2 items #8

@giboin

Description

@giboin

Description

Hi everyone, thanks for this amazing package!
Here is my problem : I need to display a slider of 2 elements like this :

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-06-20.at.16.18.47.mp4

(sorry for the performance of this demo, not my best work here 😅)

Because of the assert itemCountBefore + itemCountAfter +1 >= children.length, I need to specify either itemCountBefore = 0 or itemCountAfter = 0.
If I say that itemCountAfter = 0, then when the first item is selected, we don't see the second one.
If I say that itemCountBefore = 0, then when the second item is selected we won't see the first one.

Ideas on how to solve

  • We could allow to pass any value to itemCountAfter and itemCountBefore, and virtually add SizedBow.shrink to children (by virtually I mean that they are rendered by the slider but the controller and the scrollPosition can't go to them)
  • Maybe find a way to keep rendering every children that stay on the screen, so that I can say itemCountAfter = 1 and itemCountBefore = 0 but the first item doesn't disappear when the second one is selected

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions