修改emoji无法显示,个人主页切换显示

This commit is contained in:
CYH 2023-10-24 18:15:05 +08:00
parent f008d4c045
commit 85bc065c71
9 changed files with 344 additions and 237 deletions

View File

@ -363,19 +363,19 @@
DEVELOPMENT_TEAM = C39VUKAY2Z; DEVELOPMENT_TEAM = C39VUKAY2Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "微乐园"; INFOPLIST_KEY_CFBundleDisplayName = "跨友Trans";
INFOPLIST_KEY_NSCameraUsageDescription = "应用想要访问您的相机,用于设置头像/动态发布"; INFOPLIST_KEY_NSCameraUsageDescription = "App会在上传头像时需要访问您的相机权限";
INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料";
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "App需要使用您的位置信息,寻找附近用户";
INFOPLIST_KEY_NSMicrophoneUsageDescription = "应用想要访问您的麦克风,用于发送语音消息"; INFOPLIST_KEY_NSMicrophoneUsageDescription = "$(PRODUCT_NAME)需要您同意,才能使用麦克风,用来发送语音";
INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?"; INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "应用想要访问您的相册,用于设置头像/动态发布"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "App会在上传头像时需要访问您的相册权限";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent; INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -512,19 +512,19 @@
DEVELOPMENT_TEAM = C39VUKAY2Z; DEVELOPMENT_TEAM = C39VUKAY2Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "微乐园"; INFOPLIST_KEY_CFBundleDisplayName = "跨友Trans";
INFOPLIST_KEY_NSCameraUsageDescription = "应用想要访问您的相机,用于设置头像/动态发布"; INFOPLIST_KEY_NSCameraUsageDescription = "App会在上传头像时需要访问您的相机权限";
INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料";
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "App需要使用您的位置信息,寻找附近用户";
INFOPLIST_KEY_NSMicrophoneUsageDescription = "应用想要访问您的麦克风,用于发送语音消息"; INFOPLIST_KEY_NSMicrophoneUsageDescription = "$(PRODUCT_NAME)需要您同意,才能使用麦克风,用来发送语音";
INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?"; INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "应用想要访问您的相册,用于设置头像/动态发布"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "App会在上传头像时需要访问您的相册权限";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent; INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -555,19 +555,19 @@
DEVELOPMENT_TEAM = C39VUKAY2Z; DEVELOPMENT_TEAM = C39VUKAY2Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "微乐园"; INFOPLIST_KEY_CFBundleDisplayName = "跨友Trans";
INFOPLIST_KEY_NSCameraUsageDescription = "应用想要访问您的相机,用于设置头像/动态发布"; INFOPLIST_KEY_NSCameraUsageDescription = "App会在上传头像时需要访问您的相机权限";
INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料";
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "App需要使用您的位置信息,寻找附近用户";
INFOPLIST_KEY_NSMicrophoneUsageDescription = "应用想要访问您的麦克风,用于发送语音消息"; INFOPLIST_KEY_NSMicrophoneUsageDescription = "$(PRODUCT_NAME)需要您同意,才能使用麦克风,用来发送语音";
INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?"; INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "应用想要访问您的相册,用于设置头像/动态发布"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "App会在上传头像时需要访问您的相册权限";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent; INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",

View File

@ -2,23 +2,17 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>App Transport Security Settings </key>
<true/>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true/> <true/>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <array>
<dict> <dict>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>Editor</string> <string>Editor</string>
<key>CFBundleURLName</key> <key>CFBundleURLName</key>
<string>weixin</string> <string></string>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array/>
<string>wxab2387c2198f01e1</string>
</array>
</dict> </dict>
</array> </array>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
@ -27,9 +21,16 @@
<string>weixin</string> <string>weixin</string>
<string>wechat</string> <string>wechat</string>
</array> </array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
<key>UIApplicationSupportsIndirectInputEvents</key> <key>io.flutter.embedded_views_preview</key>
<true/> <true/>
</dict> </dict>
</plist> </plist>

View File

@ -456,7 +456,8 @@ class _TIMUIKItHistoryMessageListItemState
width: 3, width: 3,
height: 3, height: 3,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5), borderRadius:
BorderRadius.circular(1.5),
color: Color(0xFF00FFF4)), color: Color(0xFF00FFF4)),
), ),
Expanded( Expanded(
@ -477,40 +478,40 @@ class _TIMUIKItHistoryMessageListItemState
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), margin:
EdgeInsets.only(top: 10.sp, bottom: 10.sp),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: margin: EdgeInsets.only(right: 5.sp,top: 10.sp),
EdgeInsets.only(right: 5.sp, top: 10.sp), width: 3,
width: 3, height: 3,
height: 3, decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(1.5),
borderRadius: BorderRadius.circular(1.5), color: Color(0xFF00FFF4)),
color: Color(0xFF00FFF4)), ),
), Expanded(child: Text(
Expanded( isFromSelf
child: Text( ? '交友宣言:' + info['user']['signature']
isFromSelf : '交友宣言:' + info['my']['signature'],
? '交友宣言:' + info['user']['signature'] style: TextStyle(
: '交友宣言:' + info['my']['signature'], color: Colors.white,
style: TextStyle( fontSize: 14.sp,
color: Colors.white, fontWeight: FontWeight.w500),
fontSize: 14.sp, maxLines: 2,
fontWeight: FontWeight.w500), overflow: TextOverflow.ellipsis,
maxLines: 2, )),
overflow: TextOverflow.ellipsis, ])),
)),
])),
Image.asset( Image.asset(
getCircleImage('line'), getCircleImage('line'),
width: Get.width, width: Get.width,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
interestWdiget( interestWdiget(isFromSelf
isFromSelf ? info['interests'] : info['myInterests']) ? info['interests']
: info['myInterests'])
], ],
), ),
), ),
@ -739,10 +740,7 @@ class _TIMUIKItHistoryMessageListItemState
} }
interestWdiget(List data) { interestWdiget(List data) {
if (!data.isNotEmpty) if (!data.isNotEmpty) return Container(height: 0,);
return Container(
height: 0,
);
return Container( return Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
height: 49.sp, height: 49.sp,

View File

@ -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/common/Widgets/open_vip_tip/view.dart';
import 'package:circle_app/network/api.dart'; import 'package:circle_app/network/api.dart';
import 'package:circle_app/network/dio_manager.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:circle_app/util/util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -280,7 +279,8 @@ class _TIMTextFieldLayoutNarrowState
widget.addStickerToText(newText); widget.addStickerToText(newText);
setSendButton(); setSendButton();
}), }),
defaultCustomEmojiStickerList: []) defaultCustomEmojiStickerList:
widget.isUseDefaultEmoji ? ConstData.emojiList : [])
: EmojiPanel(onTapEmoji: (unicode) { : EmojiPanel(onTapEmoji: (unicode) {
final newText = String.fromCharCode(unicode); final newText = String.fromCharCode(unicode);
widget.addStickerToText(newText); widget.addStickerToText(newText);
@ -320,10 +320,10 @@ class _TIMTextFieldLayoutNarrowState
final height = originHeight != 0 ? originHeight : currentKeyboardHeight; final height = originHeight != 0 ? originHeight : currentKeyboardHeight;
return height; return height;
} else if (showMore || showEmojiPanel) { } else if (showMore || showEmojiPanel) {
return 268.0 + (bottomPadding ?? 0.0); return 200.0 + (bottomPadding ?? 0.0);
} else if (widget.textEditingController.text.length >= 46 && } else if (widget.textEditingController.text.length >= 46 &&
showKeyboard == false) { showKeyboard == false) {
return 25 + (bottomPadding ?? 0.0); return 15 + (bottomPadding ?? 0.0);
} else { } else {
return bottomPadding ?? 0; return bottomPadding ?? 0;
} }
@ -454,23 +454,6 @@ class _TIMTextFieldLayoutNarrowState
_buildRepliedMessage(widget.repliedMessage), _buildRepliedMessage(widget.repliedMessage),
Stack( Stack(
children: [ 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( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -485,26 +468,26 @@ class _TIMTextFieldLayoutNarrowState
children: [ children: [
Container( Container(
padding: padding:
EdgeInsets.symmetric(vertical: 8, horizontal: 12.sp), EdgeInsets.symmetric(vertical: 8, horizontal: 12.sp),
constraints: const BoxConstraints(minHeight: 30), constraints: const BoxConstraints(minHeight: 30),
child: Row( child: Row(
children: [ children: [
if (widget.forbiddenText != null) if (widget.forbiddenText != null)
Expanded( Expanded(
child: Container( child: Container(
height: 35, height: 35,
color: theme.weakBackgroundColor, color: theme.weakBackgroundColor,
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
TIM_t(widget.forbiddenText!), TIM_t(widget.forbiddenText!),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
color: theme.weakTextColor, color: theme.weakTextColor,
), ),
), ),
)), )),
if (PlatformUtils().isMobile && if (PlatformUtils().isMobile &&
widget.showSendAudio && widget.showSendAudio &&
widget.forbiddenText == null) widget.forbiddenText == null)
@ -548,7 +531,7 @@ class _TIMTextFieldLayoutNarrowState
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 8, horizontal: 12.sp), vertical: 8, horizontal: 12.sp),
constraints: constraints:
const BoxConstraints(minHeight: 30), const BoxConstraints(minHeight: 30),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0x1AFFFFFF), color: Color(0x1AFFFFFF),
borderRadius: BorderRadius.circular(26.sp), borderRadius: BorderRadius.circular(26.sp),
@ -559,91 +542,91 @@ class _TIMTextFieldLayoutNarrowState
Expanded( Expanded(
child: showSendSoundText child: showSendSoundText
? TIMSendSoundMessage( ? TIMSendSoundMessage(
onDownBottom: onDownBottom:
widget.goDownBottom, widget.goDownBottom,
conversationID: conversationID:
widget.conversationID, widget.conversationID,
conversationType: conversationType:
widget.conversationType) widget.conversationType)
: KeyboardVisibility( : KeyboardVisibility(
child: ExtendedTextField( child: ExtendedTextField(
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14.sp), fontSize: 14.sp),
maxLines: 4, maxLines: 4,
minLines: 1, minLines: 1,
focusNode: widget.focusNode, focusNode: widget.focusNode,
onChanged: debounceFunc, onChanged: debounceFunc,
onTap: () { onTap: () {
showKeyboard = true; showKeyboard = true;
widget.goDownBottom(); widget.goDownBottom();
setState(() { setState(() {
showEmojiPanel = false; showEmojiPanel = false;
showMore = false; showMore = false;
}); });
}, },
keyboardType: keyboardType:
TextInputType.multiline, TextInputType.multiline,
textInputAction: textInputAction:
PlatformUtils() PlatformUtils()
.isAndroid .isAndroid
? TextInputAction ? TextInputAction
.newline .newline
: TextInputAction : TextInputAction
.send, .send,
onEditingComplete: () { onEditingComplete: () {
widget.onSubmitted(); widget.onSubmitted();
if (showKeyboard) { if (showKeyboard) {
widget.focusNode widget.focusNode
.requestFocus(); .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) if (widget.forbiddenText == null)
const SizedBox( const SizedBox(
@ -692,13 +675,13 @@ class _TIMTextFieldLayoutNarrowState
), ),
), ),
Container( Container(
height: 64.sp, height: 40.sp,
width: Get.width, width: Get.width,
margin: EdgeInsets.only(bottom: showEmojiPanel ? 40.sp : 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async { onTap: () async {
if (isBlack) { if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
@ -718,7 +701,7 @@ class _TIMTextFieldLayoutNarrowState
}); });
} else { } else {
var data = var data =
await Permission.microphone.request(); await Permission.microphone.request();
if (data.isGranted) { if (data.isGranted) {
setState(() { setState(() {
showEmojiPanel = false; showEmojiPanel = false;
@ -740,45 +723,45 @@ class _TIMTextFieldLayoutNarrowState
), ),
), ),
GestureDetector( GestureDetector(
onTap: () async { onTap: () {
if (isBlack) { if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
await getImageFile(); getImageFile();
}, },
child: child:
Image.asset(getMsgImage('photo'), width: 40.sp), Image.asset(getMsgImage('photo'), width: 40.sp),
), ),
GestureDetector( GestureDetector(
onTap: () async { onTap: () {
if (isBlack) { if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
await getTakeImageFile(); getTakeImageFile();
}, },
child: Image.asset(getMsgImage('take_photo'), child: Image.asset(getMsgImage('take_photo'),
width: 40.sp), width: 40.sp),
), ),
GestureDetector( GestureDetector(
onTap: () async { onTap: () {
if (isBlack) { if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
await getVideoFile(ImageSource.gallery); getVideoFile(ImageSource.gallery);
}, },
child: Image.asset(getMsgImage('icon_video'), child: Image.asset(getMsgImage('icon_video'),
width: 40.sp), width: 40.sp),
), ),
GestureDetector( GestureDetector(
onTap: () async { onTap: () {
if (isBlack) { if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
await getVideoFile(ImageSource.camera); getVideoFile(ImageSource.camera);
}, },
child: Image.asset(getMsgImage('icon_video_camera'), child: Image.asset(getMsgImage('icon_video_camera'),
width: 40.sp), width: 40.sp),
@ -789,9 +772,9 @@ class _TIMTextFieldLayoutNarrowState
AnimatedContainer( AnimatedContainer(
duration: Duration( duration: Duration(
milliseconds: milliseconds:
(showKeyboard && PlatformUtils().isAndroid) (showKeyboard && PlatformUtils().isAndroid)
? 200 ? 200
: 340), : 340),
curve: Curves.fastOutSlowIn, curve: Curves.fastOutSlowIn,
height: max(_getBottomHeight(), 0.0), height: max(_getBottomHeight(), 0.0),
// child: ListView( // 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 { Future checkVipStatus(int plate) async {
if (!isVip) { var data =
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
isVip = true;
return true;
} else {
var data =
await DioManager.instance.get(url: Api.getIsVips + plate.toString()); await DioManager.instance.get(url: Api.getIsVips + plate.toString());
if (data['code'] == 200) { if (data['code'] == 200) {
isVip = !data['data']; isVip = !data['data'];
}
// var data = await DioManager.instance.get(url: Api.getUserMine);
// var bean = BaseResponse<MineResponseBean>.fromJson(
// data, (data) => MineResponseBean.fromJson(data));
// if (bean.isSuccess()) {
// User userInfoBean = bean.data.user!;
// isVip = userInfoBean.vip > 0;
// }
}
} }
if (!isVip) { if (!isVip) {

View File

@ -461,11 +461,11 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
tongueItemBuilder: widget.tongueItemBuilder, tongueItemBuilder: widget.tongueItemBuilder,
onLongPressForOthersHeadPortrait: onLongPressForOthersHeadPortrait:
(String? userId, String? nickName) { (String? userId, String? nickName) {
// if (widget.conversationType != if (widget.conversationType !=
// ConvType.c2c) { ConvType.c2c) {
// textFieldController.longPressToAt( textFieldController.longPressToAt(
// nickName, userId); nickName, userId);
// } }
}, },
mainHistoryListConfig: mainHistoryListConfig:
widget.mainHistoryListConfig, widget.mainHistoryListConfig,

View File

@ -95,7 +95,7 @@ class _ChatPageState extends State<ChatPage> {
}).toList(); }).toList();
return StickerPanel( return StickerPanel(
// height: 100.sp, // height: 100.sp,
backgroundColor:Colors.red, backgroundColor:Colors.transparent,
showBottomContainer: true, showBottomContainer: true,
sendTextMsg: sendTextMessage, sendTextMsg: sendTextMessage,
sendFaceMsg: (index, data) => sendFaceMsg: (index, data) =>

View File

@ -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/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: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:get/get_state_manager/src/simple/get_state.dart';
import 'package:image_gallery_saver/image_gallery_saver.dart';
import 'logic.dart'; import 'logic.dart';
import 'dart:ui' as ui;
class SwiperPage extends StatefulWidget { class SwiperPage extends StatefulWidget {
const SwiperPage({Key? key}) : super(key: key); const SwiperPage({Key? key}) : super(key: key);
@ -13,12 +21,10 @@ class SwiperPage extends StatefulWidget {
class _SwiperPageState extends State<SwiperPage> { class _SwiperPageState extends State<SwiperPage> {
GlobalKey _globalKey = GlobalKey();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GetBuilder<SwiperLogic>(builder: (logic) { return GetBuilder<SwiperLogic>(builder: (logic) {
return Scaffold( return Scaffold(
appBar: null, appBar: null,
backgroundColor: Colors.black87, backgroundColor: Colors.black87,
@ -28,23 +34,142 @@ class _SwiperPageState extends State<SwiperPage> {
// //
Navigator.pop(context); Navigator.pop(context);
}), }),
child: Swiper( child: Stack(
controller: logic.swiperController, children: [
index:logic.index, Container(
itemBuilder: (BuildContext context, int index) { child: Swiper(
print("img="+logic.imgList[index]); controller: logic.swiperController,
return SizedBox( index: logic.index,
width: double.infinity, loop: false,
child: Image.network( itemBuilder: (BuildContext context, int index) {
"${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,) if (logic.index == index) {
); return RepaintBoundary(
}, key: _globalKey,
itemCount: logic.imgList.length, child:itemWidget(logic,index));
pagination: SwiperPagination(), // }
// control: new SwiperControl(), //,线 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<SwiperLogic>(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(), //,线
// ),
// ),
// );
// });
// }
} }

View File

@ -523,7 +523,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
); );
}, },
), ),
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector( logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): _tabController.index == 0 ? GestureDetector(
onTap: () { onTap: () {
if(!logic.isShowAlbum&&controller.isMe){ if(!logic.isShowAlbum&&controller.isMe){
List<MyConfigData> numbers = []; List<MyConfigData> numbers = [];
@ -565,7 +565,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
), ),
), ),
), ),
), ) : Container(),
], ],
), ),
); );

View File

@ -142,7 +142,6 @@ flutter:
- assets/images/mine/ - assets/images/mine/
- assets/images/msg/ - assets/images/msg/
- assets/images/circle/ - assets/images/circle/
- assets/tencent_cloud_chat_sticker/
- assets/province.json - assets/province.json
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg