Can I prevent the ExpansionTile from rebuilding its children?

Viewed 338

I have an ExpansionTile widget and it contains some children, what I want is to prevent the ExpansionTile from rebuilding its children when I expand it.

Is there any basic method or will I have to do some trick?

2 Answers

just make this maintainState value true like this:

ExpansionTile(
    maintainState: true,
    children: [
    ...
    ]
)
Related