Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Expansion Direction of AnimatedContainer in ScrollablePositionedList #522

Open
PhuCG opened this issue Apr 1, 2024 · 0 comments

Comments

@PhuCG
Copy link

PhuCG commented Apr 1, 2024

Hello Team,

I am encountering an issue with the scrollable_positioned_list package while implementing a list of widgets that includes AnimatedContainer for expandable items. The intended behavior is for the AnimatedContainer to uniformly expand in a specific direction when tapped. However, during testing, I observed that the expansion direction is not consistent: at times, it expands downwards, and at other times, it expands upwards.

This erratic behavior disrupts the user experience, as the expansion direction should be predictable and uniform for all list items.

Here is the detailed behavior:

When tapping on a collapsed AnimatedContainer, the expansion sometimes occurs towards the bottom and other times towards the top, regardless of its position in the list.
The expected behavior is for the AnimatedContainer to always expand in the same direction (either always downwards or always upwards) upon user interaction.
I have attached a video below demonstrating the issue:

IMG_7437.MOV

my code:
init Controller

void initState() {
    super.initState();
    itemScrollController = ItemScrollController();
}
return ScrollablePositionedList.builder(
   initialScrollIndex: currentDataPosition,
   itemScrollController: itemScrollController,
   itemCount: displayList.length,
   itemBuilder: (BuildContext context, int index) {
            return ScenarioItem(
              scenario: displayList[index].scenarios,
              topic: displayList[index].topic,
              currentScenarioPosition: currentDataPosition,
            );
   },
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant