Browse Source

ios,优化

new_revision_app
fmk 2 years ago
parent
commit
105c0a7f88
  1. 2
      lib/community/community_details.dart
  2. 5
      lib/community/community_view/class_details.dart
  3. 2
      lib/community/new_community_details.dart
  4. 62
      lib/mine/recharge_page.dart
  5. 3
      lib/web/web_page.dart
  6. 2
      lib/web/web_view/input_comment.dart

2
lib/community/community_details.dart

@ -51,7 +51,6 @@ class _CommunityDetails extends State<CommunityDetails>
final GlobalKey inputKey = GlobalKey(); final GlobalKey inputKey = GlobalKey();
final TextEditingController commentTextController = TextEditingController(); final TextEditingController commentTextController = TextEditingController();
bool emojiShowing = false; bool emojiShowing = false;
static double keyboard_height=300;
double keyboard = -1; double keyboard = -1;
bool needShowSmiley = false; bool needShowSmiley = false;
bool needHideSmiley = false; bool needHideSmiley = false;
@ -252,7 +251,6 @@ class _CommunityDetails extends State<CommunityDetails>
inputKey, inputKey,
hintText, hintText,
isKeyBoardShow, isKeyBoardShow,
keyboard_height,
keyboard, keyboard,
emojiShowing, emojiShowing,
commentFocus, commentFocus,

5
lib/community/community_view/class_details.dart

@ -55,7 +55,6 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
double height = 0; double height = 0;
var isShowMore = false; var isShowMore = false;
bool emojiShowing = false; bool emojiShowing = false;
static double keyboard_height=300;
double keyboard = -1; double keyboard = -1;
bool needShowSmiley = false; bool needShowSmiley = false;
bool needHideSmiley = false; bool needHideSmiley = false;
@ -117,6 +116,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
@override @override
void didChangeMetrics() { void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0;
if (!mounted) return; if (!mounted) return;
if (MediaQuery.of(context).viewInsets.bottom == 0) { if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) { if (isKeyBoardShow) {
@ -185,7 +185,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double h = MediaQuery.of(context).viewInsets.bottom; double h = MediaQuery.of(context).viewInsets.bottom;
if(h > 0 && keyboard <= 0) { if(h > 0 && keyboard < h) {
setState(() { setState(() {
keyboard = h; keyboard = h;
}); });
@ -475,7 +475,6 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
inputKey, inputKey,
hintText, hintText,
isKeyBoardShow, isKeyBoardShow,
keyboard_height,
keyboard, keyboard,
emojiShowing, emojiShowing,
commentFocus, commentFocus,

2
lib/community/new_community_details.dart

@ -57,7 +57,6 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
String commentsId; String commentsId;
String userId; String userId;
bool emojiShowing =false; bool emojiShowing =false;
static double keyboard_height=300;
double keyboard = -1; double keyboard = -1;
bool needShowSmiley = false; bool needShowSmiley = false;
bool needHideSmiley = false; bool needHideSmiley = false;
@ -371,7 +370,6 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
inputKey, inputKey,
hintText, hintText,
isKeyBoardShow, isKeyBoardShow,
keyboard_height,
keyboard, keyboard,
emojiShowing, emojiShowing,
commentFocus, commentFocus,

62
lib/mine/recharge_page.dart

@ -327,37 +327,37 @@ class _RechargePage extends State<RechargePage> {
), ),
), ),
SizedBox(height:10.h), SizedBox(height:10.h),
// GestureDetector( GestureDetector(
// onTap: () { onTap: () {
// setState(() { setState(() {
// checkIndex = 3; checkIndex = 3;
// }); });
// }, },
// child: Row( child: Row(
// mainAxisAlignment: mainAxisAlignment:
// MainAxisAlignment.start, MainAxisAlignment.start,
// crossAxisAlignment: crossAxisAlignment:
// CrossAxisAlignment.start, CrossAxisAlignment.start,
// children: [ children: [
// Image.asset( Image.asset(
// "assets/image/icon_alipay.webp"), "assets/image/icon_alipay.webp"),
// Expanded( Expanded(
// flex: 1, flex: 1,
// child: Padding( child: Padding(
// padding: EdgeInsets.only(left: 8.w), padding: EdgeInsets.only(left: 8.w),
// child: Text( child: Text(
// S.of(context).zhifubao, S.of(context).zhifubao,
// style: TextStyle( style: TextStyle(
// fontSize: 14.sp, fontSize: 14.sp,
// color: Color(0xff353535), color: Color(0xff353535),
// ), ),
// ), ),
// ), ),
// ), ),
// checkView(3), checkView(3),
// ], ],
// ), ),
// ), ),
], ],
), ),
), ),

3
lib/web/web_page.dart

@ -52,7 +52,6 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
final TextEditingController commentTextController = TextEditingController(); final TextEditingController commentTextController = TextEditingController();
bool emojiShowing = false; bool emojiShowing = false;
static double keyboard_height=300;
double keyboard = -1; double keyboard = -1;
bool needShowSmiley = false; bool needShowSmiley = false;
bool needHideSmiley = false; bool needHideSmiley = false;
@ -72,6 +71,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
@override @override
void didChangeMetrics() { void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0;
if (MediaQuery.of(context).viewInsets.bottom == 0) { if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) { if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
@ -363,7 +363,6 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
inputKey, inputKey,
hintText, hintText,
isKeyBoardShow, isKeyBoardShow,
keyboard_height,
keyboard, keyboard,
emojiShowing, emojiShowing,
commentFocus, commentFocus,

2
lib/web/web_view/input_comment.dart

@ -13,7 +13,6 @@ class InputComment extends StatefulWidget {
final Activity activity; final Activity activity;
final Article article; final Article article;
final bool isKeyBoardShow; final bool isKeyBoardShow;
final double keyboard_height;
final double keyboard; final double keyboard;
final bool emojiShowing; final bool emojiShowing;
final FocusNode commentFocus; final FocusNode commentFocus;
@ -30,7 +29,6 @@ class InputComment extends StatefulWidget {
Key key, Key key,
this.hintText, this.hintText,
this.isKeyBoardShow, this.isKeyBoardShow,
this.keyboard_height,
this.keyboard, this.keyboard,
this.emojiShowing, this.emojiShowing,
this.commentFocus, this.commentFocus,

Loading…
Cancel
Save