You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No MediaQuery ancestor could be found starting from the context that was passed to MediaQuery.of(). #333
@lizhuoyuan please suggest or add working solution as most of developers getting same error after upgrading to 5.1.1
I have tried both solutions mentioned in document but not working.
I have static file which has all Dimensions with static key
这样可以解决问题,我想可能是(flutter2.8)的问题,更改了某些渲染问题?
This can solve the problem. I think it may be the problem of (fluent 2.8), which has changed some rendering problems?
Activity
fly-qp commentedon Jan 31, 2022
Experiencing the same problem on version 5.1.0. Downgrading to version 5.0.4 fixed this issue for me.
kishangohel commentedon Feb 1, 2022
@lizhuoyuan please suggest or add working solution as most of developers getting same error after upgrading to 5.1.1
I have tried both solutions mentioned in document but not working.
I have static file which has all Dimensions with
statickeytechouse commentedon Feb 1, 2022
Duplicate of #329
@kishangohel check my comment here how I dealt with the issue #329 (comment)
error404sushant commentedon Feb 3, 2022
Remove device preview and wrap Screen Util with MaterialApp. That will fix the crash.
BahelanBaishan commentedon Feb 3, 2022
W2NJL commentedon Feb 4, 2022
This was absolutely destroying me tonight and I thought it was something I did. So glad to find this thread.
kishangohel commentedon Feb 4, 2022
I want device preview to test multiple device UI behaviour. So I can't remove it.
sohrabonline commentedon Feb 6, 2022
add ScreenUtil.setContext(context); in builder
error404sushant commentedon Feb 7, 2022
Found the fix
Main.dart
void main() {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp, DeviceOrientation.portraitDown])
.then((_) {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: App()));
});
}
App.dart
return ScreenUtilInit(
builder: (){
return MaterialApp(
theme: ThemeData(
fontFamily: "LatoRegular"
),
debugShowCheckedModeBanner: false,
routes: {
'/splash':(context)=>SplashScreen()
},initialRoute: "/splash",
);
},
//designSize: Size(screenWidth,screenHeight),
);