hyzp_ybqx-Commit166:解决在审核页面hysh_content_new.dart,当图片组件缩放后,点击文本输入框软键盘弹起遮挡文本输入框组件的问题
// 若 scrollPhysics0 赋值为 PageScrollPhysics(),图片组件缩放后,点击文本输入框软键盘弹起会遮挡文本输入框组件 // 将 scrollPhysics0 赋值为 AlwaysScrollableScrollPhysics(),问题解决 ScrollPhysics scrollPhysics0 = AlwaysScrollableScrollPhysics();
This commit is contained in:
@@ -596,6 +596,11 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
|
|||||||
|
|
||||||
// 使用自定义 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(
|
||||||
@@ -611,13 +616,13 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
|
|||||||
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 {
|
||||||
@@ -628,7 +633,7 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
pointerUpCallback: () {
|
pointerUpCallback: () {
|
||||||
scrollPhysics = PageScrollPhysics();
|
scrollPhysics = scrollPhysics0;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -924,7 +929,11 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
|
|||||||
),
|
),
|
||||||
//: Container(),
|
//: Container(),
|
||||||
//type 'Container' is not a subtype of type 'PreferredSizeWidget'
|
//type 'Container' is not a subtype of type 'PreferredSizeWidget'
|
||||||
body: listGetZpjl.isNotEmpty
|
body: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
FocusScope.of(context).requestFocus(FocusNode());
|
||||||
|
},
|
||||||
|
child: listGetZpjl.isNotEmpty
|
||||||
? TabBarView(
|
? TabBarView(
|
||||||
controller: _tabController,
|
controller: _tabController,
|
||||||
//注意:用TabController实现顶部tab切换,必须添加该行
|
//注意:用TabController实现顶部tab切换,必须添加该行
|
||||||
@@ -990,6 +999,7 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
|
|||||||
: getMoreWidget(color: Colors.black38, size: 20.0, strokeWidth: 2.0), //显示加载中的圈圈
|
: getMoreWidget(color: Colors.black38, size: 20.0, strokeWidth: 2.0), //显示加载中的圈圈
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user