2.0.2代码提交

This commit is contained in:
CYH 2024-03-06 15:01:18 +08:00
parent 8f674b5f78
commit 6efa96a0d6
22 changed files with 621 additions and 352 deletions

View File

@ -71,8 +71,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode 52
versionName "2.0.2"
versionCode 53
versionName "2.0.3"
manifestPlaceholders = [
vivo_APPID: "105669716",
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -315,7 +315,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
SPEC CHECKSUMS:
app_settings: 54b8813f690b34f757c0bf97a46637bed5acc76c
app_settings: d103828c9f5d515c4df9ee754dabd443f7cedcf3
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
BMKLocationKit: a93bc412af3a601f12d243f4fb83f77650103e56
Bugly: b8715e6ec4004b7f7fbffab0643ba80545aee3da

View File

@ -383,7 +383,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.4.5;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -534,7 +534,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.4.5;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -579,7 +579,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.4.5;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

View File

@ -743,7 +743,8 @@ class _TIMTextFieldLayoutNarrowState
getImageFile();
},
child:
Image.asset(getMsgImage('photo'), width: 40.sp),
Opacity(opacity: 0.75,
child: Image.asset(getMsgImage('photo'), width: 40.sp)),
),
GestureDetector(
onTap: () {
@ -754,8 +755,10 @@ class _TIMTextFieldLayoutNarrowState
}
getTakeImageFile();
},
child: Image.asset(getMsgImage('take_photo'),
width: 40.sp),
child: Opacity(opacity: 0.75,
child: Image.asset(getMsgImage('take_photo'),
width: 40.sp),
),
),
GestureDetector(
onTap: () async {
@ -780,8 +783,10 @@ class _TIMTextFieldLayoutNarrowState
}
getVideoFile(ImageSource.gallery);
},
child: Image.asset(getMsgImage('icon_video'),
width: 40.sp),
child: Opacity(opacity: 0.75,
child: Image.asset(getMsgImage('icon_video'),
width: 40.sp),
),
),
GestureDetector(
onTap: () {
@ -792,8 +797,10 @@ class _TIMTextFieldLayoutNarrowState
}
getVideoFile(ImageSource.camera);
},
child: Image.asset(getMsgImage('icon_video_camera'),
width: 40.sp),
child: Opacity(opacity: 0.75,
child: Image.asset(getMsgImage('icon_video_camera'),
width: 40.sp),
),
),
],
),
@ -884,6 +891,10 @@ class _TIMTextFieldLayoutNarrowState
);
}
opacityWidget(Widget child) {
return Opacity(opacity: 0.75,child: widget,);
}
chatActionWidget(String img, String action, GestureTapCallback onTap) {
return GestureDetector(
onTap: onTap,

View File

@ -9,6 +9,7 @@ import 'package:circle_app/network/api.dart';
import 'package:circle_app/network/dio_manager.dart';
import 'package:circle_app/router/app_routers.dart';
import 'package:circle_app/util/util.dart';
import 'package:circle_app/view/notice.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@ -16,13 +17,12 @@ import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_chat_glo
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_chat_controller.dart';
import '../../common/colors/app_color.dart';
import '../../util/eventBus.dart';
import '../userinfo/logic.dart';
class ChatPage extends StatefulWidget {
ChatPage({Key? key})
: super(key: key);
ChatPage({Key? key}) : super(key: key);
@override
State<ChatPage> createState() => _ChatPageState();
@ -32,6 +32,10 @@ class _ChatPageState extends State<ChatPage> {
// final logic = Get.find<ChatLogic>();
//
// final state = Get.find<ChatLogic>().state;
bool isShowTip = false;
String tip = 'Ta主页形象质量不错哦您也完善一下呗点击前往';
@override
void dispose() {
// TODO: implement dispose
@ -40,9 +44,9 @@ class _ChatPageState extends State<ChatPage> {
}
final TIMUIKitChatController _timuiKitChatController =
TIMUIKitChatController();
TIMUIKitChatController();
V2TimConversation con = Get.arguments;
User? userInfoBean;
UserBean? userInfoBean;
UserBean? otherUserBean;
String conversationID = '';
bool isBlack = false;
@ -54,25 +58,26 @@ class _ChatPageState extends State<ChatPage> {
super.initState();
initEventBus();
loadMyInfo();
loadUserData();
}
void loadIsShowSendGiftDialogData() async {
var data = await DioManager.instance.get(url: Api.isShow_give_gift + conversationID.split('_').last);
var data = await DioManager.instance
.get(url: Api.isShow_give_gift + conversationID.split('_').last);
if (data['code'] == 200) {
if (data['data']) {
Get.bottomSheet(SendGiftDialog(accid: conversationID,title: data['msg'],), isScrollControlled: true,
Get.bottomSheet(
SendGiftDialog(
accid: conversationID,
title: data['msg'],
),
isScrollControlled: true,
enableDrag: false);
}
}
}
loadUserData() async {
conversationID = con!.conversationID!;
String url = "${Api.getUserInfoTA + conversationID.split('_').last}/home";
var data = await DioManager.instance.get(url: url);
@ -82,48 +87,71 @@ class _ChatPageState extends State<ChatPage> {
if (bean.isSuccess()) {
otherUserBean = bean.data.user;
if (!isShowTip) {
setState(() {
});
fetchMyAlbum(Api.getMyAlbum);
}
setState(() {});
}
loadIsShowSendGiftDialogData();
}
Future<void> fetchMyAlbum(String url) async {
var myAlbumData = await DioManager.instance.get(url: url);
var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson(
myAlbumData, (myAlbumData) => AlbumResponseBean.fromJson(myAlbumData));
initEventBus()async{
sub = EventBusManager.on<SendCoustomMessage>().listen((event) async{
V2TimValueCallback<V2TimMessage>? sendMessageRes =
await _timuiKitChatController.sendMessage(
messageInfo: event.createCustomMessageRes?.data?.messageInfo);
if (sendMessageRes!.code == 0) {
//
if (sendMessageRes.data?.customElem?.extension != 'cardData') {
showOKToast('发送成功');
}
//
sendMessageRes.data?.customElem?.data; //data
sendMessageRes.data?.customElem?.desc; //desc
sendMessageRes.data?.customElem?.extension; //extension
}
});
if (myAlbumBean.isSuccess()) {
List list = myAlbumBean.data.lists ?? [];
if (list.isEmpty) {
isShowTip = true;
tip = '您还没上传照片,上传后更方便了解,点击前往';
setState(() {
});
} else {
if (otherUserBean!.userType == 1 && userInfoBean!.userType != 1) {
isShowTip = true;
setState(() {
});
}
}
}
}
Widget renderCustomStickerPanel({
sendTextMessage,
sendFaceMessage,
deleteText,
addCustomEmojiText,
addText,
List<CustomEmojiFaceData> defaultCustomEmojiStickerList = const [],
double? height,
double? width
}) {
initEventBus() async {
sub = EventBusManager.on<SendCoustomMessage>().listen((event) async {
V2TimValueCallback<V2TimMessage>? sendMessageRes =
await _timuiKitChatController.sendMessage(
messageInfo: event.createCustomMessageRes?.data?.messageInfo);
if (sendMessageRes!.code == 0) {
//
if (sendMessageRes.data?.customElem?.extension != 'cardData') {
showOKToast('发送成功');
}
//
sendMessageRes.data?.customElem?.data; //data
sendMessageRes.data?.customElem?.desc; //desc
sendMessageRes.data?.customElem?.extension; //extension
}
});
}
Widget renderCustomStickerPanel(
{sendTextMessage,
sendFaceMessage,
deleteText,
addCustomEmojiText,
addText,
List<CustomEmojiFaceData> defaultCustomEmojiStickerList = const [],
double? height,
double? width}) {
final defaultEmojiList =
defaultCustomEmojiStickerList.map((customEmojiPackage) {
defaultCustomEmojiStickerList.map((customEmojiPackage) {
return CustomStickerPackage(
name: customEmojiPackage.name,
baseUrl: "assets/custom_face_resource/${customEmojiPackage.name}",
@ -133,7 +161,7 @@ class _ChatPageState extends State<ChatPage> {
.asMap()
.keys
.map((idx) =>
CustomSticker(index: idx, name: customEmojiPackage.list[idx]))
CustomSticker(index: idx, name: customEmojiPackage.list[idx]))
.toList(),
menuItem: CustomSticker(
index: 0,
@ -141,8 +169,8 @@ class _ChatPageState extends State<ChatPage> {
));
}).toList();
return StickerPanel(
// height: 100.sp,
backgroundColor:Colors.transparent,
// height: 100.sp,
backgroundColor: Colors.transparent,
showBottomContainer: true,
sendTextMsg: sendTextMessage,
sendFaceMsg: (index, data) =>
@ -158,103 +186,185 @@ class _ChatPageState extends State<ChatPage> {
@override
Widget build(BuildContext context) {
//
return TIMChat(
conversation: con,
customStickerPanel: renderCustomStickerPanel,
// onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{
// var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: userId.toString().split('_').last,preventDuplicates: false);
// // setState(() {
// //
// // });
// },
controller : _timuiKitChatController,
config: TIMUIKitChatConfig(
return Stack(
fit: StackFit.expand,
children: [
TIMChat(
conversation: con,
customStickerPanel: renderCustomStickerPanel,
// onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{
// var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: userId.toString().split('_').last,preventDuplicates: false);
// // setState(() {
// //
// // });
// },
controller: _timuiKitChatController,
config: TIMUIKitChatConfig(
// 使
isAllowClickAvatar: true,
isUseDefaultEmoji: true,
isAllowLongPressMessage: true,
isShowReadingStatus: true,
isShowGroupReadingStatus: true,
notificationTitle: "",
isUseMessageReaction: true,
notificationBody:
(V2TimMessage message, String convID, ConvType convType) {
// V2TIM_ELEM_TYPE_NONE = 0, ///<
// V2TIM_ELEM_TYPE_TEXT = 1, ///<
// V2TIM_ELEM_TYPE_CUSTOM = 2, ///<
// V2TIM_ELEM_TYPE_IMAGE = 3, ///<
// V2TIM_ELEM_TYPE_SOUND = 4, ///<
// V2TIM_ELEM_TYPE_VIDEO = 5, ///<
// V2TIM_ELEM_TYPE_FILE = 6, ///<
// V2TIM_ELEM_TYPE_LOCATION = 7, ///<
// V2TIM_ELEM_TYPE_FACE = 8, ///<
// V2TIM_ELEM_TYPE_GROUP_TIPS = 9, ///< Tips
// V2TIM_ELEM_TYPE_MERGER = 10, ///<
// 使
isAllowClickAvatar: true,
isUseDefaultEmoji: true,
isAllowLongPressMessage: true,
isShowReadingStatus: true,
isShowGroupReadingStatus: true,
notificationTitle: "",
isUseMessageReaction: true,
notificationBody: (V2TimMessage message, String convID, ConvType convType) {
// V2TIM_ELEM_TYPE_NONE = 0, ///<
// V2TIM_ELEM_TYPE_TEXT = 1, ///<
// V2TIM_ELEM_TYPE_CUSTOM = 2, ///<
// V2TIM_ELEM_TYPE_IMAGE = 3, ///<
// V2TIM_ELEM_TYPE_SOUND = 4, ///<
// V2TIM_ELEM_TYPE_VIDEO = 5, ///<
// V2TIM_ELEM_TYPE_FILE = 6, ///<
// V2TIM_ELEM_TYPE_LOCATION = 7, ///<
// V2TIM_ELEM_TYPE_FACE = 8, ///<
// V2TIM_ELEM_TYPE_GROUP_TIPS = 9, ///< Tips
// V2TIM_ELEM_TYPE_MERGER = 10, ///<
if (userInfoBean == null) {
loadMyInfo();
}
if (userInfoBean == null) {
loadMyInfo();
}
if (message.elemType ==1) {
return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname ?? '昵称待审核') +':' : '') + message.textElem!.text! ?? '';
} else if (message.elemType == 3) {
return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname ?? '昵称待审核') +':' : '') + '发了一张图片';
} else if (message.elemType == 4) {
return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname ?? '昵称待审核') +':' : '') + '发了一条语音';
} else if (message.elemType == 5) {
return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname ?? '昵称待审核') +':' : '') + '发了一条视频';
} else {
return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname ?? '昵称待审核') +':' : '') + '发了一条消息';
}
},
groupReadReceiptPermissionList: [
GroupReceiptAllowType.work,
GroupReceiptAllowType.meeting,
GroupReceiptAllowType.public
],
),
customAppBar:MyAppBar(
centerTitle: '',
actionWdiget: GestureDetector(
onTap: () {
Get.bottomSheet(
MoreDialog(
if (message.elemType == 1) {
return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty
? (userInfoBean!.nickname ?? '昵称待审核') + ':'
: '') +
message.textElem!.text! ??
'';
} else if (message.elemType == 3) {
return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty
? (userInfoBean!.nickname ?? '昵称待审核') + ':'
: '') +
'发了一张图片';
} else if (message.elemType == 4) {
return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty
? (userInfoBean!.nickname ?? '昵称待审核') + ':'
: '') +
'发了一条语音';
} else if (message.elemType == 5) {
return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty
? (userInfoBean!.nickname ?? '昵称待审核') + ':'
: '') +
'发了一条视频';
} else {
return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty
? (userInfoBean!.nickname ?? '昵称待审核') + ':'
: '') +
'发了一条消息';
}
},
groupReadReceiptPermissionList: [
GroupReceiptAllowType.work,
GroupReceiptAllowType.meeting,
GroupReceiptAllowType.public
],
),
customAppBar: MyAppBar(
centerTitle: '',
actionWdiget: GestureDetector(
onTap: () {
Get.bottomSheet(
MoreDialog(
sessionId: conversationID,
userId: (otherUserBean?.id ?? 0) > 0 ? otherUserBean!.id!.toString() : '',
userId: (otherUserBean?.id ?? 0) > 0
? otherUserBean!.id!.toString()
: '',
deleteMsgCallBack: () {
// context.read<ChatViewModel>().clearMsg();
// ChatViewModel viewModel = context.read<ChatViewModel>();
// viewModel.messageList.clear();
// viewModel.notifyListeners();
},blackCallBack: () {
},
blackCallBack: () {
loadUserData();
},),
isScrollControlled: true);
// defaultAvatarTap(widget.sessionId, isSelf:false);
},
child: Image.asset(
getMsgImage('msg_more'),
width: 24.sp,
)),
onPressed: () {},
},
),
isScrollControlled: true);
// defaultAvatarTap(widget.sessionId, isSelf:false);
},
child: Image.asset(
getMsgImage('msg_more'),
width: 24.sp,
)),
onPressed: () {},
),
userAvatarBuilder: (BuildContext context, V2TimMessage message) {
return avatarWidget(
(message.faceUrl?.isNotEmpty ?? false)
? message.faceUrl!
: 'https://qiniuyun.leyuan666.com/quanzi/avatar/default.png',
message!);
},
),
userAvatarBuilder: (BuildContext context, V2TimMessage message) {
return avatarWidget((message.faceUrl?.isNotEmpty ?? false) ? message.faceUrl! : 'https://qiniuyun.leyuan666.com/quanzi/avatar/default.png',message!);
},
if (isShowTip)
Positioned(child: tipWidget(tip)),
],
);
}
avatarWidget(String url,V2TimMessage message, {double width = 34}) {
tipWidget(String tip) {
return Column(
children: [
GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity)!.then((value) {
loadMyInfo();
});
},
child: Container(
width: Get.width - 16,
height: 40.sp,
margin: EdgeInsets.only(top:MediaQuery.of(context).padding.top + 45),
padding: EdgeInsets.fromLTRB(16.sp, 0.sp, 16.sp, 0.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Color(0xFF353443),
),
child: Row(
children: [
Expanded(
child: Text(
tip,
style: TextStyle(
color: Colors.white,
fontSize: 13.sp,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
)),
GestureDetector(
onTap: () {
isShowTip = false;
setState(() {
});
},
child: Icon(
Icons.close,
size: 20,
color: AppColor.mainColor,
),
)
],
),
),
),
],
);
}
avatarWidget(String url, V2TimMessage message, {double width = 34}) {
print(url);
return GestureDetector(
onTap: () async {
// V2TimConversation con = Get.arguments;
// if (message.sender == con.userID.toString()) return;
var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: message.sender!.toString().split('_').last,preventDuplicates: false);
},
onTap: () async {
// V2TimConversation con = Get.arguments;
// if (message.sender == con.userID.toString()) return;
var data = await Get.toNamed(AppRoutes.UserInfoActivity,
arguments: message.sender!.toString().split('_').last,
preventDuplicates: false);
},
child: Stack(
alignment: Alignment.center,
children: [
@ -262,27 +372,31 @@ class _ChatPageState extends State<ChatPage> {
getCircleImage('avatar_bg'),
width: width.sp,
),
url.contains("http") ? ClipOval(
child: CachedNetworkImage(
imageUrl:url,
width: (width - 2).sp,
height: (width - 2).sp,
fit: BoxFit.cover,
),
) : Text(url,style: TextStyle(color: Color(0xffF756FF),fontSize: 12.sp),)
url.contains("http")
? ClipOval(
child: CachedNetworkImage(
imageUrl: url,
width: (width - 2).sp,
height: (width - 2).sp,
fit: BoxFit.cover,
),
)
: Text(
url,
style: TextStyle(color: Color(0xffF756FF), fontSize: 12.sp),
)
],
));
}
void loadMyInfo() async {
var data = await DioManager.instance.get(url: Api.getUserMine);
if (data['code'] == 200) {
var bean = BaseResponse<MineResponseBean>.fromJson(
data, (data) => MineResponseBean.fromJson(data));
if (bean.isSuccess()) {
userInfoBean = bean.data.user!;
var bean = BaseResponse<ResponseBean>.fromJson(
data, (data) => ResponseBean.fromJson(data));
}
if (bean.code == 200) {
userInfoBean = bean.data.user!;
loadUserData();
}
}
@ -290,82 +404,78 @@ class _ChatPageState extends State<ChatPage> {
return userInfoBean == null
? Container()
: GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity,
arguments: userInfoBean!.id!.toString());
},
child: Container(
margin:
EdgeInsets.only(left: 0 > 99 ? 80.sp : 65.sp),
child: Row(
children: [
ClipOval(
child: Image.network(
otherUserBean!.avatar!,
width: 40.sp,
height: 40.sp,
fit: BoxFit.cover,
)),
SizedBox(
width: 4.sp,
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity,
arguments: userInfoBean!.id!.toString());
},
child: Container(
margin: EdgeInsets.only(left: 0 > 99 ? 80.sp : 65.sp),
child: Row(
children: [
ClipOval(
child: Image.network(
otherUserBean!.avatar!,
width: 40.sp,
height: 40.sp,
fit: BoxFit.cover,
)),
SizedBox(
width: 4.sp,
),
// Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// userInfoBean!.nickname ?? '昵称待审核',
// style: TextStyle(
// color: Colors.white,
// fontSize:
// ((otherUserBean!.onlineFlag ?? '').isNotEmpty)
// ? 14.sp
// : 16.sp),
// ),
// if ((otherUserBean!.onlineFlag ?? '').isNotEmpty)
// Text(
// otherUserBean!.onlineFlag ?? '',
// style: TextStyle(
// color: Colors.white.withOpacity(0.75),
// fontSize: 12.sp),
// ),
// ],
// ),
// if (otherUserBean!.! <= 1 ))
// GestureDetector(
// onTap: () {
// if (userInfoBean!.followStatus! <= 1) {
// setFollow();
// } else {
// addFollowHeader();
// }
// },
// child: Container(
// margin: EdgeInsets.only(
// left: 5.sp,
// ),
// padding: EdgeInsets.only(left: 4.sp, right: 4.sp),
// height: 22.sp,
// decoration: BoxDecoration(
// gradient: AppColor.newMainVerLinearGradient,
// borderRadius: BorderRadius.circular(14),
// ),
// child: Center(
// child: Text(
// userInfoBean!.followStatus! <= 1 ? '关注' : '+特别关心',
// style: TextStyle(
// fontSize: 12.sp, color: Colors.white)),
// ),
// ),
// ),
],
),
),
// Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// userInfoBean!.nickname ?? '昵称待审核',
// style: TextStyle(
// color: Colors.white,
// fontSize:
// ((otherUserBean!.onlineFlag ?? '').isNotEmpty)
// ? 14.sp
// : 16.sp),
// ),
// if ((otherUserBean!.onlineFlag ?? '').isNotEmpty)
// Text(
// otherUserBean!.onlineFlag ?? '',
// style: TextStyle(
// color: Colors.white.withOpacity(0.75),
// fontSize: 12.sp),
// ),
// ],
// ),
// if (otherUserBean!.! <= 1 ))
// GestureDetector(
// onTap: () {
// if (userInfoBean!.followStatus! <= 1) {
// setFollow();
// } else {
// addFollowHeader();
// }
// },
// child: Container(
// margin: EdgeInsets.only(
// left: 5.sp,
// ),
// padding: EdgeInsets.only(left: 4.sp, right: 4.sp),
// height: 22.sp,
// decoration: BoxDecoration(
// gradient: AppColor.newMainVerLinearGradient,
// borderRadius: BorderRadius.circular(14),
// ),
// child: Center(
// child: Text(
// userInfoBean!.followStatus! <= 1 ? '关注' : '+特别关心',
// style: TextStyle(
// fontSize: 12.sp, color: Colors.white)),
// ),
// ),
// ),
],
),
),
);
);
}
}
class ChatLoadUserInfoData {
}
class ChatLoadUserInfoData {}

View File

@ -522,8 +522,6 @@ class CircleLogic extends GetxController {
if (info.isNotEmpty) {
newPeopleList.addAll(info);
}
newPeopleList.addAll(list);
pageIndex = pageIndex + 1;
} else {
peopleRefreshController.loadNoData();

View File

@ -688,7 +688,7 @@ class _CirclePageState extends State<CirclePage>
},
child: Image.asset(
getCircleImage('clocked_icon'),
width: 50.sp,
width: 65.sp,
),
)),
Container(
@ -813,7 +813,7 @@ class _CirclePageState extends State<CirclePage>
// SizedBox(width: 2.sp,),
Container(
margin: EdgeInsets.only(top: 4.sp),
child: Text(
'30',
style: TextStyle(

View File

@ -387,7 +387,9 @@ class _DiscoverState extends State<Discover>
Get.toNamed(AppRoutes.Swiper,
arguments: {
'imaglist': imgList,
'index': index
'index': index,
'userId':user.userId.toString()
});
},
child: CachedNetworkImage(

View File

@ -98,7 +98,8 @@ class _DiscoverItemState extends State<DiscoverItem> {
Get.toNamed(AppRoutes.Swiper,
arguments: {
'imaglist': imgList,
'index': index
'index': index,
'userId':user.id.toString()
});
},
child: CachedNetworkImage(

View File

@ -697,12 +697,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
for (var element in lists.chat!.users!) {
widgets.add(Positioned(
left: 12.sp * index,
child: GestureDetector(
onTap: () {
// pushOtherPeopleHomePage(element.id.toString());
},
child: circleWidget(element.avatar!,element.id.toString(), width: 24),
),
child: circleWidget(element.avatar!,element.id.toString(), width: 24),
));
index++;
}
@ -723,14 +718,14 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
Album info = lists.album!.first;
if (info.type == 1) {
double picWidth = (Get.width - (widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp))/3;
double picWidth = (Get.width - (widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp))/3 + 45;
if (lists.album!.length > 3) {
picHeight = picWidth * 2;
} else {
picHeight = picWidth;
}
} else {
picHeight = 140.sp;
picHeight = 200.sp;
}
}
}
@ -937,15 +932,6 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
borderRadius: BorderRadius.circular(6.sp),
child: CachedNetworkImage(
imageUrl: album.url!,
// placeholder: (context, url) =>
// SizedBox(
// width: 30.sp,
// height: 30.sp,
// child: CircularProgressIndicator(
// color: Color(0xFF07FAFB),
// strokeWidth: 2.sp,
// ),
// ),
errorWidget: (context, url, error) =>
const Icon(Icons.error),
fit: BoxFit.cover,
@ -990,8 +976,6 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
GestureDetector(
onTap: () {
pushMsgPage(lists, widget.bean.id.toString(),);
// pushHomePage(
// lists, widget.bean.id.toString());
},
child: Image.asset(
getCircleImage('chat'),
@ -1016,19 +1000,19 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
);
double picHeight = 0.0;
double picWidth = (Get.width - (widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp))/3 + 45;
if (lists.album != null) {
if (lists.album!.isNotEmpty) {
Album info = lists.album!.first;
if (info.type == 1) {
double picWidth = (Get.width - (widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp))/3;
if (lists.album!.length > 3) {
picHeight = picWidth * 2;
} else {
picHeight = picWidth;
}
} else {
picHeight = 140.sp;
picHeight = 200.sp;
}
}
}
@ -1038,11 +1022,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
lists.chat!.users!.forEach((element) {
widgets.add(Positioned(
left: 12.sp * index,
child: GestureDetector(
onTap: () {
},
child: circleWidget(element.avatar!,element.id.toString(), width: 24),
),
child: circleWidget(element.avatar!,element.id.toString(), width: 24),
));
index++;
});
@ -1224,7 +1204,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
height: picHeight,
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(top: 5.sp),
child: picHeight == 140.sp
child: picHeight == 200.sp
? ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
child: VideoItemWidget(lists.album![0].url!))
@ -1236,7 +1216,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
crossAxisCount: 3, //widget
crossAxisSpacing: 8.sp,
mainAxisSpacing: 8.sp,
childAspectRatio: 1.0 //1widget
childAspectRatio:0.7 //1widget
),
itemBuilder: (contentxt, currentIndex) {
Album album = lists.album![currentIndex];
@ -1459,7 +1439,27 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
circleWidget(String url, String userId,{double width = 24}) {
return GestureDetector(
onTap: (){
onTap: () async {
if (widget.bean.is_limit&&widget.bean.amount > 0) {
await refreshCircleData();
}
if (widget.bean.is_limit&&widget.bean.amount>0) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1,(payResult){
widget.bean.is_limit = false;
if (Get.isRegistered<CircleLogic>()) {
var logic = Get.find<CircleLogic>();
for (var element in logic.circle.lists) {
if (element.id == widget.bean.id) {
element.is_limit = false;
element.isJoin = true;
}
}
logic.update();
}
Get.back();
},widget.bean.ios_item);
return;
}
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
},
child: Stack(

View File

@ -596,14 +596,14 @@ class _LikeViewState extends State<LikeView>
Album info = lists.album!.first;
if (info.type == 1) {
double picWidth = (Get.width - 20.sp) / 3;
double picWidth = (Get.width - 100.sp) / 3 + 40;
if (lists.album!.length > 3) {
picHeight = picWidth * 2;
} else {
picHeight = picWidth;
}
} else {
picHeight = 140.sp;
picHeight = 200.sp;
}
}
}
@ -787,7 +787,7 @@ class _LikeViewState extends State<LikeView>
crossAxisCount: 3, //widget
crossAxisSpacing: 8.sp,
mainAxisSpacing: 8.sp,
childAspectRatio: 1.0 //1widget
childAspectRatio: 0.7 //1widget
),
itemBuilder: (contentxt, currentIndex) {
Album album = lists.album![currentIndex];
@ -799,7 +799,8 @@ class _LikeViewState extends State<LikeView>
}
Get.toNamed(AppRoutes.Swiper, arguments: {
'imaglist': imgList,
'index': currentIndex
'index': currentIndex,
'userId':lists.user!.id.toString()
});
},
child: ClipRRect(
@ -902,14 +903,14 @@ class _LikeViewState extends State<LikeView>
Album info = lists.album!.first;
if (info.type == 1) {
double picWidth = (Get.width - 20.sp) / 3;
double picWidth = (Get.width - 100.sp) / 3 + 40;
if (lists.album!.length > 3) {
picHeight = picWidth * 2;
} else {
picHeight = picWidth;
}
} else {
picHeight = 140.sp;
picHeight = 200.sp;
}
}
}
@ -1103,7 +1104,7 @@ class _LikeViewState extends State<LikeView>
crossAxisSpacing: 8.sp,
mainAxisSpacing: 8.sp,
childAspectRatio:
1.0 //1widget
0.7 //1widget
),
itemBuilder: (contentxt, currentIndex) {
Album album = lists.album![currentIndex];
@ -1122,7 +1123,8 @@ class _LikeViewState extends State<LikeView>
Get.toNamed(AppRoutes.Swiper,
arguments: {
'imaglist': imgList,
'index': currentIndex
'index': currentIndex,
'userId':lists.user!.id.toString()
});
},
child: ClipRRect(

View File

@ -374,7 +374,8 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
Get.toNamed(AppRoutes.Swiper,
arguments: {
'imaglist': item.images,
'index': i
'index': i,
// 'userId': item.id.toString()
});
},
child: ListAlbumItem(item.images[i], i)),

View File

@ -177,6 +177,7 @@ class Sys_notify_listLogic extends GetxController {
void onRefresh() async {
page = 0;
next = 0;
lists.clear();
initList();
}

View File

@ -281,7 +281,7 @@ class QuickPage extends StatelessWidget {
child: _buildInterestsListView(item.interests)),
if (item.images.isNotEmpty)
Container(
height: 98,
height: 130,
margin: EdgeInsets.only(
top: 6.sp, left: 10.sp, right: 10.sp, bottom: 10.sp),
child: SingleChildScrollView(
@ -295,7 +295,8 @@ class QuickPage extends StatelessWidget {
onTap: () {
Get.toNamed(AppRoutes.Swiper, arguments: {
'imaglist': item.images,
'index': i
'index': i,
'userId':item.id.toString()
});
},
child: ListAlbumItem(item.images[i], i)),
@ -315,7 +316,7 @@ class QuickPage extends StatelessWidget {
borderRadius: BorderRadius.circular(8.sp),
child: CachedNetworkImage(
width: 88.sp,
height: 88.sp,
height: 130.sp,
fit: BoxFit.cover,
imageUrl: item + "?imageView2/1/w/176/h/176/q/75",
),

View File

@ -7,11 +7,15 @@ class SwiperLogic extends GetxController {
final SwiperState state = SwiperState();
List<String> imgList = Get.arguments['imaglist'] ;
int index = Get.arguments['index'] ;
String userId = '';
SwiperController swiperController = SwiperController();
@override
void onInit() {
super.onInit();
Map arg = Get.arguments;
if (arg.containsKey('userId')) {
userId = arg['userId'];
}
}
@override
void onReady() {

View File

@ -13,6 +13,7 @@ import 'package:get/get_state_manager/src/simple/get_state.dart';
import 'package:image_gallery_saver/image_gallery_saver.dart';
import 'package:qr_flutter/qr_flutter.dart';
import '../../router/app_routers.dart';
import '../home/logic.dart';
import 'logic.dart';
import 'dart:ui' as ui;
@ -113,7 +114,51 @@ class _SwiperPageState extends State<SwiperPage> {
size: 25.sp,
),
),
))
)),
if (logic.userId.isNotEmpty)
Positioned(
right: 16.sp,
top: 16.sp,
child: SafeArea(
child: GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity,
arguments: logic.userId);
Get.delete<SwiperLogic>();
},
child: Container(
width: 73.sp,
height: 25.sp,
decoration: BoxDecoration(
gradient:
AppColor.mainVerLinearGradient,
borderRadius:
BorderRadius.circular(12.5.sp)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(left: 5.sp),
child: Text(
'查看主页',
style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
),
),
),
Image(
width: 15.sp,
image: AssetImage(
getDisCoverImage("right_icon")),
// width: 44.sp,
),
],
),
),
),
)),
],
),
),

View File

@ -429,6 +429,7 @@ class UserBean {
int role;
int mark;
int orientation;
int userType;
List<Interest> interests;
List orientations;
double lng;
@ -449,6 +450,7 @@ class UserBean {
required this.age,
required this.signature,
required this.vip,
required this.userType,
required this.gender,
required this.hide_wx_num,
required this.orientations,
@ -471,6 +473,7 @@ class UserBean {
factory UserBean.fromJson(Map<String, dynamic> json) {
return UserBean(
id: json['id'],
userType: json['userType'] ?? 0,
currentCity: json['currentCity'] ?? '',
hide_wx_num: json['hide_wx_num'] ?? 0,
orientations: json['orientations'] ?? [],
@ -488,7 +491,7 @@ class UserBean {
gender: json['gender'],
role: json['role'],
orientation: json['orientation'],
interests: List<Interest>.from(
interests: json['interests'] == null ? [] : List<Interest>.from(
json['interests'].map((x) => Interest.fromJson(x)),
),
lng: json['lng'],

View File

@ -672,28 +672,31 @@ class _SearchAnimationWidgetState extends State<SearchAnimationWidget>
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return Transform.translate(
offset: Offset(
30.0 * math.cos(2 * math.pi * _controller.value),
30.0 * math.sin(2 * math.pi * _controller.value),
),
child: IconButton(
icon: Icon(
Icons.search,
color: Colors.white,
size: 50.sp,
),
onPressed: () {
//
},
),
);
}),
Stack(
children: [
Image.asset(getCircleImage('search_bg_icon'),width: 90.sp,),
AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return Container(
margin: EdgeInsets.only(left: 30.sp,top: 30.sp),
child: Transform.translate(
offset: Offset(
30.0 * math.cos(2 * math.pi * _controller.value),
30.0 * math.sin(2 * math.pi * _controller.value),
),
child: Image.asset(
getCircleImage('search_icon'),
width: 27.sp,
),
),
);
}),
],
),
Container(
margin: EdgeInsets.only(top: 50.sp),
margin: EdgeInsets.only(top: 20.sp),
child: Text(
'正在为您匹配合适的那个Ta',
style: TextStyle(color: Colors.white, fontSize: 16.sp),

View File

@ -9,34 +9,30 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../main.dart';
import '../router/app_routers.dart';
typedef void NoticeCallback();
void showFloatingButtonOverlay(
BuildContext context, String nickname, String ageMsg, String avatar,int event,NoticeCallback noticeCallback) {
void showFloatingButtonOverlay(BuildContext context, String nickname,
String ageMsg, String avatar, int event, NoticeCallback noticeCallback) {
OverlayState? overlayState = Overlay.of(context);
late OverlayEntry overlayEntry;
bool showMessage = false;
int countdownSeconds = 5; //
// Timer
late Timer countdownTimer;
// OverlayEntry
overlayEntry = OverlayEntry(
builder: (BuildContext context) {
return Stack(
alignment: Alignment.center,
children: [
Positioned(
top: MediaQuery.of(context).padding.top,
// right: 16,
// right: 16,
child: AnimatedContainer(
duration: const Duration(milliseconds: 500),
curve: Curves.easeInOut,
@ -109,13 +105,14 @@ void showFloatingButtonOverlay(
],
),
const SizedBox(height: 4),
Text( event == 0
? "看了这么久,给我点个喜欢呗~"
: event == 1
? "我喜欢了你,可以喜欢我一下吗?"
: event == 2
? "你喜欢的人上线啦,赶紧找他聊天吧!"
: "我也喜欢了你,一起聊聊呗~",
Text(
event == 0
? "看了这么久,给我点个喜欢呗~"
: event == 1
? "我喜欢了你,可以喜欢我一下吗?"
: event == 2
? "你喜欢的人上线啦,赶紧找他聊天吧!"
: "我也喜欢了你,一起聊聊呗~",
style: TextStyle(
color: Colors.grey,
fontSize: 13.sp,
@ -131,9 +128,7 @@ void showFloatingButtonOverlay(
countdownTimer.cancel();
try {
overlayEntry!.remove();
} catch (e) {
}
} catch (e) {}
mainOverlayEntry = null;
noticeCallback();
@ -162,10 +157,10 @@ void showFloatingButtonOverlay(
event == 0
? "喜欢"
: event == 1
? "回关"
: event == 2
? "私聊"
: "私聊",
? "回关"
: event == 2
? "私聊"
: "私聊",
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
@ -181,31 +176,34 @@ void showFloatingButtonOverlay(
),
),
if (event == 0)
Positioned(
top: MediaQuery.of(context).padding.top,
right: 8,
child: GestureDetector(
onTap: () {
countdownTimer.cancel();
//
try {
overlayEntry!.remove();
} catch (e) {
}
mainOverlayEntry = null;
},
child: Container(
height: 20,
width: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(topRight: Radius.circular(10),bottomLeft: Radius.circular(10)),
gradient: AppColor.mainVerLinearGradient
Positioned(
top: MediaQuery.of(context).padding.top,
right: 8,
child: GestureDetector(
onTap: () {
countdownTimer.cancel();
//
try {
overlayEntry!.remove();
} catch (e) {}
mainOverlayEntry = null;
},
child: Container(
height: 20,
width: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(10),
bottomLeft: Radius.circular(10)),
gradient: AppColor.mainVerLinearGradient),
alignment: Alignment.center,
child: Icon(
Icons.close,
size: 20,
color: Colors.white,
),
),
alignment: Alignment.center,
child: Icon(Icons.close,size: 20,color: Colors.white,),
),
))
))
],
);
},
@ -216,16 +214,105 @@ void showFloatingButtonOverlay(
countdownTimer = Timer.periodic(Duration(seconds: 1), (timer) {
if (countdownSeconds > 0) {
countdownSeconds--;
// overlayEntry.markNeedsBuild(); // OverlayEntry
// overlayEntry.markNeedsBuild(); // OverlayEntry
} else {
//
timer.cancel();
try {
overlayEntry!.remove();
} catch (e) {
}
} catch (e) {}
mainOverlayEntry = null;
}
});
// OverlayEntry Overlay
overlayState?.insert(overlayEntry!);
}
void showTipFloatingButtonOverlay(BuildContext context, String tip) {
OverlayState? overlayState = Overlay.of(context);
late OverlayEntry overlayEntry;
bool showMessage = false;
int countdownSeconds = 5; //
// Timer
late Timer countdownTimer;
// OverlayEntry
overlayEntry = OverlayEntry(
builder: (BuildContext context) {
return Column(
children: [
GestureDetector(
onTap: () {
countdownTimer.cancel();
//
try {
overlayEntry!.remove();
} catch (e) {}
mainOverlayEntry = null;
Get.toNamed(AppRoutes.UserInfoActivity);
},
child: Container(
width: Get.width - 16,
height: 40.sp,
margin: EdgeInsets.only(top:MediaQuery.of(context).padding.top + 45),
padding: EdgeInsets.fromLTRB(16.sp, 0.sp, 16.sp, 0.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Color(0xFF353443).withOpacity(0.5),
),
child: Row(
children: [
Expanded(
child: Text(
tip,
style: TextStyle(
color: Colors.grey,
fontSize: 13.sp,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
)),
GestureDetector(
onTap: () {
countdownTimer.cancel();
//
try {
overlayEntry!.remove();
} catch (e) {}
mainOverlayEntry = null;
},
child: Icon(
Icons.close,
size: 20,
color: AppColor.mainColor,
),
)
],
),
),
),
],
);
},
);
// setState(() {});
showMessage = true;
mainOverlayEntry = overlayEntry;
countdownTimer = Timer.periodic(Duration(seconds: 1), (timer) {
if (countdownSeconds > 0) {
countdownSeconds--;
// overlayEntry.markNeedsBuild(); // OverlayEntry
} else {
//
timer.cancel();
try {
overlayEntry!.remove();
} catch (e) {}
mainOverlayEntry = null;
}
});

View File

@ -112,7 +112,7 @@ dependencies:
#边框渐变
gradient_borders: ^1.0.0
#系统设置
app_settings: 4.0.4
app_settings: 4.3.1
#百度定位插件
flutter_bmflocation: ^3.6.0