-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flutter 3.10.1不管使用哪种方式都会反复重绘 #484
Comments
是这样的,在 3.10 版本的 Flutter 中: 而且在 3.7 版本的 Flutter 中,设置 求解决求解决求解决!!! In Flutter version 3.10 it works like this: Moreover in Flutter version 3.7, setting useInheritedMediaQuery to true will also not rebuild the page. Please help to resolve this issue!!! |
因为这是一个很严重的问题。 As this is a serious issue. In addition, I am hoping to use version 3.10 of Flutter and will investigate whether other screen adaptation libraries have similar issues. As a last resort, I may consider replacing flutter_screenutil with another library. I hope that the developers can resolve this issue as soon as possible. Best regards! |
With flutter 3.10.1 I have the same problem, is there a solution? |
exactly same issue as me now |
I have the same problem. The phone heats up a lot because of the frequent redraws |
Same problem here, is there a solution? |
1 similar comment
Same problem here, is there a solution? |
Same problem here |
Same issue here |
If you update flutter & screenutil to the latest version, you need to check all the stateless widget that have In my issue, the keyboard immediately close after tap the text field and the pages are rebuild everytime the user typing using keyboard. Hope this help. |
最新的版本 5.8.3 在我的项目中已经解决了这个问题。 记得几个要点:
|
The whole app is still rebuilding on 5.8.3. Opening keyboard by tapping on a text field first closes the keyboard and lands me to home page. |
我写了一个 demo,加了一个断点。在每次 iOS 端从前台把 App 退到后台的时候,断点都会走两遍。
|
5.8.2 5.8.3 使用ScreenUtilInit方式不会有问题,使用另一种方式回跳到启动页一直重绘。只能改成ScreenUtilInit方式使用了。 |
|
好吧,谢谢。其实我的 demo 也是没问题的,因为 5.8.3 版本的 useInheritedMediaQuery 默认值为 false。确实 HomePage 不会重新 build 了。感谢您的贡献。 |
I don't know why everybody is partying here. But the issue still exists. I am using Flutter What is the issue about it? Please fix that. When using Flutter 3.7.7 there is no problem with that. PS: It has to do smth with this plugin, cause removing it or just not using the |
Do you mean that when you click the textfield, the keyboard will pop up and close? Can you provide a small demo? |
Exactly, clicking on a text field anywhere in the app will cause the keyboard to instantly close and I am back on the initial route of the app. This is my
|
I made up an example repository showing up the bug. On investigation, it seems to me like it is occurring when using the go_router package. https://github.com/ChinaeduO/screenutil_bug Please check it out it tell me what you think. |
@ChinaeduO , I've seen your code. Avoid using functions inside any builder method. That will cause them to be executed anytime a dependency changed, in this case ScreenUtilInit builder deps: padding, viewInsets. return ScreenUtilInit(
builder: (_, child) => child!,
child: MaterialApp.router(
title: 'Flutter Demo',
routerConfig: GoRouter(
initialLocation: '/',
routes: [
GoRoute(
path: '/',
builder: (context, state) => const MyHomePage(
title: 'Flutter Demo Home Page',
),
),
],
),
),
); Or also, if you want to use ScreenUtil in MaterialApp.router properties: final router = GoRouter(
initialLocation: '/',
routes: [
GoRoute(
path: '/',
builder: (context, state) => const MyHomePage(
title: 'Flutter Demo Home Page',
),
),
],
);
return ScreenUtilInit(
builder: (_, __) => MaterialApp.router(
title: 'Flutter Demo',
routerConfig: router,
// property that will use ScreenUtil
theme: ...
),
); |
@ChinaeduO |
flutter 3.10.1不管使用哪种方式都会反复重绘 screenutil 5.8.2。
例如在页面上添加输入框,打开页面后就会跳转到启动页一直重绘。
The text was updated successfully, but these errors were encountered: