The following message was presented when an async call took longer than expected to get a version.txt file for the web build of a flutter app. The app has a custom splash screen which presents the version and build number from a txt file since PackageInfo do not work on the web.
"The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is
to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree."
Shouldn't setState automatically check this to avoid the error? Instead we have to code things like
if (mounted) {
setState(() {
Not cool
The following message was presented when an async call took longer than expected to get a version.txt file for the web build of a flutter app. The app has a custom splash screen which presents the version and build number from a txt file since PackageInfo do not work on the web.
"The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is
to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree."
Shouldn't setState automatically check this to avoid the error? Instead we have to code things like
Not cool