For some reason whenever I use setState((){}); in the function I pass in WidgetsBinding.instance.addPostFrameCallback(), that function gets called multiple times.
Is there any way to overcome it?
Note: Both the code within and outside the setState get called.
setState((){})within the callback passed toWidgetsBinding.instance.addPostFrameCallback. So the widget re-built itself after every (successful) build.