Closed ElshiatyTube closed 2 years ago
I fixed it temporarily by using 5.0.0+2 version and setting MaterialApp builder context to ScreenUtil, something like this:
ScreenUtilInit(
builder: (_)=>MaterialApp(
builder: (context, widget) {
ScreenUtil.setContext(context);
return widget!;
},
title: appName,
)
),
Hope to fix the issue in the latest version
@ElshiatyTube @lianfanghua , Please try with master branch and tell us if it works with you so we can ship a stable version in pub.dev.
dependencies:
flutter_screenutil:
git:
url: https://github.com/OpenFlutter/flutter_screenutil
branch: master
@Mounir-Bouaiche Great, it works fine.
@ElshiatyTube Thank you my friend for your feedback.
Hi @ElshiatyTube , I have recently published the new version of the library. Go check it out and if it works fine for you please close this issue, or else drop error log here. Thank you.
@Mounir-Bouaiche v 5.5.1 works as expected, Thanks
The following assertion was thrown building _MediaQueryFromWindow(state: _MediaQueryFromWindowState#a1453): 'package:flutter/src/widgets/framework.dart': Failed assertion: line 5356 pos 14: '() { // check that it really is our descendant Element? ancestor = dependent._parent; while (ancestor != this && ancestor != null) ancestor = ancestor._parent; return ancestor == this; }()': is not true.