hyzp_ybqx-Commit166:解决在审核页面hysh_content_new.dart,当图片组件缩放后,点击文本输入框软键盘弹起遮挡文本输入框组件的问题

// 若 scrollPhysics0 赋值为 PageScrollPhysics(),图片组件缩放后,点击文本输入框软键盘弹起会遮挡文本输入框组件
  // 将 scrollPhysics0 赋值为 AlwaysScrollableScrollPhysics(),问题解决
  ScrollPhysics scrollPhysics0 = AlwaysScrollableScrollPhysics();
master
WinUser01 4 years ago
parent a975cef186
commit 8150e6e517

@ -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,70 +929,75 @@ 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(
? TabBarView( onTap: () {
controller: _tabController, FocusScope.of(context).requestFocus(FocusNode());
//TabControllertab },
physics: NeverScrollableScrollPhysics(), child: listGetZpjl.isNotEmpty
//TabBarViewTabBarView-OK ? TabBarView(
// children: controller: _tabController,
// (topTabs_map['listView_List'].isNotEmpty) ? topTabs_map['listView_List'] : [], //TabControllertab
physics: NeverScrollableScrollPhysics(),
// https://blog.csdn.net/shulianghan/article/details/104953053 //TabBarViewTabBarView-OK
// // children:
// int length : // (topTabs_map['listView_List'].isNotEmpty) ? topTabs_map['listView_List'] : [],
// E generator(int index) : , index
// List list_generate = List.generate(3, ( index ) => index * 3); // https://blog.csdn.net/shulianghan/article/details/104953053
// children: List.generate(3, (index) => Container()), //
children: List.generate(topTabs_map['listView_List'].length, (index) { // int length :
return ListView( // E generator(int index) : , index
// physics: NeverScrollableScrollPhysics(), // ListView // List list_generate = List.generate(3, ( index ) => index * 3);
// physics: null, // ListView // children: List.generate(3, (index) => Container()),
physics: scrollPhysics, children: List.generate(topTabs_map['listView_List'].length, (index) {
children: [ return ListView(
Container( // physics: NeverScrollableScrollPhysics(), // ListView
decoration: new BoxDecoration( // physics: null, // ListView
color: Color.fromRGBO(244, 244, 244, 1), physics: scrollPhysics,
), children: [
child: Column( Container(
children: <Widget>[ decoration: new BoxDecoration(
//1 color: Color.fromRGBO(244, 244, 244, 1),
getHdAndPlay(index), ),
//2 child: Column(
getWztp(index), children: <Widget>[
SizedBox(height: ScreenUtil().setHeight(_marginVer)), //1
//3 getHdAndPlay(index),
getWztpSmxx(index), //2
SizedBox(height: ScreenUtil().setHeight(_marginVer)), getWztp(index),
//4 SizedBox(height: ScreenUtil().setHeight(_marginVer)),
widget.hyshlx == 'hyfh' ? getHycsResult(index) : SizedBox.shrink(), //3
//RadioRadioListItems getWztpSmxx(index),
//5-6 SizedBox(height: ScreenUtil().setHeight(_marginVer)),
HyshGroup( //4
index: index, widget.hyshlx == 'hyfh' ? getHycsResult(index) : SizedBox.shrink(),
hyshlx: hyshlx, //RadioRadioListItems
fontSize: _fontSize, //5-6
size: Size(_listTileHeight, _listTileHeight), HyshGroup(
id: widget.id, index: index,
selectedRadio: hyshlx: hyshlx,
hyshlx == 'hyfh' && mapGetHycsShenheData['title'] == "非黑烟车" fontSize: _fontSize,
? 1 size: Size(_listTileHeight, _listTileHeight),
: 0, id: widget.id,
), selectedRadio:
//RadioRadioListItems hyshlx == 'hyfh' && mapGetHycsShenheData['title'] == "非黑烟车"
// SizedBox(height: 6), ? 1
// Divider(height: 1.0, color: Colors.blue), : 0,
// SizedBox(height: 10), ),
// //9 //RadioRadioListItems
// getShqr(index), // SizedBox(height: 6),
], // Divider(height: 1.0, color: Colors.blue),
// SizedBox(height: 10),
// //9
// getShqr(index),
],
),
), ),
), ],
], );
); }),
}), )
) : getMoreWidget(color: Colors.black38, size: 20.0, strokeWidth: 2.0), //
: getMoreWidget(color: Colors.black38, size: 20.0, strokeWidth: 2.0), // ),
), ),
), ),
); );

Loading…
Cancel
Save