Exception has occurred.
FlutterError (No MediaQuery widget ancestor found.
MyApp widgets require a MediaQuery widget ancestor.
The specific widget that could not find a MediaQuery ancestor was:
MyApp
The ownership chain for the affected widget is: "MyApp ← [root]"
No MediaQuery ancestor could be found starting from the context that was passed to MediaQuery.of(). This can happen because you have not added a WidgetsApp, CupertinoApp, or MaterialApp widget (those widgets introduce a MediaQuery), or it can happen if the context you use comes from a widget above those widgets.)
原因はこれかも
main
のrunApp
から直接呼んだWidget
でMediaQuery
を使うと駄目っぽいです。
あとは、runApp
から呼んだWidget
はMaterialApp
がないと駄目っぽい。