You can actually extract the widget defined inside the builder function into a stateful widget and then use setState() inside the extracted widget as usual. This will also work.