"_debugCurrentBuildTarget == context is not true" on page reload
2,748
Finally, I got it fixed!!! I'm using cloud_firestore in my app, the userId I was trying to access in my widget tree was not yet available at the time of render. I figured this out by wrapping the root widget return statement in a trycatch block, as soon as I did this, The error stopped since its being handled and I printed the error to the console, then I returned a progress loader in the catch block.
Author by
AbdulGafar Olamide Ajao
A Fullstack (Web, Mobile, Desktop, Backend) developer, with so much love for VueJs and Flutter.
Updated on December 21, 2022Comments
-
AbdulGafar Olamide Ajao over 1 year
I get the below error whenever I refresh a page in my flutter web project
_debugCurrentBuildTarget == context is not true at Object.throw_ [as throw] (errors.dart:216) at Object.assertFailed (errors.dart:26) at framework.dart:2611 at framework.BuildOwner.new.buildScope (framework.dart:2614) at RenderObjectToWidgetAdapter.new.attachToRenderTree (binding.dart:1044) at binding$5.WidgetsFlutterBinding.new.attachRootWidget (binding.dart:924) at binding.dart:906 at internalCallback (isolate_helper.dart:50)
-
Adelina almost 4 yearsCould u show your code, are u using
MediaQuery.of(context)
somewhere? -
AbdulGafar Olamide Ajao almost 4 yearsI use
MediaQuery.of(context)
a lot and the issue happens on all pages
-