hyzp_ybqx-Commit167:解决在下列页面 hysh_content_new.dart、fhycx_content_new.dart、tsjj_content_new.dart、today_list_zpjl_content_new.dart 中,当图片组件缩放后,点击文本输入框软键盘弹起遮挡文本输入框组件的问题
全局搜索“ScrollPhysics scrollPhysics”,需要修改4个文件内容: hysh_content_new.dart 131 fhycx_content_new.dart 137 tsjj_content_new.dart 602 today_list_zpjl_content_new.dart 147
This commit is contained in:
@@ -135,6 +135,11 @@ class _FhycxPageState extends State<FhycxContentNew> {
|
|||||||
|
|
||||||
// 使用自定义 my_flutter_drag_scale 插件,完美解决Listview滚动与图片缩放拖动之间的手势冲突,不会消耗点击事件,滚动很灵敏
|
// 使用自定义 my_flutter_drag_scale 插件,完美解决Listview滚动与图片缩放拖动之间的手势冲突,不会消耗点击事件,滚动很灵敏
|
||||||
ScrollPhysics scrollPhysics;
|
ScrollPhysics scrollPhysics;
|
||||||
|
|
||||||
|
// 若 scrollPhysics0 赋值为 PageScrollPhysics(),图片组件缩放后,点击文本输入框软键盘弹起会遮挡文本输入框组件
|
||||||
|
// 将 scrollPhysics0 赋值为 AlwaysScrollableScrollPhysics(),问题解决
|
||||||
|
ScrollPhysics scrollPhysics0 = AlwaysScrollableScrollPhysics();
|
||||||
|
|
||||||
bool bZoomedInit = true; // 图片是否为原样大小
|
bool bZoomedInit = true; // 图片是否为原样大小
|
||||||
Widget getNetworkImage(String url) {
|
Widget getNetworkImage(String url) {
|
||||||
return CachedNetworkImage(
|
return CachedNetworkImage(
|
||||||
@@ -150,13 +155,13 @@ class _FhycxPageState extends State<FhycxContentNew> {
|
|||||||
scaleChangedCallback: (ScaleChangedModel model) {
|
scaleChangedCallback: (ScaleChangedModel model) {
|
||||||
print("model.scale = ${model.scale}");
|
print("model.scale = ${model.scale}");
|
||||||
bZoomedInit = (1.0 == model.scale);
|
bZoomedInit = (1.0 == model.scale);
|
||||||
scrollPhysics = PageScrollPhysics();
|
scrollPhysics = scrollPhysics0;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
pointerDownCallback: () {
|
pointerDownCallback: () {
|
||||||
if (bZoomedInit) {
|
if (bZoomedInit) {
|
||||||
if (scrollPhysics != PageScrollPhysics()) {
|
if (scrollPhysics != PageScrollPhysics()) {
|
||||||
scrollPhysics = PageScrollPhysics();
|
scrollPhysics = scrollPhysics0;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -167,7 +172,7 @@ class _FhycxPageState extends State<FhycxContentNew> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
pointerUpCallback: () {
|
pointerUpCallback: () {
|
||||||
scrollPhysics = PageScrollPhysics();
|
scrollPhysics = scrollPhysics0;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -145,6 +145,11 @@ class _LoginPageState extends State<TsjjContentNew> with SingleTickerProviderSta
|
|||||||
|
|
||||||
// 使用自定义 my_flutter_drag_scale 插件,完美解决Listview滚动与图片缩放拖动之间的手势冲突,不会消耗点击事件,滚动很灵敏
|
// 使用自定义 my_flutter_drag_scale 插件,完美解决Listview滚动与图片缩放拖动之间的手势冲突,不会消耗点击事件,滚动很灵敏
|
||||||
ScrollPhysics scrollPhysics;
|
ScrollPhysics scrollPhysics;
|
||||||
|
|
||||||
|
// 若 scrollPhysics0 赋值为 PageScrollPhysics(),图片组件缩放后,点击文本输入框软键盘弹起会遮挡文本输入框组件
|
||||||
|
// 将 scrollPhysics0 赋值为 AlwaysScrollableScrollPhysics(),问题解决
|
||||||
|
ScrollPhysics scrollPhysics0 = AlwaysScrollableScrollPhysics();
|
||||||
|
|
||||||
bool bZoomedInit = true; // 图片是否为原样大小
|
bool bZoomedInit = true; // 图片是否为原样大小
|
||||||
Widget getNetworkImage(String url) {
|
Widget getNetworkImage(String url) {
|
||||||
return CachedNetworkImage(
|
return CachedNetworkImage(
|
||||||
@@ -160,13 +165,13 @@ class _LoginPageState extends State<TsjjContentNew> with SingleTickerProviderSta
|
|||||||
scaleChangedCallback: (ScaleChangedModel model) {
|
scaleChangedCallback: (ScaleChangedModel model) {
|
||||||
print("model.scale = ${model.scale}");
|
print("model.scale = ${model.scale}");
|
||||||
bZoomedInit = (1.0 == model.scale);
|
bZoomedInit = (1.0 == model.scale);
|
||||||
scrollPhysics = PageScrollPhysics();
|
scrollPhysics = scrollPhysics0;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
pointerDownCallback: () {
|
pointerDownCallback: () {
|
||||||
if (bZoomedInit) {
|
if (bZoomedInit) {
|
||||||
if (scrollPhysics != PageScrollPhysics()) {
|
if (scrollPhysics != PageScrollPhysics()) {
|
||||||
scrollPhysics = PageScrollPhysics();
|
scrollPhysics = scrollPhysics0;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -177,7 +182,7 @@ class _LoginPageState extends State<TsjjContentNew> with SingleTickerProviderSta
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
pointerUpCallback: () {
|
pointerUpCallback: () {
|
||||||
scrollPhysics = PageScrollPhysics();
|
scrollPhysics = scrollPhysics0;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -129,6 +129,11 @@ class _TodayListZpjlPageState extends State<TodayListZpjlContentNew> {
|
|||||||
|
|
||||||
// 使用自定义 my_flutter_drag_scale 插件,完美解决Listview滚动与图片缩放拖动之间的手势冲突,不会消耗点击事件,滚动很灵敏
|
// 使用自定义 my_flutter_drag_scale 插件,完美解决Listview滚动与图片缩放拖动之间的手势冲突,不会消耗点击事件,滚动很灵敏
|
||||||
ScrollPhysics scrollPhysics;
|
ScrollPhysics scrollPhysics;
|
||||||
|
|
||||||
|
// 若 scrollPhysics0 赋值为 PageScrollPhysics(),图片组件缩放后,点击文本输入框软键盘弹起会遮挡文本输入框组件
|
||||||
|
// 将 scrollPhysics0 赋值为 AlwaysScrollableScrollPhysics(),问题解决
|
||||||
|
ScrollPhysics scrollPhysics0 = AlwaysScrollableScrollPhysics();
|
||||||
|
|
||||||
bool bZoomedInit = true; // 图片是否为原样大小
|
bool bZoomedInit = true; // 图片是否为原样大小
|
||||||
Widget getNetworkImage(String url) {
|
Widget getNetworkImage(String url) {
|
||||||
return CachedNetworkImage(
|
return CachedNetworkImage(
|
||||||
@@ -144,13 +149,13 @@ class _TodayListZpjlPageState extends State<TodayListZpjlContentNew> {
|
|||||||
scaleChangedCallback: (ScaleChangedModel model) {
|
scaleChangedCallback: (ScaleChangedModel model) {
|
||||||
print("model.scale = ${model.scale}");
|
print("model.scale = ${model.scale}");
|
||||||
bZoomedInit = (1.0 == model.scale);
|
bZoomedInit = (1.0 == model.scale);
|
||||||
scrollPhysics = PageScrollPhysics();
|
scrollPhysics = scrollPhysics0;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
pointerDownCallback: () {
|
pointerDownCallback: () {
|
||||||
if (bZoomedInit) {
|
if (bZoomedInit) {
|
||||||
if (scrollPhysics != PageScrollPhysics()) {
|
if (scrollPhysics != PageScrollPhysics()) {
|
||||||
scrollPhysics = PageScrollPhysics();
|
scrollPhysics = scrollPhysics0;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -161,7 +166,7 @@ class _TodayListZpjlPageState extends State<TodayListZpjlContentNew> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
pointerUpCallback: () {
|
pointerUpCallback: () {
|
||||||
scrollPhysics = PageScrollPhysics();
|
scrollPhysics = scrollPhysics0;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user