Bug on Expanded widget in a ListView

There is a UX bug when the Expandable widget is used in a ListView.

When an expanded item is removed from a list, the item below expands. It should stay collapsed.

Most likely the expanded state is based on the item's index id, which refers to the next item after the other is removed.

Steps to repeat

  1. Make a ListView with Container as the child widget.

  2. Add Expandable widget inside the Container. Set it with "initially expanded" as false.

  3. Connect to DB with several items for testing.

  4. Add a Button in the expanded state. Set an Action on button to remove list item from the list.

  5. View the list in Test mode.

  6. Expand a middle item with all others collapsed.

  7. Tap button to remove item from the list

  8. Observe the list on refresh

Expected: Item is removed when list refreshes. All items are collapsed.

Actual: Item is removed, but sibling below it is expanded.

1
3 replies