How to call setState along with a FutureBuilder in an ExpansionTile?

I’m using using ExpansionTiles to show the data received from http get method. I have to trigger a new FutureBuilder everytime the user tries to expand each one of the ExpansionTiles so as to run an asynchronous function and get the remaining data. So everytime onExpansionChanged callback I’ve to call setState then only the FutureBuilder get rebuilt to work. But when multiple ExpansionTiles are expanded and then when trying to close one ExpansionTile every other ExpansionTiles collapses with the trailing button still pointing in expanded mode. Is there a workaround for this.?

maybe u r using single variable for every expansion

you need one variable per tile

Don’t know if @iMvengeance was referring to this, but if I’m not wrong you need to use an specific key for each specific tile.

You can create a custom key for each with the index of each or something like this. That way when the user calls for a tile to collapse, flutter knows which specific tile is.