Expandable - How to collapse by action or set "Expanded" conditionally ?

Widgets & Design

The FlutterFlow Expandable widget has the "Tap Body To Collapse" feature. This also works perfectly!

However, only if the content in the body itself does not define an "OnTap" action. Then the expandable is not closed.

(In my case, I have a ListView in the expanded area and a value is selected when I "OnTap" on a row. The "Expandable" should then close.

How can I achieve this? (Close "Dialog", "Drawer" etc. did not work)

I have also tried to make the expanded status dependent on a state management variable "isExpanded/Bool".

When clicking on a ListItem I could then set this to False.

Unfortunately, the Expandable Properties / Active View / Expanded

property to a StateVariable.

Does anyone have a solution, I would be very grateful!

Translated with DeepL.com (free version)

What have you tried so far?
  • I tried to close the Expandable with a Close "Dialog", "Drawer" Action --> No success

  • I tried to make the Expanded State dependend on a State Variable --> Expandable Property can't be binded to variable.

Did you check FlutterFlow's Documentation for this topic?
No
10
4 replies