I am new to flutter, BUILT an app showing graphs in flutter. When i run the code a red screen is appearing showing the above error
No MediaQuery widget ancestor found. Scaffold widgets require a MediaQuery widget ancestor.
I have cleared all the errors except this one.
2
Answers
Wrap your scaffold to MatertialApp or you can make a class and in that class call GraphScreen like this
Check you
main.dart
, and in the MyApp (Or whatever you named it) class, you should wrap it with MaterialApp. It should fix the problem.