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
When using flutter_screenutil with device_preview, the MediaQueryData may not be updated correctly, causing widgets to use the physical device's dimensions instead of the preview dimensions. This can be resolved by configuring ScreenUtil correctly.
Solution
Ensure ScreenUtil.configure is used to update the MediaQueryData within the ScreenUtilInit builder. Here's an example:
Thanks @paulocagol, although your code snippet helped me, I still have to do a hot-restart so the changes update (correctly on every preview-ed device). But it's still better than before.
Issue Description
When using
flutter_screenutil
withdevice_preview
, theMediaQueryData
may not be updated correctly, causing widgets to use the physical device's dimensions instead of the preview dimensions. This can be resolved by configuringScreenUtil
correctly.Solution
Ensure
ScreenUtil.configure
is used to update theMediaQueryData
within theScreenUtilInit
builder. Here's an example:Additional Information
This ensures the MediaQueryData from device_preview is used correctly by ScreenUtil.
References
I hope it helps
The text was updated successfully, but these errors were encountered: