2.1.8代码提交

This commit is contained in:
CYH 2024-08-13 09:42:07 +08:00
parent d29f19c63b
commit c4c0b8d155
46 changed files with 2605 additions and 1416 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 67
versionName "2.1.7"
versionCode 68
versionName "2.1.8"
manifestPlaceholders = [
vivo_APPID: "105669716",
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
@ -98,6 +98,15 @@ android {
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def versionName = variant.versionName
def newName = "wly_${versionName}.apk"
if (output instanceof com.android.build.gradle.internal.api.BaseVariantOutputImpl) {
output.outputFileName = newName
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 B

View File

@ -160,8 +160,6 @@ PODS:
- TXIMSDK_Plus_iOS (7.5.4864)
- url_launcher_ios (0.0.1):
- Flutter
- video_compress (0.3.0):
- Flutter
- video_player_avfoundation (0.0.1):
- Flutter
- video_thumbnail (0.0.1):
@ -210,7 +208,6 @@ DEPENDENCIES:
- tencent_cloud_uikit_core (from `.symlinks/plugins/tencent_cloud_uikit_core/ios`)
- tencent_open_file (from `.symlinks/plugins/tencent_open_file/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_compress (from `.symlinks/plugins/video_compress/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
- video_thumbnail (from `.symlinks/plugins/video_thumbnail/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
@ -308,8 +305,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/tencent_open_file/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_compress:
:path: ".symlinks/plugins/video_compress/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/ios"
video_thumbnail:
@ -371,7 +366,6 @@ SPEC CHECKSUMS:
TUICore: 524dc9e15b71b9bb646db7d2a3813fc69cb35c7b
TXIMSDK_Plus_iOS: 51108658d2e277d85682d9e51d668632a1913591
url_launcher_ios: 68d46cc9766d0c41dbdc884310529557e3cd7a86
video_compress: fce97e4fb1dfd88175aa07d2ffc8a2f297f87fbe
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f

View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
<dict/>
</plist>

View File

@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:math';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/circle_app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_message_tooltip.dart';
import 'package:circle_app/circle_app/chat/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_chat_text_elem.dart';
import 'package:circle_app/circle_app/chat/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_merger_message_elem.dart';
import 'package:circle_app/circle_app/chat/widget/chat_msg_card_item.dart';
@ -19,7 +20,7 @@ import 'package:loading_animation_widget/loading_animation_widget.dart';
import 'package:provider/provider.dart';
import 'package:tencent_cloud_chat_uikit/data_services/core/tim_uikit_wide_modal_operation_key.dart';
import 'package:tencent_cloud_chat_uikit/ui/utils/screen_utils.dart';
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_message_tooltip.dart';
// import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_message_tooltip.dart';
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitMessageItem/TIMUIKitMessageReaction/tim_uikit_message_reaction_select_emoji.dart';
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_chat_text_translate_elem.dart';
import 'package:tencent_cloud_chat_uikit/ui/widgets/forward_message_screen.dart';

View File

@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:math';
import 'package:circle_app/circle_app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart';
import 'package:circle_app/circle_app/home/logic.dart';
import 'package:circle_app/main.dart';
import 'package:circle_app/net/api.dart';
import 'package:circle_app/net/dio_manager.dart';
@ -34,6 +35,7 @@ import '../../../../commons/Widgets/base_tip_widget.dart';
import '../../../../commons/Widgets/open_vip_tip/view.dart';
import '../../../../utils/eventBus.dart';
import '../../../userinfo/logic.dart';
import '../../view.dart';
import '../../widget/send_gift_dialog.dart';
enum MuteStatus { none, me, all }
@ -225,32 +227,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
// onSubmitted一样
onEmojiSubmitted() {
lastText = "";
final text = textEditingController.text.trim();
final convType = widget.conversationType;
if (text.isNotEmpty && text != zeroWidthSpace) {
if (widget.model.repliedMessage != null) {
MessageUtils.handleMessageError(
widget.model.sendReplyMessage(
text: text,
convID: widget.conversationID,
convType: convType,
atUserIDList: getUserIdFromMemberInfoMap(),
),
context);
} else {
MessageUtils.handleMessageError(
widget.model.sendTextMessage(
text: text,
convID: widget.conversationID,
convType: convType,
),
context);
}
textEditingController.clear();
goDownBottom();
}
currentCursor = null;
onSubmitted();
}
// index为emoji的index,data为baseurl+name
@ -604,8 +581,9 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
List words = [];
HomeLogic logic = Get.find<HomeLogic>();
if (!isContain) {
if (!isContain && !(widget.conversationID.contains('qpqz_prod_10_') || (logic.model?.id ?? 0) < 1000)) {
var data = await DioManager.instance
.post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2});
if (data['data']['code'] == 10000) {
@ -646,6 +624,9 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
isSending = false;
goDownBottom();
_handleSendEditStatus("", false);
EventBusManager.fire(MsgSendSuccess());
} else {
showOKToast('请输入消息内容');
isSending = false;
@ -1358,3 +1339,4 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
}
}
}

View File

@ -6,6 +6,7 @@ import 'dart:typed_data';
import 'package:circle_app/circle_app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart';
import 'package:circle_app/circle_app/chat/widget/send_gift_dialog.dart';
import 'package:circle_app/circle_app/chat/widget/send_vip_tip_dialog.dart';
import 'package:circle_app/circle_app/chat/widget/wish_dialog.dart';
import 'package:circle_app/circle_app/minefragment/logic.dart';
import 'package:circle_app/commons/Widgets/open_vip_tip/view.dart';
@ -431,6 +432,16 @@ class _TIMTextFieldLayoutNarrowState
);
}
showSendVipDialog() {
Get.bottomSheet(
SendVipDialog(
widget.conversationID,
),
isScrollControlled: true,
enableDrag: false,
);
}
@override
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
final theme = value.theme;
@ -1117,6 +1128,10 @@ class _TIMTextFieldLayoutNarrowState
}
Future checkVipStatus(int plate) async {
// qpqz_prod_10_102
if (widget.userId?.contains('qpqz_prod_10_') ?? false) {
return true;
}
var data =
await DioManager.instance.get(url: Api.getIsVips + plate.toString());

View File

@ -2,6 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/circle_app/chat/TIMUIKitChat/tim_uikit_chat.dart';
import 'package:circle_app/circle_app/chat/widget/more_dialog.dart';
import 'package:circle_app/circle_app/chat/widget/send_gift_dialog.dart';
import 'package:circle_app/circle_app/chat/widget/send_vip_tip_dialog.dart';
import 'package:circle_app/net/api.dart';
import 'package:circle_app/net/dio_manager.dart';
import 'package:circle_app/router/routers.dart';
@ -37,15 +38,11 @@ class _ChatPageState extends State<ChatPage> {
// final state = Get.find<ChatLogic>().state;
bool isShowTip = false;
String tip = 'TA上传了形象照您上传后更方便了解哦点击前往';
String tip = 'TA上传了形象照您上传后更方便了解哦';
@override
void dispose() {
// TODO: implement dispose
sub.cancel();
sub1.cancel();
super.dispose();
}
List tipSendVipIdlList = [];
int isNeedVip = 0;
final TIMUIKitChatController _timuiKitChatController =
TIMUIKitChatController();
@ -56,6 +53,17 @@ class _ChatPageState extends State<ChatPage> {
bool isBlack = false;
var sub;
var sub1;
var addSub;
@override
void dispose() {
// TODO: implement dispose
sub.cancel();
sub1.cancel();
addSub.cancel();
super.dispose();
}
@override
void initState() {
// TODO: implement initState
@ -90,14 +98,18 @@ class _ChatPageState extends State<ChatPage> {
if (bean.isSuccess()) {
otherUserBean = bean.data.user;
// 2"chatNeedVip" -> 1
isNeedVip = data['data']['chatNeedVip'];
if (!isShowTip) {
fetchMyAlbum(Api.getMyAlbum);
}
if (mounted) {
setState(() {});
}
}
loadIsShowSendGiftDialogData();
}
@ -116,7 +128,7 @@ class _ChatPageState extends State<ChatPage> {
bool isOtherHave = await loadCallOutListData(otherUserBean!.id!.toString());
if (isOtherHave && !isMyHave) {
isShowTip = true;
tip = 'TA发布了喊话您发布后形象会更完善点击前往';
tip = 'TA发布了喊话您发布后形象会更完善';
} else if (otherUserBean!.userType == 1 && userInfoBean!.userType != 1) {
isShowTip = true;
tip = 'TA完成了good号认证您认证后可获得多种特权联系客服';
@ -151,11 +163,13 @@ class _ChatPageState extends State<ChatPage> {
}
}
if (mounted) {
setState(() {
});
}
}
}
loadCallOutListData(String userId) async {
@ -189,6 +203,15 @@ class _ChatPageState extends State<ChatPage> {
sub1 = EventBusManager.on<ChatRefreshMsg>().listen((event) async {
_timuiKitChatController.refreshCurrentHistoryList();
});
addSub = EventBusManager.on<MsgSendSuccess>().listen((event) {
if (isNeedVip == 1) {
if (!tipSendVipIdlList.contains(otherUserBean!.id!.toString())) {
tipSendVipIdlList.add(otherUserBean!.id!.toString());
Get.bottomSheet(SendVipDialog(otherUserBean!.account_id!),isScrollControlled:true);
}
}
});
}
Widget renderCustomStickerPanel(
@ -370,7 +393,7 @@ class _ChatPageState extends State<ChatPage> {
} else {
var result = await DioManager.instance.post(url: Api.goodAuth);
if (result['code'] == 200) {
showOKToast('发送成功');
showOKToast('客服回复您了,前往消息列表查看~');
}
}
},
@ -386,7 +409,9 @@ class _ChatPageState extends State<ChatPage> {
child: Row(
children: [
Expanded(
child: Text(
child: Row(
children: [
Text(
tip,
style: TextStyle(
color: Colors.white,
@ -394,6 +419,9 @@ class _ChatPageState extends State<ChatPage> {
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Text('点击前往',style: TextStyle(color: AppColor.mainColor,fontSize: 12.sp),)
],
)),
GestureDetector(
onTap: () async {
@ -564,3 +592,7 @@ class _ChatPageState extends State<ChatPage> {
}
class ChatLoadUserInfoData {}
class MsgSendSuccess {
}

View File

@ -1,6 +1,7 @@
import 'dart:convert';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/commons/colors/app_color.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@ -62,9 +63,16 @@ class _ChatCircleShareDialogState extends State<ChatCircleShareDialog> {
var bean = BaseResponse<InterestsBean>.fromJson(
data, (data) => InterestsBean.fromJson(data));
circle = bean.data!;
if (circle.lists.length < 20) {
InterestsBean tempCircle = bean.data!;
if (tempCircle.lists.isEmpty) {
isMore = false;
} else {
if (page == 1) {
circle = tempCircle;
} else {
circle.lists.addAll(tempCircle.lists);
}
}
setState(() {
@ -87,7 +95,13 @@ class _ChatCircleShareDialogState extends State<ChatCircleShareDialog> {
Container(
height:Get.height * 0.5,
color: Color(0xFF423055),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.sp),
topLeft: Radius.circular(10.sp)),
gradient: AppColor.bgHorLinearGradient,
),
child: circle.lists.isEmpty
? !isMore
? noResultWidget()

View File

@ -66,7 +66,7 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
children: [
Expanded(child: Container()),
Container(
margin: EdgeInsets.only(bottom: 10.sp,right: 15.sp),
margin: EdgeInsets.only(bottom: 10.sp,left: 15.sp),
child: GestureDetector(
onTap: () {
showRechargeScreenDialog().then((value) {
@ -75,7 +75,7 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
},
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(getMineImage('bi_icon4'),width: 30.sp,),
Text('首充大礼包',style: TextStyle(color: AppColor.mainColor,fontSize: 16.sp,fontWeight: FontWeight.bold),)

View File

@ -73,7 +73,7 @@ class _GiftState extends State<Gift> {
AssetsDataDataPriceConfs info =
AssetsDataDataPriceConfs.fromJson(response.last);
balanceTipStr = info.remark!.isNotEmpty
? '最高赠送' + info.remark!.split('').last + '>'
? '最高赠送' + info.remark!.split('').last + '>'
: '充值>';
}
}
@ -139,7 +139,7 @@ class _GiftState extends State<Gift> {
fontWeight: FontWeight.w500),
),
SizedBox(
width: 16.sp,
width: 8.sp,
),
Text(
balanceTipStr,

View File

@ -0,0 +1,138 @@
import 'package:circle_app/commons/colors/app_color.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'chat_gift_pannel.dart';
class SendVipDialog extends StatefulWidget {
String conversationID;
SendVipDialog(this.conversationID);
@override
_SendVipDialogState createState() => new _SendVipDialogState();
}
class _SendVipDialogState extends State<SendVipDialog> {
// TODO: add state variables and methods
@override
Widget build(BuildContext context) {
// TODO: add widget build method
return GestureDetector(
onTap: () {
},
child: Scaffold(
backgroundColor: Colors.transparent,
body: Center(
child: Container(
constraints: BoxConstraints(
maxHeight: 170.sp
),
margin: EdgeInsets.only(left: 15.sp,right: 15.sp),
padding: EdgeInsets.only(left: 15.sp,right: 15.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.sp),
gradient: AppColor.bgHorLinearGradient
// gradient: LinearGradient(colors: [Color(0xFF4C3E5F),Color(0xFF324140)]),
// border: Gra0ientBoxBorder(
// gradient:
// AppColor.mainVerLinearGradient,
// width: 1.sp,
// ),
),
child: Column(
children: [
Column(
children: [
SizedBox(height: 20.sp,),
Container(
child: Text(
'温馨提示',
style: TextStyle(color: Colors.white.withOpacity(0.75), fontSize: 17.sp,),
),
),
Container(
margin: EdgeInsets.only(top: 12.sp),
child: Text(
'因对方未开会员可能回不了您的消息,可以帮他解锁会员【成为会员】,畅聊更多话题~',
style: TextStyle(color: Colors.white, fontSize: 15.sp),
),
),
],
),
Container(
margin: EdgeInsets.only(top: 20.sp,),
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
Get.back();
},
child: Container(
height: 42.sp,
width: 126.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.sp),
color: Color(0x26FFFFFF)
),
alignment: Alignment.center,
child: Text(
'放弃',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
),
),
),
GestureDetector(
onTap: () async {
Get.back();
Get.bottomSheet(
ChatGiftPannel(
accid: widget.conversationID,
selectedIndex: 1,
),
isScrollControlled: false,
enableDrag: false,
);
},
child: Container(
height: 42.sp,
width: 126.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.sp),
gradient: AppColor.mainVerLinearGradient
),
child: Text(
'解锁',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
),
),
),
],
),
)
],
),
),
),
),
);
}
}

View File

@ -33,12 +33,16 @@ class _SvgDialogState extends State<SvgDialog>
void loadAnimation() async {
final videoItem = await SVGAParser.shared.decodeFromURL(
widget.url);
try {
animationController.videoItem = videoItem;
animationController
.forward() // Try to use .forward() .reverse()
.whenComplete(() {
Get.back();
});
} catch (e) {
}
}
@override

View File

@ -144,14 +144,13 @@ class _WishDialogState extends State<WishDialog> {
Get.back();
},
child: Container())),
SafeArea(
child: Container(
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
Container(
padding: EdgeInsets.only(left: 15.sp, right: 15.sp,bottom: MediaQuery.of(context).padding.bottom),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.sp),
bottomRight: Radius.circular(10.sp)),
color: Color(0xFF423055),
topLeft: Radius.circular(10.sp)),
gradient: AppColor.bgHorLinearGradient,
),
child: Column(
children: [
@ -306,7 +305,6 @@ class _WishDialogState extends State<WishDialog> {
)
],
),
),
)
],
),

View File

@ -39,6 +39,7 @@ class CircleLogic extends GetxController {
final RefreshController refreshController = RefreshController();
final RefreshController peopleRefreshController = RefreshController();
List visibleItems = [];
bool isShowLocationDialog = false;

View File

@ -10,6 +10,7 @@ import 'package:circle_app/circle_app/dialog/ScreenBottomSheetDialog.dart';
import 'package:circle_app/circle_app/circle/view.dart';
import 'package:circle_app/circle_app/home/logic.dart';
import 'package:circle_app/commons/Widgets/base_tip_widget.dart';
import 'package:circle_app/commons/colors/app_color.dart';
import 'package:circle_app/router/routers.dart';
import 'package:circle_app/utils/eventBus.dart';
import 'package:circle_app/utils/util.dart';
@ -19,16 +20,13 @@ import 'package:flutter_pickers/style/picker_style.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:get/get.dart';
import 'package:gradient_borders/gradient_borders.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../commons/Widgets/today_people_dialog.dart';
import '../../commons/colors/app_color.dart';
import '../../net/api.dart';
import '../../net/dio_manager.dart';
import '../../utils/cache_img.dart';
import '../minefragment/logic.dart';
import '../select_circle/logic.dart';
import '../userinfo/logic.dart';
import 'logic.dart';
@ -104,14 +102,16 @@ class _CirclePageState extends State<CirclePage>
super.build(context);
return GetBuilder<CircleLogic>(builder: (controller) {
if (currentIndex == 0) {
logic.isNewPeopleRed = false;
}
return Scaffold(
backgroundColor: Colors.transparent,
body: SafeArea(
child: Stack(
children: [
Column(children: [
navigatorItem(controller.statistics.value)
,
navigatorItem(controller.statistics.value),
// Text(controller.state.msg),
//使
]),
@ -529,7 +529,6 @@ class _CirclePageState extends State<CirclePage>
return Swiper(
itemBuilder: (BuildContext context, int index) {
var bean = logic.circle.lists[index];
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
return InfoListView(index, bean, logic);
},
onIndexChanged: (index) async {
@ -628,7 +627,9 @@ class _CirclePageState extends State<CirclePage>
getMsgImage('gift'),
width: 14.sp,
),
SizedBox(width: 2.sp,),
SizedBox(
width: 2.sp,
),
Text(
homelogic.inventStr,
style: TextStyle(
@ -671,11 +672,34 @@ class _CirclePageState extends State<CirclePage>
onTap: () {
Get.toNamed(Routes.DisCover);
},
child: Image.asset(
getCircleImage('clocked_icon'),
width: 65.sp,
child: Container(
// width: 70.sp,
padding: EdgeInsets.only(
left: 6.sp, right: 6.sp, top: 4.sp, bottom: 4.sp),
// height: 26.sp,
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(13.sp)),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
getCircleImage('lock_icon'),
height: 18.sp,
),
)),
SizedBox(
width: 2.sp,
),
Text(
'已解锁',
style: TextStyle(
color: Color(0xFFF7FAFA),
fontSize: 13.sp,
fontWeight: FontWeight.w500),
)
],
),
))),
Container(
alignment: Alignment.center,
//padding: EdgeInsets.symmetric(horizontal: 10.sp),
@ -792,7 +816,7 @@ class _CirclePageState extends State<CirclePage>
logic.snedHelloMoreData();
},
child: Container(
padding: EdgeInsets.only(left: 2.sp,right: 2.sp),
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
child: Row(
children: [
Image.asset(
@ -802,7 +826,6 @@ class _CirclePageState extends State<CirclePage>
// SizedBox(width: 2.sp,),
Container(
margin: EdgeInsets.only(top: 4.sp),
child: Text(
'30',
style: TextStyle(
@ -830,11 +853,15 @@ class _CirclePageState extends State<CirclePage>
: Row(
children: [
InkWell(
onTap: ()async {
onTap: () async {
if (_tabController.index == 2) {
var data = await DioManager.instance.get(url: Api.getUserMine);
var bean = BaseResponse<MineResponseBean>.fromJson(
data, (data) => MineResponseBean.fromJson(data));
var data = await DioManager.instance
.get(url: Api.getUserMine);
var bean =
BaseResponse<MineResponseBean>.fromJson(
data,
(data) =>
MineResponseBean.fromJson(data));
User userInfoBean = bean.data.user;
if (userInfoBean.vip > 0) {
@ -843,8 +870,6 @@ class _CirclePageState extends State<CirclePage>
showOKToast('领取特权之后更容易上精选');
showOepnVipDialog();
}
} else {
Get.bottomSheet(
TodayPeopleDialog(isShow: true),
@ -894,13 +919,15 @@ class _CirclePageState extends State<CirclePage>
? logic.orientationList
: _tabController.index == 0
? logic.new_orientationList
:logic.dis_orientationList,
roleList:
_tabController.index == 1 ? logic.roleList : _tabController.index == 0 ? logic.new_roleList : logic.dis_roleList,
: logic.dis_orientationList,
roleList: _tabController.index == 1
? logic.roleList
: _tabController.index == 0
? logic.new_roleList
: logic.dis_roleList,
isHaveCity: _tabController.index == 1,
callback: (genderList, orientationList, roleList) {
if (_tabController.index == 1) {
EventBusManager.fire(NearScrollTap());
_onRefresh();
} else if (_tabController.index == 0) {

View File

@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
@ -31,6 +32,8 @@ import 'dart:ui' as ui show PlaceholderAlignment;
const String todayAddWxStatus = 'todayAddWxStatus';
const String firstContactTip = 'firstContactTip';
class Discover extends StatefulWidget {
int unlockWxNum;
Discover(this.unlockWxNum, {super.key});
@ -76,12 +79,21 @@ class _DiscoverState extends State<Discover>
final GlobalKey _key = GlobalKey();
Timer? _timer;
int _start = 2;
void animateToOffset(ScrollController controller, double offset,
void Function() onScrollCompleted) {
controller
.animateTo(offset,
duration: const Duration(milliseconds: 200), curve: Curves.easeIn)
.then((value) {
if (widget.unlockWxNum == 0) {
stopTimer();
startTimer();
}
if (onScrollCompleted != null) {
onScrollCompleted();
}
@ -141,12 +153,39 @@ class _DiscoverState extends State<Discover>
};
}
void startTimer() {
stopTimer(); //
_start = 2;
_timer = Timer.periodic(Duration(seconds: 1), (timer) {
if (_start == 0) {
sendRequest();
stopTimer();
} else {
_start--;
}
});
}
void stopTimer() {
if (_timer != null) {
_timer!.cancel();
_timer = null;
}
}
sendRequest() async {
var data =
await DioManager.getInstance().postBody(url: Api.visitUserById,params: {'id': list[lastPage]['id']});
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
if (widget.unlockWxNum == 0) {
subscripition.cancel();
stopTimer();
}
sub.cancel();
sub1.cancel();
@ -477,22 +516,46 @@ class _DiscoverState extends State<Discover>
}
void checkIsPopWxTip() async {
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
var date = DateTime.now();
final dateFormat = DateFormat("yyyy-MM-dd");
final date2 = dateFormat.format(date);
if (sp.preferences!.containsKey(todayAddWxStatus)) {
var lastDate = sp.preferences!.getString(todayAddWxStatus);
if (lastDate != date2) {
bool isShow = await isFirstContactTip();
if (isShow) {
loadWxNumData();
sp.preferences!.setString(todayAddWxStatus, date2);
}
}
Future<bool> isFirstContactTip() async {
SharedPreferencesHelper preferences = await SharedPreferencesHelper.getInstance();
String time = await preferences!.getString(firstContactTip) ?? '';
if (time.isNotEmpty) {
DateTime dateTime = DateTime.parse(time);
bool isShow = !isWithinOneMonth(dateTime,DateTime.now());
if (isShow) {
preferences!.setString(firstContactTip, DateTime.now().toString());
}
return isShow;
} else {
sp.preferences!.setString(todayAddWxStatus, date2);
loadWxNumData();
preferences!.setString(firstContactTip, DateTime.now().toString());
}
return true;
}
bool isWithinOneMonth(DateTime time1, DateTime time2) {
//
DateTime time1PlusOneMonth = DateTime(
time1.year,
time1.month + 1,
time1.day,
time1.hour,
time1.minute,
time1.second,
time1.millisecond,
time1.microsecond,
);
// time2 time1 time1PlusOneMonth
return time2.isAfter(time1) && time2.isBefore(time1PlusOneMonth);
}
loadWxNumData() async {
var data = await DioManager.instance.get(
url: Api.checkWxNumState,

View File

@ -20,6 +20,7 @@ import 'package:get/get.dart';
import 'package:gradient_borders/box_borders/gradient_box_border.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:visibility_detector/visibility_detector.dart';
import '../../../commons/Widgets/base_tip_widget.dart';
import '../../../commons/Widgets/tag_widget.dart';
@ -68,6 +69,11 @@ class _LikeViewState extends State<LikeView>
// if (null != scroToTop) {
// EventBusManager.cancelSubscription(scroToTop!);
// }
try {
scrollController.position.isScrollingNotifier
.removeListener(isScrollingListener);
} catch (e) {}
_timer?.cancel();
EventBusManager.cancelSubscription(likeRefreshSub!);
moreScrollController.dispose();
scrollController.dispose();
@ -77,7 +83,9 @@ class _LikeViewState extends State<LikeView>
StreamSubscription? callRefreshCicle = null;
StreamSubscription? scroToTop = null;
StreamSubscription? likeRefreshSub = null;
List<int> visibleItems = [];
bool isScrolling = false;
Timer? _timer;
@override
void initState() {
// TODO: implement initState
@ -97,21 +105,57 @@ class _LikeViewState extends State<LikeView>
refreshData();
});
moreScrollController.addListener(() {
if (moreScrollController.position.maxScrollExtent == moreScrollController.offset) {
Get.toNamed(Routes.FriendsPage,arguments: 1);
if (moreScrollController.position.maxScrollExtent ==
moreScrollController.offset) {
Get.toNamed(Routes.FriendsPage, arguments: 1);
}
});
}
void isScrollingListener() {
if (scrollController.hasClients &&
scrollController.position.isScrollingNotifier.hasListeners) {
isScrolling = scrollController.position.isScrollingNotifier.value;
if (isScrolling) {
isScrolling = true;
_stopTimer();
} else {
_startTimer();
}
}
}
void _startTimer() {
// isScrolling = true;
_timer?.cancel(); //
_timer = Timer(Duration(seconds: 1), _executeTask);
}
void _stopTimer() {
_timer?.cancel();
}
void _executeTask() {
if (!isScrolling) {
//
print("执行任务");
isScrolling = false;
sendReadBottleData();
_stopTimer();
}
}
sendReadBottleData() async {
var data = await DioManager.getInstance()
.post(url: Api.readCalloutByIds, params: {'ids': visibleItems});
}
loadActiveUsersData() async {
// if (likeMore) {
var data = await DioManager.instance.get(
url: Api.activeUsers);
var data = await DioManager.instance.get(url: Api.activeUsers);
if (data["code"] == 200) {
peopleList = data['data'];
setState(() {
});
setState(() {});
}
}
@ -231,8 +275,7 @@ class _LikeViewState extends State<LikeView>
// if (bean.user!.id == userId) {
// Get.toNamed(AppRoutes.UserInfoActivity);
// } else {
Get.toNamed(Routes.UserInfoPage,
arguments: bean.user!.id!.toString());
Get.toNamed(Routes.UserInfoPage, arguments: bean.user!.id!.toString());
// }
// });
@ -278,10 +321,7 @@ class _LikeViewState extends State<LikeView>
url: "/up-service/callout/${bean.id}/chat",
);
if (data["code"] == 200) {
pushChatPage(data['data']['account_id']
.toString()
.split("_")
.last,
pushChatPage(data['data']['account_id'].toString().split("_").last,
data['data']['account_id'], bean.user!.nickname!);
await Future.delayed(Duration(seconds: 1));
@ -365,6 +405,8 @@ class _LikeViewState extends State<LikeView>
controller: scrollController,
itemCount: lists.length + recomanddlists.length + 1,
itemBuilder: (context, index) {
scrollController.position.isScrollingNotifier
.addListener(isScrollingListener);
if (lists.length - 1 >= index) {
var list = lists[index];
if (lists.length - 1 == index) {
@ -372,7 +414,6 @@ class _LikeViewState extends State<LikeView>
if (list.isQueen!) {
return Column(
children: [
vipDynamicItem(list),
GestureDetector(
onTap: () {
@ -400,7 +441,6 @@ class _LikeViewState extends State<LikeView>
} else {
return Column(
children: [
normalDynamicItem(list),
GestureDetector(
onTap: () {
@ -450,10 +490,11 @@ class _LikeViewState extends State<LikeView>
],
);
} else {
return Column(
children: [
return Column(children: [
if (index == 0 && peopleList.isNotEmpty)
morePeoleListWidget(),normalDynamicItem(list)]);
morePeoleListWidget(),
normalDynamicItem(list)
]);
}
} else if (lists.length == index &&
recomanddlists.isNotEmpty) {
@ -461,9 +502,25 @@ class _LikeViewState extends State<LikeView>
} else if (index - lists.length < recomanddlists.length) {
var list = recomanddlists[index - lists.length];
if (list.isQueen!) {
return vipDynamicItem(list);
return VisibilityDetector(
key: Key(index.toString()),
onVisibilityChanged: (visibilityInfo) {
_onVisibilityChanged(
list.id!,
visibilityInfo.visibleFraction > 0.0,
);
},
child: vipDynamicItem(list));
} else {
return normalDynamicItem(list);
return VisibilityDetector(
key: Key(index.toString()),
onVisibilityChanged: (visibilityInfo) {
_onVisibilityChanged(
list.id!,
visibilityInfo.visibleFraction > 0.0,
);
},
child: normalDynamicItem(list));
}
} else {
return Container(
@ -516,11 +573,21 @@ class _LikeViewState extends State<LikeView>
);
}
void _onVisibilityChanged(int id, bool visible) async {
if (visible) {
if (!visibleItems.contains(id)) {
visibleItems.add(id);
}
} else {
visibleItems.remove(id);
}
}
morePeoleListWidget() {
return Container(
width: Get.width,
height: 75.sp,
margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp),
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
child: ListView.builder(
controller: moreScrollController,
scrollDirection: Axis.horizontal,
@ -540,7 +607,7 @@ class _LikeViewState extends State<LikeView>
Widget MoreItem() {
return GestureDetector(
onTap: () {
Get.toNamed(Routes.FriendsPage,arguments: 1);
Get.toNamed(Routes.FriendsPage, arguments: 1);
},
child: Container(
// width: 68.sp,
@ -591,10 +658,9 @@ class _LikeViewState extends State<LikeView>
peopleWidget(Map info) {
return GestureDetector(
onTap: () {
Get.toNamed(Routes.UserInfoPage,arguments: info['id'].toString());
Get.toNamed(Routes.UserInfoPage, arguments: info['id'].toString());
},
child: Stack(
children: [
Container(
margin: EdgeInsets.only(left: 12.sp),
@ -608,8 +674,7 @@ class _LikeViewState extends State<LikeView>
width: 52.sp,
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(26.sp)
),
borderRadius: BorderRadius.circular(26.sp)),
),
ClipOval(
child: Image.network(
@ -620,16 +685,16 @@ class _LikeViewState extends State<LikeView>
),
),
if ((info['onlineFlag'] ?? '').toString().isNotEmpty)
Positioned(bottom: 0,child: Container(
Positioned(
bottom: 0,
child: Container(
height: 20.sp,
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
padding: EdgeInsets.only(left: 4.sp, right: 4.sp),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(10.sp),
borderRadius: BorderRadius.circular(10.sp),
color: AppColor.bgColor,
border: GradientBoxBorder(
gradient:
AppColor.mainVerLinearGradient,
gradient: AppColor.mainVerLinearGradient,
width: 1.sp,
),
),
@ -643,7 +708,6 @@ class _LikeViewState extends State<LikeView>
),
)))
],
),
SizedBox(
height: 3.sp,
@ -655,7 +719,6 @@ class _LikeViewState extends State<LikeView>
],
),
),
],
),
);
@ -764,8 +827,7 @@ class _LikeViewState extends State<LikeView>
bottomLeft: Radius.circular(12.sp))),
child: Text(
(lists.user!.city ?? '外星').length > 4
? (lists.user!.city ?? '外星').substring(0, 4) +
'...'
? (lists.user!.city ?? '外星').substring(0, 4) + '...'
: (lists.user!.city ?? '外星'),
style: TextStyle(color: Colors.white, fontSize: 15.sp),
))
@ -882,7 +944,9 @@ class _LikeViewState extends State<LikeView>
height: picHeight,
// color: Colors.red,
margin: EdgeInsets.only(top: 5.sp,),
margin: EdgeInsets.only(
top: 5.sp,
),
child: picHeight == 140.sp
? ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
@ -973,14 +1037,12 @@ class _LikeViewState extends State<LikeView>
),
),
Container(
margin: EdgeInsets.only(bottom: 10.sp,top: 5.sp),
margin: EdgeInsets.only(bottom: 10.sp, top: 5.sp),
child: circleInfoItem(lists.interest, lists, index),
)
],
),
),
])),
);
}
@ -1113,8 +1175,7 @@ class _LikeViewState extends State<LikeView>
),
Expanded(
child: Container(
padding: EdgeInsets.only(
left: 8.sp, top: 12.sp),
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
alignment: Alignment.centerLeft,
height: 72.sp,
child: Column(
@ -1288,8 +1349,7 @@ class _LikeViewState extends State<LikeView>
),
),
Container(
margin: EdgeInsets.only(bottom: 10.sp,top: 5.sp),
margin: EdgeInsets.only(bottom: 10.sp, top: 5.sp),
child: circleInfoItem(lists.interest, lists, index),
)
],
@ -1312,10 +1372,9 @@ class _LikeViewState extends State<LikeView>
logic.recommendCircleFriendData.isNotEmpty
? Container(
// color: Colors.red,
child: RecommendCircleFriendItem(
false,0,
recommendCircleFriendData: logic.recommendCircleFriendData,
getDataCallBack: () {
child: RecommendCircleFriendItem(false, 0,
recommendCircleFriendData: logic
.recommendCircleFriendData, getDataCallBack: () {
logic.loadRecommendCircleFriendData();
}),
)

View File

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/circle_app/circle/logic.dart';
import 'package:circle_app/circle_app/circle/view.dart';
@ -14,6 +16,7 @@ import 'package:get/get_core/src/get_main.dart';
import 'package:gradient_borders/box_borders/gradient_box_border.dart';
import 'package:keframe/keframe.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:visibility_detector/visibility_detector.dart';
import '../../../commons/Widgets/tag_widget.dart';
import 'package:flutter_bmflocation/flutter_bmflocation.dart';
@ -21,6 +24,8 @@ import 'package:flutter_bmflocation/flutter_bmflocation.dart';
import '../../../commons/colors/app_color.dart';
import 'dart:ui' as ui show PlaceholderAlignment;
import '../../../net/api.dart';
import '../../../net/dio_manager.dart';
import '../../../utils/cache_img.dart';
class Vicinity extends StatefulWidget {
@ -38,6 +43,11 @@ class _VicinityState extends State<Vicinity>
ScrollController _scrollController = ScrollController();
double maxOff = 0;
bool isScrolling = false;
Timer? _timer;
@override
bool get wantKeepAlive => true;
@override
@ -59,7 +69,12 @@ class _VicinityState extends State<Vicinity>
// TODO: implement dispose
super.dispose();
_scrollController.dispose();
try {
_scrollController.position.isScrollingNotifier.removeListener(isScrollingListener);
} catch (e) {
}
_timer?.cancel();
sub.cancel();
}
@ -82,14 +97,24 @@ class _VicinityState extends State<Vicinity>
padding: EdgeInsets.all(10.sp),
itemCount: widget.logic.vicinityList.length + 1,
itemBuilder: (context, index) {
_scrollController.position.isScrollingNotifier
.addListener(isScrollingListener);
if (index == 0) {
return bannerView(widget.logic);
} else {
return FrameSeparateWidget(
index: index,
child: VisibilityDetector(
key: Key(index.toString()),
onVisibilityChanged: (visibilityInfo) {
_onVisibilityChanged(
index - 1,
visibilityInfo.visibleFraction > 0.0,
);
},
child: ListItem(
widget.logic.vicinityList[index - 1],
index - 1));
index - 1)));
}
},
),
@ -121,6 +146,59 @@ class _VicinityState extends State<Vicinity>
});
}
void _onVisibilityChanged(int index, bool visible) async {
int id = widget.logic.vicinityList[index].id;
if (visible) {
if (!widget.logic.visibleItems.contains(id)) {
widget.logic.visibleItems.add(id);
}
} else {
widget.logic.visibleItems.remove(id);
}
}
void isScrollingListener() {
if (_scrollController.hasClients && _scrollController.position.isScrollingNotifier.hasListeners) {
isScrolling = _scrollController.position.isScrollingNotifier.value;
if (isScrolling) {
isScrolling = true;
_stopTimer();
} else {
_startTimer();
}
}
}
void _startTimer() {
// isScrolling = true;
_timer?.cancel(); //
_timer = Timer(Duration(seconds: 1), _executeTask);
}
void _stopTimer() {
_timer?.cancel();
}
void _executeTask() {
if (!isScrolling) {
//
print("执行任务");
isScrolling = false;
sendReadPeopleData();
_stopTimer();
}
}
sendReadPeopleData() async {
var data =
await DioManager.getInstance().post(
url: Api.visitUserByIds, params: {'ids': widget.logic.visibleItems});
}
Widget bannerView(CircleLogic controller) {
return SizedBox(
height: 160.sp,

View File

@ -110,13 +110,17 @@ class _CircleListPageState extends State<CircleListPage>
logic.update();
}
return logic.isLoadFial ? noResultWidget(tip:'',callBack: () {
return logic.isLoadFial
? noResultWidget(
tip: '',
callBack: () {
logic.isLoadFial = false;
logic.isLoad = true;
logic.update();
logic.loadMyInfo();
logic.loadData();
}) : logic.isLoad
})
: logic.isLoad
? loaddingWidget(true)
: Container(
width: Get.width,
@ -127,8 +131,10 @@ class _CircleListPageState extends State<CircleListPage>
width: 65.sp,
child: Column(
children: [
leftItem('', logic.currentIndex == -1, false, -1),
leftItem('', logic.currentIndex == -2, false, -2),
leftItem(
'', logic.currentIndex == -1, false, -1),
leftItem(
'', logic.currentIndex == -2, false, -2),
Container(
alignment: Alignment.center,
height: 20,
@ -145,14 +151,17 @@ class _CircleListPageState extends State<CircleListPage>
controller: logic.myCircleCtr,
itemBuilder: (context, index) {
return leftItem(
logic.mycircle.lists[index].title,
logic.mycircle.lists[index]
.title,
logic.currentIndex == index,
logic.hasNewList.length > index
logic.hasNewList.length >
index
? logic.hasNewList[index]
: false,
index);
},
itemCount: logic.mycircle.lists.length,
itemCount:
logic.mycircle.lists.length,
)))
],
)),
@ -167,15 +176,17 @@ class _CircleListPageState extends State<CircleListPage>
logic.update();
},
)
: RightCircleIten( logic.currentIndex,
: RightCircleIten(
logic.currentIndex,
logic.mycircle
.lists[logic.currentIndex],
logic,key: ValueKey(
'${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),)))
logic,
key: ValueKey(
'${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),
)))
// InfoListView(
// )))
],
),
@ -687,9 +698,11 @@ class _CircleListPageState extends State<CircleListPage>
maxWidth: double.infinity,
minHeight: 0.0,
maxHeight: double.infinity,
child: Image.asset(getCircleImage('circle_selected_bg'),width: 65.sp,),
child: Image.asset(
getCircleImage('circle_selected_bg'),
width: 65.sp,
),
),
if (text.isEmpty && index == -1)
topCicleStatusItem(
isSelcted,

View File

@ -1,3 +1,5 @@
import 'dart:math';
import 'package:circle_app/circle_app/circle_list/widgets/hug_tip.dart';
import 'package:circle_app/commons/colors/app_color.dart';
import 'package:flutter/foundation.dart';
@ -26,6 +28,7 @@ import 'package:gradient_borders/box_borders/gradient_box_border.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import 'package:visibility_detector/visibility_detector.dart';
import '../../../commons/Widgets/tag_widget.dart';
import '../../../net/api.dart';
@ -109,7 +112,6 @@ class _RightCircleItenState extends State<RightCircleIten>
loadInterestAgent();
}
loadInterestAgent() async {
var data = await DioManager.instance.get(
url: "${Api.interestAgent}$circleId",
@ -312,13 +314,16 @@ class _RightCircleItenState extends State<RightCircleIten>
GestureDetector(
onTap: () {
if (interestAgentMap.isNotEmpty) {
Get.toNamed(Routes.UserInfoPage,arguments: interestAgentMap['user']['id'].toString());
Get.toNamed(Routes.UserInfoPage,
arguments: interestAgentMap['user']['id'].toString());
}
},
child: Text(
interestAgentMap.isNotEmpty ? interestAgentMap['user']['nickname'] : '',
style: TextStyle(color: AppColor.mainColor, fontSize: 13.sp),
interestAgentMap.isNotEmpty
? interestAgentMap['user']['nickname']
: '',
style:
TextStyle(color: AppColor.mainColor, fontSize: 13.sp),
),
),
SizedBox(
@ -387,7 +392,6 @@ class _RightCircleItenState extends State<RightCircleIten>
],
),
),
],
);
}
@ -474,10 +478,13 @@ class _RightCircleItenState extends State<RightCircleIten>
double contentHeight(String content) {
return calculateTextHeight(
content, 17.sp, FontWeight.w300, Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 64.sp, 3);
content,
17.sp,
FontWeight.w300,
Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 64.sp,
3);
}
@override
Widget build(BuildContext context) {
if (widget.bean.image.isEmpty) {
@ -503,10 +510,8 @@ class _RightCircleItenState extends State<RightCircleIten>
});
}
double textHeight = contentHeight(widget.bean.intro);
return ClipRRect(
borderRadius: BorderRadius.circular(10.sp),
child: Container(
@ -529,51 +534,60 @@ class _RightCircleItenState extends State<RightCircleIten>
margin: EdgeInsets.only(top: 72.sp),
child: NotificationListener<ScrollNotification>(
onNotification: (notification) {
if (notification is OverscrollNotification && notification.overscroll < -15) {
if (notification is OverscrollNotification &&
notification.overscroll < -15) {
// NestedScrollView的滚动
if (!refreshController.isLoading && scrollController.offset == 0) {
if (refreshController.headerStatus != RefreshStatus.refreshing &&
scrollController.offset == 0) {
count++;
print(notification);
if (count > 0 && count == 2 ) {
if (count == 2) {
refreshController.requestRefresh();
}
return true;
}
}
return true;
},
child: SmartRefresher(
controller: refreshController,
// scrollController: scrollController,
onRefresh: () {
EventBusManager.fire(RightRefreshContrller(_tabController.index));
EventBusManager.fire(
RightRefreshContrller(_tabController.index));
Future.delayed(Duration(milliseconds: 200), () {
refreshController.refreshCompleted();
loadInterestAgent();
count = 0;
});
// refreshController.refreshToIdle();
},
enablePullDown:true,
enablePullUp: false,
enablePullDown: true,
enablePullUp: true,
child: NestedScrollView(
// physics: ClampingScrollPhysics(),
controller: scrollController,
headerSliverBuilder: (context, isScrolled) {
print('isScrolled' + isScrolled.toString());
return [
return <Widget>[
if (!isScrolled)
SliverToBoxAdapter(
child: circleTiitleWidget(
urlList,
widgets,
)),
];
},
body: Column(
SliverPersistentHeader(
pinned: true,
delegate: MySliverAppBarDelegate(
minHeight: 35,
maxHeight: 35,
child: Stack(
fit: StackFit.expand,
children: [
Container(
color: AppColor.bgColor,
child: Image.asset(
getCircleImage('circle_bg'),
fit: BoxFit.cover,
),
),
Container(
height: 35.sp,
// color: Colors.red,
@ -583,19 +597,25 @@ class _RightCircleItenState extends State<RightCircleIten>
TabBar(
isScrollable: true,
controller: _tabController,
labelPadding: EdgeInsets.symmetric(horizontal: 5.0.sp),
labelPadding: EdgeInsets.symmetric(
horizontal: 5.0.sp),
indicator: UnderlineTabIndicator(
borderSide: BorderSide(
color: const Color(0xFF00FFF4),
),
),
indicatorColor: const Color(0xFF00FFF4),
indicatorColor:
const Color(0xFF00FFF4),
indicatorWeight: 2.sp,
labelColor: const Color(0xFF00FFF4),
unselectedLabelColor: const Color(0xB3FFFFFF),
indicatorSize: TabBarIndicatorSize.label,
indicatorPadding:
EdgeInsets.only(left: 12.sp, right: 12.sp, bottom: 8.sp),
unselectedLabelColor:
const Color(0xB3FFFFFF),
indicatorSize:
TabBarIndicatorSize.label,
indicatorPadding: EdgeInsets.only(
left: 12.sp,
right: 12.sp,
bottom: 8.sp),
tabs: [
Tab(
child: Text(
@ -619,7 +639,8 @@ class _RightCircleItenState extends State<RightCircleIten>
fontSize: 18.sp,
shadows: [
Shadow(
color: const Color(0xFFF657FF).withOpacity(0.5),
color: const Color(0xFFF657FF)
.withOpacity(0.5),
offset: Offset(0, -2), //
blurRadius: 3, //
// spreadRadius: 0
@ -637,8 +658,7 @@ class _RightCircleItenState extends State<RightCircleIten>
),
],
),
onTap: (index) {
},
onTap: (index) {},
),
Expanded(child: Container()),
GestureDetector(
@ -648,17 +668,19 @@ class _RightCircleItenState extends State<RightCircleIten>
},
child: Container(
height: 24.sp,
margin: EdgeInsets.all(0.6.sp),
padding: EdgeInsets.only(
left: 6.sp, right: 6.sp,),
left: 6.sp,
right: 6.sp,
),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
borderRadius:
BorderRadius.circular(17.0),
color: const Color(0xFF392D53),
border: GradientBoxBorder(
gradient:
AppColor.mainVerLinearGradient,
gradient: AppColor
.mainVerLinearGradient,
width: 1.sp,
),
),
@ -678,29 +700,40 @@ class _RightCircleItenState extends State<RightCircleIten>
],
),
),
Expanded(
child: TabBarView(
],
),
),
),
];
},
body: TabBarView(
controller: _tabController,
children: [
RightCircleListWidget(widget.index, widget.bean, widget.logic,0,scrollController,interestAgentMap,() {
RightCircleListWidget(
widget.index,
widget.bean,
widget.logic,
0,
scrollController,
interestAgentMap, () {
_tabController.index = 1;
setState(() {
});
Future.delayed(Duration(milliseconds: 200),() {
EventBusManager.fire(RightScrollViewIsEnd(true));
setState(() {});
Future.delayed(Duration(milliseconds: 200), () {
EventBusManager.fire(
RightScrollViewIsEnd(true));
});
}),
RightCircleListWidget(widget.index, widget.bean, widget.logic,1,scrollController,interestAgentMap,(){
}),
RightCircleListWidget(
widget.index,
widget.bean,
widget.logic,
1,
scrollController,
interestAgentMap,
() {}),
],
),
),
],
)
),
)),
),
),
),
@ -994,25 +1027,30 @@ class _RightCircleItenState extends State<RightCircleIten>
}
void sendApplyToAgentData() async {
var data = await DioManager.instance
.post(url: Api.applyToAgent + '$circleId');
var data =
await DioManager.instance.post(url: Api.applyToAgent + '$circleId');
if (data['code'] == 200) {
var con;
if(kDebugMode){
if (kDebugMode) {
con = V2TimConversation(
conversationID: "c2c_qpqz_dev_10_102", userID: "qpqz_dev_10_102", showName: "测试乐园客服", type: 1);
}else{
conversationID: "c2c_qpqz_dev_10_102",
userID: "qpqz_dev_10_102",
showName: "测试乐园客服",
type: 1);
} else {
con = V2TimConversation(
conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
conversationID: "c2c_qpqz_prod_10_102",
userID: "qpqz_prod_10_102",
showName: "乐园客服",
type: 1);
}
Get.toNamed(Routes.Chat, arguments: con);
} else if (data['code'] == 32104) {
showReportDialog(Get.context!,data['msg']);
showReportDialog(Get.context!, data['msg']);
}
}
void showReportDialog(BuildContext context,String msg) {
void showReportDialog(BuildContext context, String msg) {
showDialog(
context: context,
builder: (BuildContext context) {
@ -1065,7 +1103,6 @@ class _RightCircleItenState extends State<RightCircleIten>
mainAxisAlignment: MainAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
Get.back();
@ -1113,9 +1150,11 @@ class _RightCircleItenState extends State<RightCircleIten>
void showSendMoneyDialog(String userId) {
if (interestAgentMap.isNotEmpty) {
Get.bottomSheet(HugTip(userId, interestAgentMap['rewardConfigs'], () {
Get.bottomSheet(
HugTip(userId, interestAgentMap['rewardConfigs'], () {
loadInterestAgent();
}),isScrollControlled: true);
}),
isScrollControlled: true);
}
}
}
@ -1129,7 +1168,9 @@ class RightCircleListWidget extends StatefulWidget {
Map interestAgentMap;
Function changeTab;
RightCircleListWidget(this.index, this.bean, this.logic,this.type,this.scrollController,this.interestAgentMap,this.changeTab, {super.key});
RightCircleListWidget(this.index, this.bean, this.logic, this.type,
this.scrollController, this.interestAgentMap, this.changeTab,
{super.key});
@override
State<RightCircleListWidget> createState() => _RightCircleListWidgetState();
@ -1152,11 +1193,15 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
var circleId = '';
List<Lists> lists = [];
Map interestAgentMap = {};
List visibleItems = [];
bool isScrolling = false;
Timer? _timer;
bool isEnd = false;
var sub;
var sub1;
bool isLoadCircleInfo = false;
@override
void dispose() {
// TODO: implement dispose
@ -1164,12 +1209,19 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
sub.cancel();
try {
sub1.camcel();
} catch (e) {
}
} catch (e) {}
callRefreshCicle?.cancel();
scrollController.dispose();
if (widget.type == 0) {
try {
scrollController.position.isScrollingNotifier
.removeListener(isScrollingListener);
} catch (e) {}
_timer?.cancel();
}
super.dispose();
}
@ -1201,16 +1253,17 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
}
});
scrollController.addListener(() {
if (scrollController.offset <= 0) {
EventBusManager.fire(RightScrollViewScrollTop());
EventBusManager.fire(RightScrollViewIsEnd(false));
isEnd = false;
setState(() {});
} else if (scrollController.offset == scrollController.position.maxScrollExtent) {
if (widget.type == 0 && refreshController.footerStatus == LoadStatus.noMore) {
// EventBusManager.fire(RightScrollViewScrollTop());
// EventBusManager.fire(RightScrollViewIsEnd(false));
//
// isEnd = false;
// setState(() {});
} else if (scrollController.offset ==
scrollController.position.maxScrollExtent) {
if (widget.type == 0 &&
refreshController.footerStatus == LoadStatus.noMore) {
widget.changeTab();
}
}
@ -1230,7 +1283,47 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
loadCallOutListData();
}
});
}
void isScrollingListener() {
if (scrollController.hasClients &&
scrollController.position.isScrollingNotifier
.hasListeners) {
isScrolling = scrollController.position.isScrollingNotifier.value;
if (isScrolling) {
isScrolling = true;
_stopTimer();
} else {
_startTimer();
}
}
}
void _startTimer() {
// isScrolling = true;
_timer?.cancel(); //
_timer = Timer(Duration(seconds: 1), _executeTask);
}
void _stopTimer() {
_timer?.cancel();
}
void _executeTask() {
if (!isScrolling) {
//
print("执行任务");
isScrolling = false;
sendReadBottleData();
_stopTimer();
}
}
sendReadBottleData() async {
var data = await DioManager.getInstance()
.post(url: Api.readCalloutByIds, params: {'ids': visibleItems});
}
@ -1239,8 +1332,8 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
url: "/up-service/interest/$circleId",
);
if (data["code"] == 200) {
widget.bean = Circle.fromJson(data['data']);
isLoadCircleInfo = true;
if (mounted) {
setState(() {});
}
@ -1249,8 +1342,11 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
loadCallOutListData() async {
var data = await DioManager.instance.get(
url: widget.type ==0 ? '/up-service/interest/$circleId/pushCallouts' : "/up-service/interest/$circleId/newCallouts",
url: widget.type == 0
? '/up-service/interest/$circleId/pushCallouts'
: "/up-service/interest/$circleId/newCallouts",
params: {"page": callOutPage, "page_size": "20"});
refreshController.refreshCompleted();
if (data["code"] == 200) {
List dataList = data["data"]["lists"] ?? [];
if (callOutPage == 1) {
@ -1316,8 +1412,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
if (bean.user!.id == userId) {
Get.toNamed(Routes.UserInfoPage);
} else {
Get.toNamed(Routes.UserInfoPage,
arguments: bean.user!.id!.toString());
Get.toNamed(Routes.UserInfoPage, arguments: bean.user!.id!.toString());
}
});
@ -1400,7 +1495,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
@override
Widget build(BuildContext context) {
if (widget.bean.image.isEmpty) {
if (widget.bean.image.isEmpty && !isLoadCircleInfo) {
loadCircleInfo();
}
List<JoinUser> urlList = widget.bean.lastJoinUsers;
@ -1423,17 +1518,31 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
});
}
return !callOutMore && lists.isEmpty ? noResultWidget() : SmartRefresher(
return !callOutMore && lists.isEmpty
? noResultWidget()
:NotificationListener<ScrollNotification>(
onNotification: (notification) {
if (notification is OverscrollNotification &&
notification.overscroll < -5) {
if (isEnd) {
isEnd = false;
widget.scrollController.animateTo(0,
duration: Duration(milliseconds: 200),
curve: Curves.easeIn);
setState(() {});
}
}
return true;
},
child: SmartRefresher(
controller: refreshController,
// onRefresh: refreshData,
enablePullDown:false,
enablePullDown: false,
onLoading: loadMore,
enablePullUp: true,
child:ListView.builder(
physics: isEnd
? BouncingScrollPhysics()
: NeverScrollableScrollPhysics(),
child: ListView.builder(
physics: !isEnd ? NeverScrollableScrollPhysics() : ClampingScrollPhysics(),
addAutomaticKeepAlives: false,
addRepaintBoundaries: false,
scrollDirection: Axis.vertical,
@ -1441,16 +1550,63 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
itemCount: lists.length,
shrinkWrap: true,
itemBuilder: (context, index) {
if (widget.type == 0) {
scrollController.position.isScrollingNotifier
.addListener(isScrollingListener);
}
Lists list = lists[index];
if (list.isQueen!) {
return vipDynamicItem(list);
} else {
return normalDynamicItem(list);
}
}),
return VisibilityDetector(
key: Key(index.toString()),
onVisibilityChanged: (visibilityInfo) {
_onVisibilityChanged(
index,
visibilityInfo.visibleFraction > 0.0,
);
},
child:vipDynamicItem(list));
} else {
return VisibilityDetector(
key: Key(index.toString()),
onVisibilityChanged: (visibilityInfo) {
_onVisibilityChanged(
index,
visibilityInfo.visibleFraction > 0.0,
);
},
child:normalDynamicItem(list));
}
})),
);
// CustomScrollView(
// physics: ClampingScrollPhysics(),
// // controller: scrollController,
// slivers: [
// SliverList(
// delegate: SliverChildBuilderDelegate((context, index) {
// Lists list = lists[index];
// if (list.isQueen!) {
// return vipDynamicItem(list);
// } else {
// return normalDynamicItem(list);
// }
// }, childCount: lists.length))
// ]),
// )
;
}
void _onVisibilityChanged(int index, bool visible) async {
int id = lists[index].id!;
if (visible) {
if (!visibleItems.contains(id)) {
visibleItems.add(id);
}
} else {
visibleItems.remove(id);
}
}
///
vipDynamicItem(Lists lists) {
@ -1707,9 +1863,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
? ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
child: VideoItemWidget(lists.album![0].url!))
: AbsorbPointer(
absorbing: !scrollController.position.maxScrollExtent.isFinite, // ListView无法滚动时GridView获取滑动事件
child: GridView.builder(
: GridView.builder(
controller: GridScrollController,
itemCount: lists.album!.length,
scrollDirection: Axis.vertical,
@ -1729,7 +1883,8 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
for (var element in lists.album!) {
imgList.add(element.url!);
}
Get.toNamed(Routes.SwiperPage, arguments: {
Get.toNamed(Routes.SwiperPage,
arguments: {
'imaglist': imgList,
'index': currentIndex
});
@ -1745,11 +1900,11 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
}),
),
),
),
Container(
height: 30.sp,
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 5.sp,bottom: 10.sp),
margin: EdgeInsets.only(
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.sp),
color: Color(0x33000000)),
@ -1833,7 +1988,10 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
if (lists.album != null) {
if (lists.album!.isNotEmpty) {
Album info = lists.album!.first;
ratio = ((Get.width - (widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp))/3) / picWidth;
ratio = ((Get.width -
(widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp)) /
3) /
picWidth;
if (info.type == 1) {
if (lists.album!.length > 3) {
picHeight = picWidth * 2;
@ -2060,7 +2218,8 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
crossAxisCount: 3, //widget
crossAxisSpacing: 4.sp,
mainAxisSpacing: 4.sp,
childAspectRatio: ratio //1widget
childAspectRatio:
ratio //1widget
),
itemBuilder: (contentxt, currentIndex) {
Album album = lists.album![currentIndex];
@ -2454,9 +2613,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
content,
17.sp,
FontWeight.w300,
Get.currentRoute == Routes.Home
? Get.width - 90.sp
: Get.width - 64.sp,
Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 64.sp,
100);
}
@ -2488,10 +2645,42 @@ class RightScrollViewIsEnd {
RightScrollViewIsEnd(this.isEnd);
}
class RightScrollViewScrollTop {}
class RightRefreshContrller {
int index;
RightRefreshContrller(this.index);
int index;
RightRefreshContrller(this.index);
}
class MySliverAppBarDelegate extends SliverPersistentHeaderDelegate {
MySliverAppBarDelegate({
required this.minHeight,
required this.maxHeight,
required this.child,
});
final double minHeight;
final double maxHeight;
final Widget child;
@override
double get minExtent => minHeight;
@override
double get maxExtent => max(maxHeight, minHeight);
@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return SizedBox.expand(child: child);
}
@override
bool shouldRebuild(MySliverAppBarDelegate oldDelegate) {
return maxHeight != oldDelegate.maxHeight ||
minHeight != oldDelegate.minHeight ||
child != oldDelegate.child;
}
}

View File

@ -2,7 +2,7 @@ import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// import 'package:flutter_install_app/flutter_install_app.dart';
import 'package:flutter_install_app/flutter_install_app.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:url_launcher/url_launcher.dart';
@ -302,7 +302,7 @@ class _CustomDialogState extends State<UpdateDialog> {
installApk() async {
//flutter_install_app
// await AppInstaller.installApk(filePath, actionRequired: false);
await AppInstaller.installApk(filePath, actionRequired: false);
}
}

View File

@ -0,0 +1,132 @@
import 'package:circle_app/circle_app/home/logic.dart';
import 'package:flutter/material.dart';
import 'package:circle_app/commons/colors/app_color.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../circle_list/logic.dart';
class LikePeoleSendedCallOutDialog extends StatelessWidget {
String desc;
// TODO: add state variables, methods and constructor params
LikePeoleSendedCallOutDialog(this.desc);
@override
Widget build(BuildContext context) {
// TODO: add widget build method
return GestureDetector(
onTap: () {
},
child: Scaffold(
backgroundColor: Colors.transparent,
body: Center(
child: Container(
constraints: BoxConstraints(
maxHeight: 170.sp
),
margin: EdgeInsets.only(left: 15.sp,right: 15.sp),
padding: EdgeInsets.only(left: 15.sp,right: 15.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.sp),
gradient: AppColor.bgHorLinearGradient
// gradient: LinearGradient(colors: [Color(0xFF4C3E5F),Color(0xFF324140)]),
// border: Gra0ientBoxBorder(
// gradient:
// AppColor.mainVerLinearGradient,
// width: 1.sp,
// ),
),
child: Column(
children: [
Column(
children: [
SizedBox(height: 20.sp,),
Container(
child: Text(
'温馨提示',
style: TextStyle(color: Colors.white.withOpacity(0.75), fontSize: 17.sp,),
),
),
Container(
margin: EdgeInsets.only(top: 12.sp),
child: Text(
desc,
style: TextStyle(color: Colors.white, fontSize: 15.sp),
),
),
],
),
Container(
margin: EdgeInsets.only(top: 20.sp,),
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
Get.back();
},
child: Container(
height: 42.sp,
width: 126.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.sp),
color: Color(0x26FFFFFF)
),
alignment: Alignment.center,
child: Text(
'放弃',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
),
),
),
GestureDetector(
onTap: () async {
Get.back();
HomeLogic logic = Get.find<HomeLogic>();
logic.updateIndex(1);
Future.delayed(Duration(milliseconds: 500),() {
final likeLogic = Get.find<LikeLogic>();
likeLogic.currentIndex == -2;
likeLogic.update();
});
},
child: Container(
height: 42.sp,
width: 126.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.sp),
gradient: AppColor.mainVerLinearGradient
),
child: Text(
'前往查看',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
),
),
),
],
),
)
],
),
),
),
),
);
}
}

View File

@ -37,6 +37,7 @@ import '../dialog/UpdateDialog.dart';
import '../invite/logic.dart';
import '../minefragment/view.dart';
import '../msg/view.dart';
import 'like_peole_sended_call_out_dialog.dart';
import 'state.dart';
import 'package:intl/intl.dart';
@ -195,7 +196,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
});
TencentImSDKPlugin.v2TIMManager.v2TIMMessageManager.addAdvancedMsgListener(
listener: V2TimAdvancedMsgListener(onRecvNewMessage: (message) {
listener: V2TimAdvancedMsgListener(onRecvNewMessage: (message) async {
getUnreadSize();
print(message);
if (message.elemType == MessageElemType.V2TIM_ELEM_TYPE_CUSTOM) {
@ -234,8 +235,12 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
});
} else if (int.parse(event) == 3) {
//
showOKToast(message.customElem!.desc!.toString());
EventBusManager.fire(LikeRefresh());
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
if (await sp.isFirstPeopleSendCallOut()) {
Future.delayed(Duration(seconds: 20),() {
showSendedCallOutDialog(message.customElem!.desc!.toString());
});
}
} else if (int.parse(event) == 5) {
//
// print(jsonData.toString());
@ -251,13 +256,19 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
logic.update();
} else if (int.parse(event) == 8) {
//
if (Get.isRegistered<World_call_outLogic>()) {
World_call_outLogic logic = Get.find<World_call_outLogic>();
logic.isNewMsg = true;
logic.update();
}
} else if (int.parse(event) == 10) {
//访
MsgLogic logic = Get.find<MsgLogic>();
logic.getMode();
} else if (int.parse(event) == 11) {
var info = jsonDecode(jsonData['content']);
EventBusManager.fire(ShowGiftNotifi(info));
}
} else if (jsonData.containsKey('type')) {
int type = jsonData['type'];
@ -296,6 +307,17 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
}
}
showSendedCallOutDialog(String desc) {
Get.bottomSheet(
LikePeoleSendedCallOutDialog(
desc
),
isScrollControlled: true,
enableDrag: false,
);
}
Future<void> checkVersion() async {
var data = await DioManager.instance.get(url: Api.APP_VERSION);
var bean = BaseResponse<UpdateInfo>.fromJson(
@ -366,6 +388,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
FlutterNativeSplash.remove();
final logic = Get.find<CircleLogic>();
logic.loadCirclePeopleData();
}
addBadge() {
@ -603,3 +626,8 @@ class conTop {
}
class MsgRecommendCardRefresh {}
class ShowGiftNotifi {
Map info;
ShowGiftNotifi(this.info);
}

View File

@ -3,6 +3,7 @@ import 'package:circle_app/circle_app/minefragment/view.dart';
import 'package:circle_app/circle_app/msg/view.dart';
import 'package:circle_app/circle_app/world_call_out/view.dart';
import 'package:circle_app/commons/colors/app_color.dart';
import 'package:circle_app/utils/eventBus.dart';
import 'package:circle_app/utils/util.dart';
import 'package:circle_app/view/ExitAppConfirmation.dart';
import 'package:flutter/material.dart';
@ -10,7 +11,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../main.dart';
import '../../router/routers.dart';
import '../../view/notice.dart';
import '../circle_list/view.dart';
import '../world_call_out/logic.dart';
import 'logic.dart';
class HomePage extends StatefulWidget {
@ -29,6 +33,7 @@ class _HomePageState extends State<HomePage>
bool get wantKeepAlive => true;
HomeLogic logic = Get.find<HomeLogic>();
var sub;
@override
void initState() {
// TODO: implement initState
@ -38,6 +43,17 @@ class _HomePageState extends State<HomePage>
vsync: this,
initialIndex: 0,
animationDuration: Duration.zero);
sub = EventBusManager.on<ShowGiftNotifi>().listen((event) {
var info = event.info;
showGiftButtonOverlay(context!, info['msg'], info['fromUser'], info['toUser'], () {
Get.until((route) => route.settings.name == Routes.Home);
logic.updateIndex(2);
World_call_outLogic worldLogic = Get.find<World_call_outLogic>();
worldLogic.index = 1;
worldLogic.loadData();
});
});
}
@override
@ -58,6 +74,7 @@ class _HomePageState extends State<HomePage>
void dispose() {
// TODO: implement dispose
super.dispose();
sub.cancel();
routeObserver.unsubscribe(this);
}

View File

@ -84,7 +84,7 @@ class Complete_materialLogic extends GetxController {
userInfoBean = bean.data.user;
state.wxEditingController.text = userInfoBean!.wx_num ;
state.nickName = userInfoBean!.nickname;
state.sex = getGenderImg(userInfoBean!.gender);
state.sex = getGenderStr(userInfoBean!.gender);
state.genderId = userInfoBean!.gender.toString();
state.age = userInfoBean!.age.toString();
state.brithday = userInfoBean!.birthday.toString();

View File

@ -803,20 +803,7 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
return ClipOval(
child: GestureDetector(
onTap: () {
if(logic.userInfoBean!=null){
var imgList = <String>[];
imgList.add(logic.userInfoBean!.avatar);
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
Get.toNamed(Routes.SwiperPage, arguments: {
'imaglist': imgList,
'index': 0
});
}
},
child:logic.userInfoBean==null ? SizedBox(
child: logic.userInfoBean==null ? SizedBox(
width: 63.sp,
height: 63.sp,
): CachedImg(
@ -825,7 +812,6 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
width: 63.sp,
height: 63.sp,
),
),
);
}

View File

@ -644,8 +644,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
const Color(0x0F4B3E5E),
const Color(0xaF334141)
])),
padding: const EdgeInsets.only(
top: 6, bottom: 6, left: 16, right: 16),
padding: EdgeInsets.only(
top: 6, bottom: 6, left: 10.sp, right: 10.sp),
child: Row(
children: [
ClipOval(child: Image.network(

View File

@ -83,8 +83,10 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
lastMessageBuilder!(lastMsg, groupAtInfoList) != null) {
return lastMessageBuilder!(lastMsg, groupAtInfoList)!;
}
return Row(
return Row(
children: [
isSameCity
? const Text('[同城]',
@ -157,7 +159,7 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
final isDesktopScreen =
TUIKitScreenUtils.getFormFactor(context) == DeviceType.Desktop;
return Container(
padding: const EdgeInsets.only(top: 6, bottom: 6, left: 16, right: 16),
padding: EdgeInsets.only(top: 6, bottom: 6, left: 10.sp, right: 10.sp),
decoration: BoxDecoration(
// color: Colors.transparent,
// gl.startPoint = CGPointMake(0.48, 0.48);

View File

@ -51,7 +51,7 @@ class _TIMLastMsgState extends TIMUIKitState<TIMLastMsg> {
final isSelf = widget.lastMsg!.isSelf ?? true;
final option1 = isSelf
? TIM_t("")
: widget.lastMsg!.nickName ?? widget.lastMsg?.sender;
: 'Ta';
if (mounted) {
setState(() {
groupTipsAbstractText = TIM_t_para(
@ -133,6 +133,16 @@ class _TIMLastMsgState extends TIMUIKitState<TIMLastMsg> {
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
final TUITheme theme = value.theme;
final icon = _getIconByMsgStatus(context);
final isRevokedMessage = widget.lastMsg!.status == 6;
if (isRevokedMessage) {
final isSelf = widget.lastMsg!.isSelf ?? true;
final option1 = isSelf
? TIM_t("")
: 'Ta';
groupTipsAbstractText = TIM_t_para(
"{{option1}}撤回了一条消息", "$option1撤回了一条消息")(option1: option1);
}
return Row(children: [
if (icon != null)
Container(

View File

@ -30,7 +30,7 @@ class MsgPage extends StatefulWidget {
}
class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
final ctr = Get.put(MsgLogic());
final ctr = Get.lazyPut(() =>MsgLogic());
// final controller = Get.find<MsgLogic>();
var logic = Get.find<CircleLogic>();
void getPipeiData() async {
@ -93,7 +93,8 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
Get.toNamed(Routes.SysNotifyListPage, arguments: selectedConv);
return;
}
Get.toNamed(Routes.Chat, arguments: selectedConv);
await Get.toNamed(Routes.Chat, arguments: selectedConv);
},
))
],
@ -177,7 +178,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
return Container(
width: Get.width,
padding: EdgeInsets.only(left: 18.sp, right: 18.sp),
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
height: 44.sp,
child: Stack(
alignment: Alignment.center,
@ -272,7 +273,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
tipWidget(MsgLogic controller) {
return Container(
margin: EdgeInsets.only(top: 10.sp, bottom: 15.sp),
padding: EdgeInsets.only(left: 16.sp, right: 12.sp),
padding: EdgeInsets.only(left: 10.sp, right: 4.sp),
width: Get.width,
height: 20.sp,
child: Row(
@ -322,7 +323,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
reconmandWidget(MsgLogic controller) {
return Container(
padding: EdgeInsets.only(left: 16.sp, right: 18.sp),
padding: EdgeInsets.only(left: 10.sp, right: 12.sp),
width: Get.width,
height: 80.sp,
child: Row(

View File

@ -417,10 +417,11 @@ class UserinfoLogic extends GetxController {
class UserBean {
int id;
String nickname;
String account_id;
String avatar;
String birthday;
String wx_num;
int chat_need_vip;
int age;
String contact;
int contactType;
@ -446,6 +447,7 @@ class UserBean {
required this.id,
required this.nickname,
required this.avatar,
required this.account_id,
required this.wx_num,
required this.birthday,
required this.age,
@ -466,6 +468,7 @@ class UserBean {
required this.lat,
required this.onlineFlag,
this.city,
required this.chat_need_vip,
required this.isOnline,
this.offlineTime,
required this.avatarThumb,
@ -478,6 +481,8 @@ class UserBean {
currentCity: json['currentCity'] ?? '',
hide_wx_num: json['hide_wx_num'] ?? 0,
orientations: json['orientations'] ?? [],
account_id: json['account_id'] ?? '',
chat_need_vip: json['chatNeedVip'],
wx_num: json['wx_num'] ?? '',
mark: json['mark'] ?? 0,
nickname: json['nickname'],

View File

@ -21,6 +21,7 @@ import '../../utils/cache_img.dart';
import '../../utils/eventBus.dart';
import '../../utils/util.dart';
import '../../view/notice.dart';
import '../circle_list/widgets/right_circle_iten.dart';
import '../home/logic.dart';
import '../select_circle/logic.dart';
import 'logic.dart';
@ -294,16 +295,23 @@ class MyTabbedScreenState extends State<UserinfoPage>
width: Get.width,
// color: Colors.red,
child: NestedScrollView(
controller: scrollController,
// controller: scrollController,
headerSliverBuilder: (context, isScrolled) {
return [
SliverOverlapAbsorber(
handle:
NestedScrollView.sliverOverlapAbsorberHandleFor(
context),
sliver: SliverToBoxAdapter(
SliverToBoxAdapter(
child: buildContent(logic),
))
),
SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
sliver:SliverPersistentHeader(
pinned: true,
delegate: MySliverAppBarDelegate(
minHeight: 35,
maxHeight: 35,
child: titleTab(logic),
),
)),
];
},
body: contentWidget(logic),
@ -752,7 +760,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
contentWidget(UserinfoLogic controller) {
return Column(
children: [
titleTab(controller),
SizedBox(height: 35.sp,),
Expanded(
child: TabBarView(
controller: _tabController,
@ -1027,6 +1035,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
)
: Expanded(
child: GridView.builder(
physics: ClampingScrollPhysics(),
padding: const EdgeInsets.only(bottom: 58.0),
shrinkWrap: true,
gridDelegate:

View File

@ -12,6 +12,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../../commons/Widgets/text_more.dart';
import '../../../net/api.dart';
@ -36,7 +37,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
@override
bool get wantKeepAlive => true;
HomeCallOutLogic? listsLg;
final RefreshController refreshController = RefreshController();
ScrollController scrollController = ScrollController();
UserinfoLogic logic = Get.find<UserinfoLogic>();
@ -98,21 +99,27 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
)
: Container(
width: Get.width,
// margin: EdgeInsets.only(top: isEnd ? 40.sp : 0.sp),
child: listLogic.lists.isEmpty
? loaddingWidget(true)
: ListView.builder(
// physics: const AlwaysScrollableScrollPhysics(),
physics: isEnd
? BouncingScrollPhysics()
: NeverScrollableScrollPhysics(),
// shrinkWrap:true,
padding: EdgeInsets.only(
bottom:
MediaQuery.of(context).padding.bottom + 56.sp),
child: listLogic.lists.isEmpty
? loaddingWidget(true)
: SmartRefresher(
controller: refreshController,
enablePullDown: false,
onLoading: () async {
await listLogic.loadCallOutListData(widget.userId);
if (listLogic.callOutMore) {
refreshController.loadNoData();
} else {
refreshController.loadComplete();
}
},
enablePullUp: true,
child: ListView.builder(
scrollDirection: Axis.vertical,
controller: listLogic.scrollController,
itemCount: listLogic.lists.length + 1,
itemCount: listLogic.lists.length,
itemBuilder: (context, index) {
if (listLogic.lists.length > index) {
Lists lists = listLogic.lists[index];
@ -121,28 +128,32 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
} else {
return normalDynamicItem(lists);
}
} else {
return Container(
margin: EdgeInsets.only(
top: listLogic.callOutMore ? 0 : 10.sp),
child: loaddingWidget(listLogic.callOutMore),
);
}
}));
},
);
})
));
});
}
///
vipDynamicItem(Lists lists) {
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
Widget descText = logic.openCallOutIdList.contains(lists.id)
? Text(
lists.content!,
style: TextStyle(color: Colors.white, fontSize: 14.sp),
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 15,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
)
: HideText(
text: lists.content!,
maxWidth: Get.currentRoute == Routes.Home
? Get.width - 90.sp
: Get.width - 20.sp,
additionText: '查看更多',
maxLines: 15,
style: TextStyle(color: Colors.white, fontSize: 14.sp),
additionStyle:
TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),
onTap: () {
logic.openCallOutIdList.add(lists.id);
setState(() {
});
setState(() {});
},
);
@ -184,7 +195,6 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
),
),
Container(
margin: EdgeInsets.only(top: 10.sp),
width: Get.width,
// height: widgetHeight,
@ -223,7 +233,11 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
Container(
// height: widgetHeight,
width: Get.width,
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp,),
padding: EdgeInsets.only(
top: 12.sp,
left: 12.sp,
right: 12.sp,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -376,7 +390,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
if (widget.userId.isEmpty)
Container(
width: Get.width,
margin: EdgeInsets.only(top: 4.sp,bottom: 5.sp),
margin: EdgeInsets.only(top: 4.sp, bottom: 5.sp),
alignment: Alignment.centerLeft,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -390,8 +404,10 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
? Container()
: GestureDetector(
onTap: () {
showCallOutTipPop(lists.id!.toString(),
listsLg!.lists.indexOf(lists),lists!.userTop! == 1);
showCallOutTipPop(
lists.id!.toString(),
listsLg!.lists.indexOf(lists),
lists!.userTop! == 1);
},
child: Icon(
Icons.more_vert,
@ -410,14 +426,24 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
///
normalDynamicItem(Lists lists) {
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
Widget descText = logic.openCallOutIdList.contains(lists.id)
? Text(
lists.content!,
style: TextStyle(color: Colors.white, fontSize: 14.sp),
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 15,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
)
: HideText(
text: lists.content!,
maxWidth: Get.currentRoute == Routes.Home
? Get.width - 90.sp
: Get.width - 20.sp,
additionText: '查看更多',
maxLines: 15,
style: TextStyle(color: Colors.white, fontSize: 14.sp),
additionStyle:
TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),
onTap: () {
logic.openCallOutIdList.add(lists.id);
setState(() {
});
setState(() {});
},
);
@ -597,7 +623,9 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
// margin: EdgeInsets.only(top: 4.sp),
child: descText,
),
SizedBox(height: picHeight > 0 ? 5.sp : 10.sp,),
SizedBox(
height: picHeight > 0 ? 5.sp : 10.sp,
),
picHeight > 0
? Container(
height: picHeight,
@ -650,8 +678,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
if (widget.userId.isEmpty)
Container(
width: Get.width,
margin: EdgeInsets.only(top: 4.sp,bottom: 5.sp),
margin: EdgeInsets.only(top: 4.sp, bottom: 5.sp),
alignment: Alignment.centerLeft,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -665,8 +692,10 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
? Container()
: GestureDetector(
onTap: () {
showCallOutTipPop(lists.id!.toString(),
listsLg!.lists.indexOf(lists),lists.userTop == 1);
showCallOutTipPop(
lists.id!.toString(),
listsLg!.lists.indexOf(lists),
lists.userTop == 1);
},
child: Icon(
Icons.more_vert,
@ -729,7 +758,11 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
return painter.width;
}
showCallOutTipPop(String calloutId, int index, bool isTop,) {
showCallOutTipPop(
String calloutId,
int index,
bool isTop,
) {
Get.bottomSheet(
CupertinoActionSheet(
title: Text(
@ -748,8 +781,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
CupertinoActionSheetAction(
onPressed: () {
Get.back();
showTipPiker(calloutId,
index);
showTipPiker(calloutId, index);
// toast('举报成功,等待反馈!');
},
child: Text('删除'),

View File

@ -34,7 +34,7 @@ class HomeCallOutLogic extends GetxController {
}
callOutPage++;
}
callOutMore = dataList.length == 20;
callOutMore = dataList.isEmpty;
update();
} else {
showOKToast(data["msg"]);

View File

@ -46,7 +46,7 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
void initState() {
// TODO: implement initState
super.initState();
logic.isNewMsg = false;
///
WidgetsBinding.instance.addObserver(this);
}
@ -57,70 +57,70 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Colors.transparent,
appBar: MyAppBar(
centerTitle: logic.total > 0
? '全球喊话' + '(${convertToTenThousand(logic.total)})'
: '全球喊话',
isBack: false,
isDiyBack: true,
backWdiget: Positioned(
left: 15.sp,
child: GestureDetector(
onTap: () {
Get.toNamed(Routes.InvitePage);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
gradient: const LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
),
color: const Color(0xFF392D53),
),
child: Container(
margin: EdgeInsets.all(0.6.sp),
padding: EdgeInsets.only(
left: 6.sp, right: 6.sp, top: 4.sp, bottom: 4.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
color: const Color(0xFF392D53),
),
child: Row(
children: [
Image.asset(
getMsgImage('gift'),
width: 14.sp,
),
SizedBox(
width: 2.sp,
),
Text(
homelogic.inventStr,
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
),
),
],
),
),
),
),
),
actionWdiget: GestureDetector(
onTap: () {
logic.showBottomSheet(context);
},
child: Image.asset(
getCircleImage('icon_screen'),
width: 30.sp,
),
),
),
// appBar: MyAppBar(
// centerTitle: logic.total > 0
// ? '全球喊话' + '(${convertToTenThousand(logic.total)})'
// : '全球喊话',
// isBack: false,
// isDiyBack: true,
// backWdiget: Positioned(
// left: 15.sp,
// child: GestureDetector(
// onTap: () {
// Get.toNamed(Routes.InvitePage);
// },
// child: Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(17.0),
// gradient: const LinearGradient(
// colors: [
// Color(0xFF06F9FA),
// Color(0xFFDC5BFD),
// ],
// ),
// color: const Color(0xFF392D53),
// ),
// child: Container(
// margin: EdgeInsets.all(0.6.sp),
// padding: EdgeInsets.only(
// left: 6.sp, right: 6.sp, top: 4.sp, bottom: 4.sp),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(17.0),
// color: const Color(0xFF392D53),
// ),
// child: Row(
// children: [
// Image.asset(
// getMsgImage('gift'),
// width: 14.sp,
// ),
// SizedBox(
// width: 2.sp,
// ),
// Text(
// homelogic.inventStr,
// style: TextStyle(
// fontSize: 12.sp,
// color: Colors.white,
// ),
// ),
// ],
// ),
// ),
// ),
// ),
// ),
// actionWdiget: GestureDetector(
// onTap: () {
// logic.showBottomSheet(context);
// },
// child: Image.asset(
// getCircleImage('icon_screen'),
// width: 30.sp,
// ),
// ),
// ),
body: Stack(
fit: StackFit.expand,
children: [
@ -133,7 +133,11 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
// logic.sendTextMessage();
},
child:
SmartRefresher(
Column(
children: [
titleWidget(),
Expanded(
child: SmartRefresher(
controller: logic.refreshController,
onLoading: () {
logic.loadMore();
@ -177,6 +181,9 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
physics: const AlwaysScrollableScrollPhysics(),
)),
),
],
),
),
Positioned(
bottom: 36.sp,
right: 10.sp,
@ -226,6 +233,100 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
});
}
titleWidget() {
return SafeArea(
child: Container(
width: Get.width,
height: 44.sp,
child:Stack(
fit: StackFit.expand,
alignment: Alignment.center,
children: [
Semantics(
namesRoute: true,
header: true,
child: Container(
alignment: Alignment.center,
width: double.infinity,
margin: const EdgeInsets.symmetric(horizontal: 48.0),
child: ShaderMask(
shaderCallback: (Rect bounds) {
return const LinearGradient(
begin: Alignment(0.0,-1.0),
end: Alignment.bottomCenter,
colors: [Color(0xff71F3F2), Color(0xffF657FF)],
).createShader(Offset.zero & bounds.size);
},
child:Text(
logic.total > 0
? '全球喊话' + '(${convertToTenThousand(logic.total)})'
: '全球喊话',
style: TextStyle(fontSize: 18.sp,fontWeight: FontWeight.w600,color: Colors.white,shadows: [Shadow(color: Color(0xffF657FF), offset: Offset(0.0, -1))]),
),
),
)),
Positioned(
left: 10.sp,
child: GestureDetector(
onTap: () {
Get.toNamed(Routes.InvitePage);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
gradient: const LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
),
color: const Color(0xFF392D53),
),
child: Container(
margin: EdgeInsets.all(0.6.sp),
padding: EdgeInsets.only(
left: 6.sp, right: 6.sp, top: 4.sp, bottom: 4.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
color: const Color(0xFF392D53),
),
child: Row(
children: [
Image.asset(
getMsgImage('gift'),
width: 14.sp,
),
SizedBox(
width: 2.sp,
),
Text(
homelogic.inventStr,
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
),
),
],
),
),
),
),
),
Positioned(right: 10.sp,child: GestureDetector(
onTap: () {
logic.showBottomSheet(context);
},
child: Image.asset(
getCircleImage('icon_screen'),
width: 30.sp,
),
),)
],
)),
);
}
double getBottomHeight(context) {
if (logic.showKeyboard) {
final currentKeyboardHeight = MediaQuery.of(context).viewInsets.bottom;
@ -751,7 +852,7 @@ class _SysItemWidgetState extends State<SysItemWidget> {
margin: EdgeInsets.only(left: 10.sp, right: 10.sp,bottom: 5.sp),
child: picHeight == 200.sp
? VideoItemWidget(list.album![0].url!)
: GridView.builder(
: MediaQuery.removePadding(removeTop: true,context: context, child:GridView.builder(
itemCount: list.album!.length,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -781,7 +882,7 @@ class _SysItemWidgetState extends State<SysItemWidget> {
),
),
);
}))
})))
: Container();
}
@ -1033,7 +1134,7 @@ class _SigalItemWidgetState extends State<SigalItemWidget> {
margin: EdgeInsets.only(left: 10.sp, right: 10.sp,bottom: 5.sp),
child: picHeight == 200.sp
? VideoItemWidget(list.album![0].url!)
: GridView.builder(
: MediaQuery.removePadding(removeTop: true,context: context, child:GridView.builder(
itemCount: list.album!.length,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -1063,7 +1164,8 @@ class _SigalItemWidgetState extends State<SigalItemWidget> {
),
),
);
}))
}),
))
: Container();
}
}

View File

@ -61,6 +61,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
} else {
FocusManager.instance.primaryFocus?.unfocus();
Navigator.pop(superContext!);
}

View File

@ -335,7 +335,7 @@ class _WxEditDialogState extends State<WxEditDialog> {
showOKToast('请设置联系方式解锁金额大于零');
return;
} else if (int.parse(moneyEditingController.text) > 300 || int.parse(moneyEditingController.text) < 10) {
showOKToast('请设置联系方式解锁金额在10元~200元之间');
showOKToast('请设置联系方式解锁金额在10元~300元之间');
return;
}
}
@ -354,16 +354,12 @@ class _WxEditDialogState extends State<WxEditDialog> {
"price": (wxInfo['price'] != null ? wxInfo['price'].toString() : '').isNotEmpty ? moneyEditingController.text.isEmpty ? 0 : moneyEditingController.text : '',
'contactType':type,
"contact": wxEditingController.text});
if (result['code'] ==200) {
if (result['code'] == 200) {
showOKToast('设置成功');
Get.back();
} else if (result['code'] == 10081) {
showRechargeScreenDialog();
}
// Get.back();
// showRechargeDialog();
},
child: Container(
height: 30.sp,

View File

@ -452,5 +452,12 @@ class Api {
//线
static const dayOnline = '/msg-service/im/chat/recommend/dayOnline';
//
static const visitUserById = '/user-service/visitUserById';
//
static const visitUserByIds = '/user-service/visitUserByIds';
//
static const readCalloutByIds = '/up-service/readCalloutByIds';
}

View File

@ -25,6 +25,8 @@ class SharedPreferencesHelper {
static const FirstAutoMatch = 'FirstAutoMatch';
static const FirstPeopleSendCallOut = 'FirstPeopleSendCallOut';
static SharedPreferencesHelper? _instance;
static SharedPreferences? _preferences;
@ -117,6 +119,22 @@ class SharedPreferencesHelper {
return true;
}
Future<bool> isFirstPeopleSendCallOut() async {
String time = preferences!.getString(FirstPeopleSendCallOut) ?? '';
if (time.isNotEmpty) {
DateTime dateTime = DateTime.parse(time);
bool isShow = !isSameDay(dateTime,DateTime.now());
if (isShow) {
preferences!.setString(FirstPeopleSendCallOut, DateTime.now().toString());
}
return isShow;
} else {
preferences!.setString(FirstPeopleSendCallOut, DateTime.now().toString());
}
return true;
}
bool isSameDay(DateTime time1, DateTime time2) {
return time1.year == time2.year &&
time1.month == time2.month &&

View File

@ -27,7 +27,7 @@ import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_conversa
import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:video_compress/video_compress.dart';
// import 'package:video_compress/video_compress.dart';
import '../circle_app/circle/logic.dart';
import '../circle_app/circle_list/logic.dart';
@ -349,21 +349,21 @@ String getRoleContent(int number) {
typedef void MyCallback(String path);
Future<void> compressVideo(
String inputPath, String outputPath, MyCallback myCallback) async {
final info = await VideoCompress.compressVideo(
inputPath,
quality: VideoQuality.MediumQuality,
deleteOrigin: false,
);
if (info != null && null != info.path) {
print(info.path);
myCallback(info.path!);
} else {
print('视频压缩失败');
}
}
// Future<void> compressVideo(
// String inputPath, String outputPath, MyCallback myCallback) async {
// final info = await VideoCompress.compressVideo(
// inputPath,
// quality: VideoQuality.MediumQuality,
// deleteOrigin: false,
// );
//
// if (info != null && null != info.path) {
// print(info.path);
// myCallback(info.path!);
// } else {
// print('视频压缩失败');
// }
// }
class CustomRefreshHeader extends StatelessWidget {
@override

View File

@ -32,7 +32,7 @@ class _ExitAppConfirmationState extends State<ExitAppConfirmation> {
// ScaffoldMessenger.of(context).showSnackBar(
// const SnackBar(content: Text('再按一次返回键退出应用')),
// );
showOKToast("按一次返回键退出应用");
showOKToast("次滑动可退出APP");
return Future.value(false);
}
return Future.value(true);

View File

@ -229,6 +229,227 @@ void showFloatingButtonOverlay(BuildContext context, String nickname,
overlayState?.insert(overlayEntry!);
}
void showGiftButtonOverlay(BuildContext context,String content,
Map sendUser, Map recevierUser, 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,
child: AnimatedContainer(
duration: const Duration(milliseconds: 500),
curve: Curves.easeInOut,
height: showMessage ? 55 : 0,
child: Container(
width: Get.width - 8,
// margin: EdgeInsets.only(top:10.sp),
padding: EdgeInsets.fromLTRB(8.sp, 8.sp, 8.sp, 8.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: const Color(0xFF353443),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// const SizedBox(width: 8),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
// direction: Axis.vertical,
children: [
GestureDetector(
onTap: () {
countdownTimer.cancel();
try {
overlayEntry!.remove();
} catch (e) {}
mainOverlayEntry = null;
Get.toNamed(Routes.UserInfoPage,arguments:sendUser['id'].toString());
},
child: Row(
children: [
ClipOval(
child: CachedImg(
fit: BoxFit.cover,
imageUrl: sendUser['avatar'],
width: 30.sp,
height: 30.sp,
),
),
Container(
// width: 70.sp,
child: Text(
sendUser['nickname'],
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: AppColor.mainColor,
fontSize: 15.sp,
),
),
),
],
),
),
Container(
// width: 70.sp,
child: Text(
'',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color.fromRGBO(247, 250, 250, 1.0),
fontSize: 15.sp,
),
),
),
GestureDetector(
onTap: () {
countdownTimer.cancel();
try {
overlayEntry!.remove();
} catch (e) {}
mainOverlayEntry = null;
Get.toNamed(Routes.UserInfoPage,arguments:recevierUser['id'].toString());
},
child: Container(
// width: 70.sp,
child: Text(
recevierUser['nickname'],
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: AppColor.mainColor,
fontSize: 15.sp,
),
),
),
),
Container(
// width: 70.sp,
child: Text(
'礼物' + content.split(recevierUser['nickname']).last,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color.fromRGBO(247, 250, 250, 1.0),
fontSize: 15.sp,
),
),
),
],
),
),
GestureDetector(
onTap: () {
countdownTimer.cancel();
try {
overlayEntry!.remove();
} catch (e) {}
mainOverlayEntry = null;
noticeCallback();
// logic.setLike();
// logic.showMessage = false;
// logic.update();
},
child: Container(
// margin: EdgeInsets.only(top: 6.sp),
height: 24,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
gradient: const LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
padding: EdgeInsets.symmetric(
horizontal: 8.sp, vertical: 0.sp),
child: Text(
'围观',
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
),
),
),
),
// ),
],
),
),
),
),
Positioned(
top: MediaQuery.of(context).padding.top,
right: 5.sp,
child: GestureDetector(
onTap: () {
countdownTimer.cancel();
//
try {
overlayEntry!.remove();
} catch (e) {}
mainOverlayEntry = null;
},
child: Container(
height: 15,
width: 20,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(10),
bottomLeft: Radius.circular(10)),
gradient: AppColor.tagVerLinearGradient),
alignment: Alignment.center,
child: Icon(
Icons.close,
size: 15,
color: Colors.white,
),
),
))
],
);
},
);
// 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;
}
});
// OverlayEntry Overlay
overlayState?.insert(overlayEntry!);
}
void showTipFloatingButtonOverlay(BuildContext context, String tip) {
OverlayState? overlayState = Overlay.of(context);
late OverlayEntry overlayEntry;

View File

@ -21,7 +21,6 @@ import photo_manager
import shared_preferences_foundation
import sqflite
import url_launcher_macos
import video_compress
import wakelock_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
@ -41,6 +40,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
VideoCompressPlugin.register(with: registry.registrar(forPlugin: "VideoCompressPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
}

View File

@ -45,10 +45,10 @@ packages:
dependency: "direct main"
description:
name: app_settings
sha256: "2ec421f375d747916c4c0193933567074ea60c4f01c4a68642f07fef1002524e"
sha256: e6a34735d4ddb24ca9c5fd7e965ec65c8b611cbd3a329152c294f9e9f4bacb33
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.4"
version: "4.3.1"
archive:
dependency: transitive
description:
@ -630,6 +630,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.3"
flutter_install_app:
dependency: "direct main"
description:
name: flutter_install_app
sha256: "9b117006d17c900e671c26bcbc9b15c7b8efd15d6f9b4442ad5d576de20fab53"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
flutter_intl:
dependency: "direct main"
description:
@ -1906,14 +1914,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
video_compress:
dependency: "direct main"
description:
name: video_compress
sha256: "407693726e674a1e1958801deb2d9daf5a5297707ba6d03375007012dae7389a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.2"
video_player:
dependency: "direct main"
description:
@ -1962,6 +1962,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.5.3"
visibility_detector:
dependency: "direct main"
description:
name: visibility_detector
sha256: ec932527913f32f65aa01d3a393504240b9e9021ecc77123f017755605e48832
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.2"
wakelock:
dependency: transitive
description:

View File

@ -79,7 +79,7 @@ dependencies:
#时间戳
flutter_intl: ^0.0.1
#视频压缩
video_compress: ^3.1.2
# video_compress: ^3.1.2
#图片缓存
cached_network_image: ^3.2.3
#网络拦截
@ -90,7 +90,7 @@ dependencies:
fluwx: ^3.8.1+1
event_bus: ^2.0.0
#安装apk
# flutter_install_app: 1.3.0
flutter_install_app: 1.3.0
#闪屏页
flutter_native_splash: 2.2.16
#腾讯离线推送
@ -112,13 +112,15 @@ dependencies:
#边框渐变
gradient_borders: ^1.0.0
#系统设置 安卓4.3.1 苹果4.0.4
app_settings: 4.0.4
app_settings: 4.3.1
#百度定位插件
flutter_bmflocation: ^3.6.0
#通知权限
notification_permissions: ^0.6.1
#分帧
keframe: ^2.0.6
#判断item是否可见
visibility_detector: ^0.2.2
dev_dependencies:
flutter_test: