diff --git a/circle_app/ios/Runner.xcodeproj/project.pbxproj b/circle_app/ios/Runner.xcodeproj/project.pbxproj index 3f60c23..8898677 100644 --- a/circle_app/ios/Runner.xcodeproj/project.pbxproj +++ b/circle_app/ios/Runner.xcodeproj/project.pbxproj @@ -363,19 +363,19 @@ DEVELOPMENT_TEAM = C39VUKAY2Z; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = "微乐园"; - INFOPLIST_KEY_NSCameraUsageDescription = "应用想要访问您的相机,用于设置头像/动态发布"; + INFOPLIST_KEY_CFBundleDisplayName = "跨友Trans"; + INFOPLIST_KEY_NSCameraUsageDescription = "App会在上传头像时,需要访问您的相机权限"; INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料"; - INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "应用想要访问您的位置,用于设置个人资料"; - INFOPLIST_KEY_NSMicrophoneUsageDescription = "应用想要访问您的麦克风,用于发送语音消息"; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "App需要使用您的位置信息,寻找附近用户"; + INFOPLIST_KEY_NSMicrophoneUsageDescription = "$(PRODUCT_NAME)需要您同意,才能使用麦克风,用来发送语音"; INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?"; - INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "应用想要访问您的相册,用于设置头像/动态发布"; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "App会在上传头像时,需要访问您的相册权限"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortraitUpsideDown"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -512,19 +512,19 @@ DEVELOPMENT_TEAM = C39VUKAY2Z; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = "微乐园"; - INFOPLIST_KEY_NSCameraUsageDescription = "应用想要访问您的相机,用于设置头像/动态发布"; + INFOPLIST_KEY_CFBundleDisplayName = "跨友Trans"; + INFOPLIST_KEY_NSCameraUsageDescription = "App会在上传头像时,需要访问您的相机权限"; INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料"; - INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "应用想要访问您的位置,用于设置个人资料"; - INFOPLIST_KEY_NSMicrophoneUsageDescription = "应用想要访问您的麦克风,用于发送语音消息"; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "App需要使用您的位置信息,寻找附近用户"; + INFOPLIST_KEY_NSMicrophoneUsageDescription = "$(PRODUCT_NAME)需要您同意,才能使用麦克风,用来发送语音"; INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?"; - INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "应用想要访问您的相册,用于设置头像/动态发布"; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "App会在上传头像时,需要访问您的相册权限"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortraitUpsideDown"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -555,19 +555,19 @@ DEVELOPMENT_TEAM = C39VUKAY2Z; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = "微乐园"; - INFOPLIST_KEY_NSCameraUsageDescription = "应用想要访问您的相机,用于设置头像/动态发布"; + INFOPLIST_KEY_CFBundleDisplayName = "跨友Trans"; + INFOPLIST_KEY_NSCameraUsageDescription = "App会在上传头像时,需要访问您的相机权限"; INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料"; - INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "应用想要访问您的位置,用于设置个人资料"; - INFOPLIST_KEY_NSMicrophoneUsageDescription = "应用想要访问您的麦克风,用于发送语音消息"; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "App需要使用您的位置信息,寻找附近用户"; + INFOPLIST_KEY_NSMicrophoneUsageDescription = "$(PRODUCT_NAME)需要您同意,才能使用麦克风,用来发送语音"; INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?"; - INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "应用想要访问您的相册,用于设置头像/动态发布"; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "App会在上传头像时,需要访问您的相册权限"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortraitUpsideDown"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/circle_app/ios/Runner/Info.plist b/circle_app/ios/Runner/Info.plist index 192af0b..5f4e1b7 100644 --- a/circle_app/ios/Runner/Info.plist +++ b/circle_app/ios/Runner/Info.plist @@ -2,23 +2,17 @@ - App Transport Security Settings - CADisableMinimumFrameDurationOnPhone - CFBundleSignature - ???? CFBundleURLTypes CFBundleTypeRole Editor CFBundleURLName - weixin + CFBundleURLSchemes - - wxab2387c2198f01e1 - + LSApplicationQueriesSchemes @@ -27,9 +21,16 @@ weixin wechat + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSAllowsArbitraryLoadsInWebContent + + UIViewControllerBasedStatusBarAppearance - UIApplicationSupportsIndirectInputEvents + io.flutter.embedded_views_preview diff --git a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart index 187c6ce..ffa66d1 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart @@ -456,7 +456,8 @@ class _TIMUIKItHistoryMessageListItemState width: 3, height: 3, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1.5), + borderRadius: + BorderRadius.circular(1.5), color: Color(0xFF00FFF4)), ), Expanded( @@ -477,40 +478,40 @@ class _TIMUIKItHistoryMessageListItemState ), ), Container( - margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), + margin: + EdgeInsets.only(top: 10.sp, bottom: 10.sp), alignment: Alignment.centerLeft, child: Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: - EdgeInsets.only(right: 5.sp, top: 10.sp), - width: 3, - height: 3, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1.5), - color: Color(0xFF00FFF4)), - ), - Expanded( - child: Text( - isFromSelf - ? '交友宣言:' + info['user']['signature'] - : '交友宣言:' + info['my']['signature'], - style: TextStyle( - color: Colors.white, - fontSize: 14.sp, - fontWeight: FontWeight.w500), - maxLines: 2, - overflow: TextOverflow.ellipsis, - )), - ])), + Container( + margin: EdgeInsets.only(right: 5.sp,top: 10.sp), + width: 3, + height: 3, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(1.5), + color: Color(0xFF00FFF4)), + ), + Expanded(child: Text( + isFromSelf + ? '交友宣言:' + info['user']['signature'] + : '交友宣言:' + info['my']['signature'], + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.w500), + maxLines: 2, + overflow: TextOverflow.ellipsis, + )), + ])), Image.asset( getCircleImage('line'), width: Get.width, fit: BoxFit.fill, ), - interestWdiget( - isFromSelf ? info['interests'] : info['myInterests']) + interestWdiget(isFromSelf + ? info['interests'] + : info['myInterests']) ], ), ), @@ -739,10 +740,7 @@ class _TIMUIKItHistoryMessageListItemState } interestWdiget(List data) { - if (!data.isNotEmpty) - return Container( - height: 0, - ); + if (!data.isNotEmpty) return Container(height: 0,); return Container( alignment: Alignment.centerLeft, height: 49.sp, diff --git a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart index f722aaa..e2a8de3 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart @@ -9,7 +9,6 @@ import 'package:circle_app/app/minefragment/logic.dart'; import 'package:circle_app/common/Widgets/open_vip_tip/view.dart'; import 'package:circle_app/network/api.dart'; import 'package:circle_app/network/dio_manager.dart'; -import 'package:circle_app/util/SharedPreferencesHelper.dart'; import 'package:circle_app/util/util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -280,7 +279,8 @@ class _TIMTextFieldLayoutNarrowState widget.addStickerToText(newText); setSendButton(); }), - defaultCustomEmojiStickerList: []) + defaultCustomEmojiStickerList: + widget.isUseDefaultEmoji ? ConstData.emojiList : []) : EmojiPanel(onTapEmoji: (unicode) { final newText = String.fromCharCode(unicode); widget.addStickerToText(newText); @@ -320,10 +320,10 @@ class _TIMTextFieldLayoutNarrowState final height = originHeight != 0 ? originHeight : currentKeyboardHeight; return height; } else if (showMore || showEmojiPanel) { - return 268.0 + (bottomPadding ?? 0.0); + return 200.0 + (bottomPadding ?? 0.0); } else if (widget.textEditingController.text.length >= 46 && showKeyboard == false) { - return 25 + (bottomPadding ?? 0.0); + return 15 + (bottomPadding ?? 0.0); } else { return bottomPadding ?? 0; } @@ -454,23 +454,6 @@ class _TIMTextFieldLayoutNarrowState _buildRepliedMessage(widget.repliedMessage), Stack( children: [ - - Positioned( - bottom: MediaQuery.of(context).padding.bottom + 20, - child: AnimatedContainer( - duration: Duration( - milliseconds: (showKeyboard && PlatformUtils().isAndroid) - ? 200 - : 340), - curve: Curves.fastOutSlowIn, - width: Get.width, - height: max(_getBottomHeight(), 0.0), - child: ListView( - physics: const NeverScrollableScrollPhysics(), - children: [_getBottomContainer()], - ), - ), - ), Container( decoration: BoxDecoration( borderRadius: BorderRadius.only( @@ -485,26 +468,26 @@ class _TIMTextFieldLayoutNarrowState children: [ Container( padding: - EdgeInsets.symmetric(vertical: 8, horizontal: 12.sp), + EdgeInsets.symmetric(vertical: 8, horizontal: 12.sp), constraints: const BoxConstraints(minHeight: 30), child: Row( children: [ if (widget.forbiddenText != null) Expanded( child: Container( - height: 35, - color: theme.weakBackgroundColor, - alignment: Alignment.center, - child: Text( - TIM_t(widget.forbiddenText!), - textAlign: TextAlign.center, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: theme.weakTextColor, - ), - ), - )), + height: 35, + color: theme.weakBackgroundColor, + alignment: Alignment.center, + child: Text( + TIM_t(widget.forbiddenText!), + textAlign: TextAlign.center, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: theme.weakTextColor, + ), + ), + )), if (PlatformUtils().isMobile && widget.showSendAudio && widget.forbiddenText == null) @@ -548,7 +531,7 @@ class _TIMTextFieldLayoutNarrowState padding: EdgeInsets.symmetric( vertical: 8, horizontal: 12.sp), constraints: - const BoxConstraints(minHeight: 30), + const BoxConstraints(minHeight: 30), decoration: BoxDecoration( color: Color(0x1AFFFFFF), borderRadius: BorderRadius.circular(26.sp), @@ -559,91 +542,91 @@ class _TIMTextFieldLayoutNarrowState Expanded( child: showSendSoundText ? TIMSendSoundMessage( - onDownBottom: - widget.goDownBottom, - conversationID: - widget.conversationID, - conversationType: - widget.conversationType) + onDownBottom: + widget.goDownBottom, + conversationID: + widget.conversationID, + conversationType: + widget.conversationType) : KeyboardVisibility( - child: ExtendedTextField( - style: TextStyle( - color: Colors.white, - fontSize: 14.sp), - maxLines: 4, - minLines: 1, - focusNode: widget.focusNode, - onChanged: debounceFunc, - onTap: () { - showKeyboard = true; - widget.goDownBottom(); - setState(() { - showEmojiPanel = false; - showMore = false; - }); - }, - keyboardType: - TextInputType.multiline, - textInputAction: - PlatformUtils() - .isAndroid - ? TextInputAction - .newline - : TextInputAction - .send, - onEditingComplete: () { - widget.onSubmitted(); - if (showKeyboard) { - widget.focusNode - .requestFocus(); + child: ExtendedTextField( + style: TextStyle( + color: Colors.white, + fontSize: 14.sp), + maxLines: 4, + minLines: 1, + focusNode: widget.focusNode, + onChanged: debounceFunc, + onTap: () { + showKeyboard = true; + widget.goDownBottom(); + setState(() { + showEmojiPanel = false; + showMore = false; + }); + }, + keyboardType: + TextInputType.multiline, + textInputAction: + PlatformUtils() + .isAndroid + ? TextInputAction + .newline + : TextInputAction + .send, + onEditingComplete: () { + widget.onSubmitted(); + if (showKeyboard) { + widget.focusNode + .requestFocus(); + } + setState(() { + if (widget + .textEditingController + .text + .isEmpty) { + showMoreButton = true; + } + }); + }, + textAlignVertical: + TextAlignVertical.top, + decoration: InputDecoration( + border: InputBorder.none, + hintStyle: TextStyle( + fontSize: 14.sp, + color: + Color(0xB3FFFFFF), + ), + hintText: widget.hintText, + fillColor: + Colors.transparent, + filled: true, + isDense: true, + ), + controller: widget + .textEditingController, + specialTextSpanBuilder: + PlatformUtils().isWeb + ? null + : DefaultSpecialTextSpanBuilder( + isUseDefaultEmoji: + widget + .isUseDefaultEmoji, + customEmojiStickerList: + widget + .customEmojiStickerList, + showAtBackground: + true, + )), + onChanged: (bool visibility) { + if (showKeyboard != + visibility) { + setState(() { + showKeyboard = visibility; + }); } - setState(() { - if (widget - .textEditingController - .text - .isEmpty) { - showMoreButton = true; - } - }); - }, - textAlignVertical: - TextAlignVertical.top, - decoration: InputDecoration( - border: InputBorder.none, - hintStyle: TextStyle( - fontSize: 14.sp, - color: - Color(0xB3FFFFFF), - ), - hintText: widget.hintText, - fillColor: - Colors.transparent, - filled: true, - isDense: true, - ), - controller: widget - .textEditingController, - specialTextSpanBuilder: - PlatformUtils().isWeb - ? null - : DefaultSpecialTextSpanBuilder( - isUseDefaultEmoji: - widget - .isUseDefaultEmoji, - customEmojiStickerList: - widget - .customEmojiStickerList, - showAtBackground: - true, - )), - onChanged: (bool visibility) { - if (showKeyboard != - visibility) { - setState(() { - showKeyboard = visibility; - }); - } - }), + }), ), if (widget.forbiddenText == null) const SizedBox( @@ -692,13 +675,13 @@ class _TIMTextFieldLayoutNarrowState ), ), Container( - height: 64.sp, + height: 40.sp, width: Get.width, + margin: EdgeInsets.only(bottom: showEmojiPanel ? 40.sp : 0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ GestureDetector( - behavior: HitTestBehavior.opaque, onTap: () async { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); @@ -718,7 +701,7 @@ class _TIMTextFieldLayoutNarrowState }); } else { var data = - await Permission.microphone.request(); + await Permission.microphone.request(); if (data.isGranted) { setState(() { showEmojiPanel = false; @@ -740,45 +723,45 @@ class _TIMTextFieldLayoutNarrowState ), ), GestureDetector( - onTap: () async { + onTap: () { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); return; } - await getImageFile(); + getImageFile(); }, child: - Image.asset(getMsgImage('photo'), width: 40.sp), + Image.asset(getMsgImage('photo'), width: 40.sp), ), GestureDetector( - onTap: () async { + onTap: () { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); return; } - await getTakeImageFile(); + getTakeImageFile(); }, child: Image.asset(getMsgImage('take_photo'), width: 40.sp), ), GestureDetector( - onTap: () async { + onTap: () { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); return; } - await getVideoFile(ImageSource.gallery); + getVideoFile(ImageSource.gallery); }, child: Image.asset(getMsgImage('icon_video'), width: 40.sp), ), GestureDetector( - onTap: () async { + onTap: () { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); return; } - await getVideoFile(ImageSource.camera); + getVideoFile(ImageSource.camera); }, child: Image.asset(getMsgImage('icon_video_camera'), width: 40.sp), @@ -789,9 +772,9 @@ class _TIMTextFieldLayoutNarrowState AnimatedContainer( duration: Duration( milliseconds: - (showKeyboard && PlatformUtils().isAndroid) - ? 200 - : 340), + (showKeyboard && PlatformUtils().isAndroid) + ? 200 + : 340), curve: Curves.fastOutSlowIn, height: max(_getBottomHeight(), 0.0), // child: ListView( @@ -802,6 +785,22 @@ class _TIMTextFieldLayoutNarrowState ], ), ), + Positioned( + bottom: MediaQuery.of(context).padding.bottom + 20, + child: AnimatedContainer( + duration: Duration( + milliseconds: (showKeyboard && PlatformUtils().isAndroid) + ? 200 + : 340), + curve: Curves.fastOutSlowIn, + width: Get.width, + height: max(_getBottomHeight(), 0.0), + child: ListView( + physics: const NeverScrollableScrollPhysics(), + children: [_getBottomContainer()], + ), + ), + ) ], ) ], @@ -809,26 +808,11 @@ class _TIMTextFieldLayoutNarrowState } Future checkVipStatus(int plate) async { - if (!isVip) { - SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); - if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') { - isVip = true; - return true; - } else { - var data = + var data = await DioManager.instance.get(url: Api.getIsVips + plate.toString()); - if (data['code'] == 200) { - isVip = !data['data']; - } - // var data = await DioManager.instance.get(url: Api.getUserMine); - // var bean = BaseResponse.fromJson( - // data, (data) => MineResponseBean.fromJson(data)); - // if (bean.isSuccess()) { - // User userInfoBean = bean.data.user!; - // isVip = userInfoBean.vip > 0; - // } - } + if (data['code'] == 200) { + isVip = !data['data']; } if (!isVip) { diff --git a/circle_app/lib/app/chat/TIMUIKitChat/tim_uikit_chat.dart b/circle_app/lib/app/chat/TIMUIKitChat/tim_uikit_chat.dart index 276d606..81b767d 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/tim_uikit_chat.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/tim_uikit_chat.dart @@ -461,11 +461,11 @@ class _TUIChatState extends TIMUIKitState { tongueItemBuilder: widget.tongueItemBuilder, onLongPressForOthersHeadPortrait: (String? userId, String? nickName) { - // if (widget.conversationType != - // ConvType.c2c) { - // textFieldController.longPressToAt( - // nickName, userId); - // } + if (widget.conversationType != + ConvType.c2c) { + textFieldController.longPressToAt( + nickName, userId); + } }, mainHistoryListConfig: widget.mainHistoryListConfig, diff --git a/circle_app/lib/app/chat/view.dart b/circle_app/lib/app/chat/view.dart index 823cad7..bd537d2 100644 --- a/circle_app/lib/app/chat/view.dart +++ b/circle_app/lib/app/chat/view.dart @@ -95,7 +95,7 @@ class _ChatPageState extends State { }).toList(); return StickerPanel( // height: 100.sp, - backgroundColor:Colors.red, + backgroundColor:Colors.transparent, showBottomContainer: true, sendTextMsg: sendTextMessage, sendFaceMsg: (index, data) => diff --git a/circle_app/lib/app/swiper/view.dart b/circle_app/lib/app/swiper/view.dart index 7cc2af3..d92d397 100644 --- a/circle_app/lib/app/swiper/view.dart +++ b/circle_app/lib/app/swiper/view.dart @@ -1,9 +1,17 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:circle_app/util/util.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:get/get.dart'; +import 'package:get/get_core/src/get_main.dart'; import 'package:get/get_state_manager/src/simple/get_state.dart'; +import 'package:image_gallery_saver/image_gallery_saver.dart'; import 'logic.dart'; - +import 'dart:ui' as ui; class SwiperPage extends StatefulWidget { const SwiperPage({Key? key}) : super(key: key); @@ -13,12 +21,10 @@ class SwiperPage extends StatefulWidget { class _SwiperPageState extends State { - + GlobalKey _globalKey = GlobalKey(); @override Widget build(BuildContext context) { - return GetBuilder(builder: (logic) { - return Scaffold( appBar: null, backgroundColor: Colors.black87, @@ -28,23 +34,142 @@ class _SwiperPageState extends State { //点击任意地方都能关闭页面,并且不影响你的滑动查看 Navigator.pop(context); }), - child: Swiper( - controller: logic.swiperController, - index:logic.index, - itemBuilder: (BuildContext context, int index) { - print("img="+logic.imgList[index]); - return SizedBox( - width: double.infinity, - child: Image.network( - "${logic.imgList[index]}?imageView2/0/q/60|watermark/2/text/5b6u5LmQ5ZutQVBQ/font/5b6u6L2v6ZuF6buR/fontsize/2160/fill/I0ZGRkZGRg==/dissolve/50/gravity/SouthEast/dx/60/dy/120", fit: BoxFit.contain,) - ); - }, - itemCount: logic.imgList.length, - pagination: SwiperPagination(), //下面的分页小点 -// control: new SwiperControl(), //左右的那个箭头,在某模拟器中会出现蓝线 + child: Stack( + children: [ + Container( + child: Swiper( + controller: logic.swiperController, + index: logic.index, + loop: false, + itemBuilder: (BuildContext context, int index) { + if (logic.index == index) { + return RepaintBoundary( + key: _globalKey, + child:itemWidget(logic,index)); + } + return itemWidget(logic,index); + }, + + onIndexChanged: (int index) { + logic.index = index; + logic.update(); + }, + itemCount: logic.imgList.length, + pagination: const SwiperPagination( + builder: DotSwiperPaginationBuilder( + activeColor: Color(0xFFD14CFF), + color: Colors.white)), //下面的分页小点 + )), + Positioned( + bottom: Get.bottomBarHeight, + right: 15.sp, + child: InkWell( + onTap: () { + _saveLocalImage(); + }, + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.all(5.sp), + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.5), + borderRadius: BorderRadius.circular(17.5.sp)), + child: Icon( + Icons.download, + color: Colors.white, + size: 25.sp, + ), + ), + )) + ], ), ), ); }); } + + itemWidget(SwiperLogic logic,int index) { + return Container( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Stack( + alignment: Alignment.center, + children: [ + Container( + // color: Colors.red, + child: CachedNetworkImage( + imageUrl: logic.imgList[index], + fit: BoxFit.contain, + ), + ), + Positioned( + left: 10.sp, + bottom: 20.sp, + child: Container( + margin: + EdgeInsets.only(top: Get.height * 0.45), + child: Text( + '微乐园APP', + style: TextStyle( + color: Colors.white, fontSize: 25.sp), + ), + )) + ], + ) + ], + )); + } + + _saveLocalImage() async { + RenderRepaintBoundary boundary = + _globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary; + ui.Image image = + await boundary.toImage(pixelRatio: ui.window.devicePixelRatio); + ByteData? byteData = + await (image.toByteData(format: ui.ImageByteFormat.png)); + if (byteData != null) { + final result = + await ImageGallerySaver.saveImage(byteData.buffer.asUint8List()); + print(result); + // isSuccess + if (result['isSuccess']) { + showOKToast('保存成功'); + } else { + showOKToast('保存失败,请检查相册权限是否开启'); + } + } + } + // Widget build(BuildContext context) { + +// return GetBuilder(builder: (logic) { +// +// return Scaffold( +// appBar: null, +// backgroundColor: Colors.black87, +// body: GestureDetector( +// behavior: HitTestBehavior.translucent, +// onTap: (() { +// //点击任意地方都能关闭页面,并且不影响你的滑动查看 +// Navigator.pop(context); +// }), +// child: Swiper( +// controller: logic.swiperController, +// index:logic.index, +// itemBuilder: (BuildContext context, int index) { +// print("img="+logic.imgList[index]); +// // return SizedBox( +// // width: double.infinity, +// // child: Image.network( +// // "${logic.imgList[index]}?imageView2/0/q/60|watermark/2/text/5b6u5LmQ5ZutQVBQ/font/5b6u6L2v6ZuF6buR/fontsize/2160/fill/I0ZGRkZGRg==/dissolve/50/gravity/SouthEast/dx/60/dy/120", fit: BoxFit.contain,) +// // ); +// }, +// itemCount: logic.imgList.length, +// pagination: SwiperPagination(), //下面的分页小点 +// // control: new SwiperControl(), //左右的那个箭头,在某模拟器中会出现蓝线 +// ), +// ), +// ); +// }); +// } } \ No newline at end of file diff --git a/circle_app/lib/app/userinfo/view.dart b/circle_app/lib/app/userinfo/view.dart index b91b583..97fc278 100644 --- a/circle_app/lib/app/userinfo/view.dart +++ b/circle_app/lib/app/userinfo/view.dart @@ -523,7 +523,7 @@ class MyTabbedScreenState extends State ); }, ), - logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector( + logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): _tabController.index == 0 ? GestureDetector( onTap: () { if(!logic.isShowAlbum&&controller.isMe){ List numbers = []; @@ -565,7 +565,7 @@ class MyTabbedScreenState extends State ), ), ), - ), + ) : Container(), ], ), ); diff --git a/circle_app/pubspec.yaml b/circle_app/pubspec.yaml index 2fd970a..bc595dc 100644 --- a/circle_app/pubspec.yaml +++ b/circle_app/pubspec.yaml @@ -142,7 +142,6 @@ flutter: - assets/images/mine/ - assets/images/msg/ - assets/images/circle/ - - assets/tencent_cloud_chat_sticker/ - assets/province.json # - images/a_dot_ham.jpeg