I am having trouble finding the source to this exception, and the app is quite complex so it is hard to show any relevant part of the code. This is my repository at the poin
As a workaround wrap your code that calling setState into WidgetsBinding.addPostFrameCallback:
setState
WidgetsBinding.addPostFrameCallback:
WidgetsBinding.instance .addPostFrameCallback((_) => setState(() {}));
That way you can be sure it gets executed after the current widget is built.