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 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<CommunityDetails>
inputKey,
hintText,
isKeyBoardShow,
keyboard_height,
keyboard,
emojiShowing,
commentFocus,

5
lib/community/community_view/class_details.dart

@ -55,7 +55,6 @@ class _ClassDetails extends State<ClassDetails> 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<ClassDetails> 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<ClassDetails> 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<ClassDetails> with WidgetsBindingObserver {
inputKey,
hintText,
isKeyBoardShow,
keyboard_height,
keyboard,
emojiShowing,
commentFocus,

2
lib/community/new_community_details.dart

@ -57,7 +57,6 @@ class _NewCommunityDetails extends State<NewCommunityDetails> 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<NewCommunityDetails> with WidgetsBindin
inputKey,
hintText,
isKeyBoardShow,
keyboard_height,
keyboard,
emojiShowing,
commentFocus,

62
lib/mine/recharge_page.dart

@ -327,37 +327,37 @@ class _RechargePage extends State<RechargePage> {
),
),
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),
],
),
),
],
),
),

3
lib/web/web_page.dart

@ -52,7 +52,6 @@ class _WebPage extends State<WebPage> 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<WebPage> 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<WebPage> with WidgetsBindingObserver {
inputKey,
hintText,
isKeyBoardShow,
keyboard_height,
keyboard,
emojiShowing,
commentFocus,

2
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,

Loading…
Cancel
Save