英文:
After updating to Flutter 3.10 : screen not scrolling up when keyboard appears / ResizeToAvoidBottomInset stopped working
问题
I have updated flutter sdk to latest 3.10.0 and dart 3 then screen not scrolling up when keyboard appears in android, mostly when a text field get focus. Before this update it was working fine in flutter sdk version 3.7 etc..
尝试使用
resizeToAvoidBottomInset: false / true
SingleChildScrollView - reverse - true 等
英文:
I have updated flutter sdk to latest 3.10.0 and dart 3 then screen not scrolling up when keyboard appears in android, mostly when a text field get focus. Before this update it was working fine in flutter sdk version 3.7 etc..
Tried using
resizeToAvoidBottomInset: false / true
SingleSchildScrollView -reverse - true etc
答案1
得分: 7
更新:最新版本的 ScreenUtil(5.8.2)更改了 useInheritedMediaQuery 的默认值为 true
根据 github 中的讨论,我已在我的应用程序中解决了这个问题。
这个问题可以通过将 ScreenUtil 升级到最新版本(5.8.1)并设置 useInheritedMediaQuery = true
来解决。
flutter_screenutil: ^5.8.1
ScreenUtilInit(
useInheritedMediaQuery: true,
designSize: const Size(376, 812),
builder: (context, child) {
return const Scaffold(
resizeToAvoidBottomInset: true,
body: Column(
children: [
Spacer(),
TextField(),
],
),
);
},
);
英文:
Update :- latest version of ScreenUtil (5.8.2) they changed useInheritedMediaQuery default value to true
As per the discussion in github I have fixed this issue in my app.
This issue can be fixed by
Upgrading ScreenUtil to latest (5.8.1) and setting
useInheritedMediaQuery = true
flutter_screenutil: ^5.8.1
ScreenUtilInit(
useInheritedMediaQuery: true,
designSize: const Size(376, 812),
builder: (context, child) {
return const Scaffold(
resizeToAvoidBottomInset: true,
body: Column(
children: [
Spacer(),
TextField(),
],
),
);
},
);
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论