diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index 6c918b2f..be23c401 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -51,7 +51,6 @@ class _CommunityDetails extends State final GlobalKey inputKey = GlobalKey(); final TextEditingController commentTextController = TextEditingController(); bool emojiShowing = false; - static double keyboard_height=300; double keyboard = -1; bool needShowSmiley = false; bool needHideSmiley = false; @@ -252,7 +251,6 @@ class _CommunityDetails extends State inputKey, hintText, isKeyBoardShow, - keyboard_height, keyboard, emojiShowing, commentFocus, diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index cc60e937..e113f7ee 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -55,7 +55,6 @@ class _ClassDetails extends State with WidgetsBindingObserver { double height = 0; var isShowMore = false; bool emojiShowing = false; - static double keyboard_height=300; double keyboard = -1; bool needShowSmiley = false; bool needHideSmiley = false; @@ -117,6 +116,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { @override void didChangeMetrics() { WidgetsBinding.instance.addPostFrameCallback((_) { + isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0; if (!mounted) return; if (MediaQuery.of(context).viewInsets.bottom == 0) { if (isKeyBoardShow) { @@ -185,7 +185,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { double h = MediaQuery.of(context).viewInsets.bottom; - if(h > 0 && keyboard <= 0) { + if(h > 0 && keyboard < h) { setState(() { keyboard = h; }); @@ -475,7 +475,6 @@ class _ClassDetails extends State with WidgetsBindingObserver { inputKey, hintText, isKeyBoardShow, - keyboard_height, keyboard, emojiShowing, commentFocus, diff --git a/lib/community/new_community_details.dart b/lib/community/new_community_details.dart index 5b904034..993222af 100644 --- a/lib/community/new_community_details.dart +++ b/lib/community/new_community_details.dart @@ -57,7 +57,6 @@ class _NewCommunityDetails extends State with WidgetsBindin String commentsId; String userId; bool emojiShowing =false; - static double keyboard_height=300; double keyboard = -1; bool needShowSmiley = false; bool needHideSmiley = false; @@ -371,7 +370,6 @@ class _NewCommunityDetails extends State with WidgetsBindin inputKey, hintText, isKeyBoardShow, - keyboard_height, keyboard, emojiShowing, commentFocus, diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index b511fea3..1889cb9e 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -327,37 +327,37 @@ class _RechargePage extends State { ), ), SizedBox(height:10.h), - // GestureDetector( - // onTap: () { - // setState(() { - // checkIndex = 3; - // }); - // }, - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Image.asset( - // "assets/image/icon_alipay.webp"), - // Expanded( - // flex: 1, - // child: Padding( - // padding: EdgeInsets.only(left: 8.w), - // child: Text( - // S.of(context).zhifubao, - // style: TextStyle( - // fontSize: 14.sp, - // color: Color(0xff353535), - // ), - // ), - // ), - // ), - // checkView(3), - // ], - // ), - // ), + GestureDetector( + onTap: () { + setState(() { + checkIndex = 3; + }); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Image.asset( + "assets/image/icon_alipay.webp"), + Expanded( + flex: 1, + child: Padding( + padding: EdgeInsets.only(left: 8.w), + child: Text( + S.of(context).zhifubao, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff353535), + ), + ), + ), + ), + checkView(3), + ], + ), + ), ], ), ), diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index 148e141d..48d27768 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -52,7 +52,6 @@ class _WebPage extends State with WidgetsBindingObserver { final ScrollController scrollController = ScrollController(); final TextEditingController commentTextController = TextEditingController(); bool emojiShowing = false; - static double keyboard_height=300; double keyboard = -1; bool needShowSmiley = false; bool needHideSmiley = false; @@ -72,6 +71,7 @@ class _WebPage extends State with WidgetsBindingObserver { @override void didChangeMetrics() { WidgetsBinding.instance.addPostFrameCallback((_) { + isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0; if (MediaQuery.of(context).viewInsets.bottom == 0) { if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); @@ -363,7 +363,6 @@ class _WebPage extends State with WidgetsBindingObserver { inputKey, hintText, isKeyBoardShow, - keyboard_height, keyboard, emojiShowing, commentFocus, diff --git a/lib/web/web_view/input_comment.dart b/lib/web/web_view/input_comment.dart index 4a11f1ae..7f919d07 100644 --- a/lib/web/web_view/input_comment.dart +++ b/lib/web/web_view/input_comment.dart @@ -13,7 +13,6 @@ class InputComment extends StatefulWidget { final Activity activity; final Article article; final bool isKeyBoardShow; - final double keyboard_height; final double keyboard; final bool emojiShowing; final FocusNode commentFocus; @@ -30,7 +29,6 @@ class InputComment extends StatefulWidget { Key key, this.hintText, this.isKeyBoardShow, - this.keyboard_height, this.keyboard, this.emojiShowing, this.commentFocus,