代码提交
This commit is contained in:
parent
4284732820
commit
ad1cecc56d
@ -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 111
|
||||
versionName "2.6.1"
|
||||
versionCode 115
|
||||
versionName "2.6.5"
|
||||
manifestPlaceholders = [
|
||||
vivo_APPID: "105669716",
|
||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||
|
||||
@ -451,7 +451,7 @@ class _Call_out_detailPageState extends State<Call_out_detailPage> {
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -479,7 +479,7 @@ class _Call_out_detailPageState extends State<Call_out_detailPage> {
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
@ -991,7 +991,7 @@ class _Call_out_detailPageState extends State<Call_out_detailPage> {
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -1019,7 +1019,7 @@ class _Call_out_detailPageState extends State<Call_out_detailPage> {
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
|
||||
@ -1309,7 +1309,7 @@ class _TIMUIKItHistoryMessageListItemState
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
@ -1714,7 +1714,7 @@ class _TIMUIKItHistoryMessageListItemState
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
|
||||
@ -266,18 +266,18 @@ class _ChatPageState extends State<ChatPage>
|
||||
int count = 0;
|
||||
int otherCount = 0;
|
||||
currentRecordList?.forEach((element) {
|
||||
if (element?.isSelf ?? false) {
|
||||
if ((element?.isSelf ?? false) && (element?.status == MessageStatus.V2TIM_MSG_STATUS_SEND_SUCC || element?.status == 1)) {
|
||||
count++;
|
||||
} else {
|
||||
otherCount++;
|
||||
}
|
||||
});
|
||||
|
||||
// if (count > 1 && otherCount > 0) {
|
||||
if (count >= 3 && otherCount >= 3) {
|
||||
tipSendVipIdlList.add(con.userID);
|
||||
Get.bottomSheet(SendVipDialog(con.userID!),
|
||||
isScrollControlled: true);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -16,11 +16,13 @@ class Circie_rowLogic extends GetxController {
|
||||
List locationDataList = [];
|
||||
Position? position;
|
||||
var isLoad = true;
|
||||
int chargeFreeNum = 0;
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
loadCircleManagerData();
|
||||
// loadCircleInfo();
|
||||
// loadCircleUserData();
|
||||
}
|
||||
|
||||
@ -54,6 +56,7 @@ class Circie_rowLogic extends GetxController {
|
||||
url: Api.queryRecommendInterestUser,
|
||||
params: params);
|
||||
if (result['code'] == 200) {
|
||||
chargeFreeNum = result['data']['chargeFreeNum'];
|
||||
List dataList = result['data']['lists'];
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:circle_app/circle_app/circle/widgets/discover.dart';
|
||||
import 'package:circle_app/utils/cache_img.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -6,6 +8,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 '../../commons/Widgets/base_tip_widget.dart';
|
||||
import '../../commons/Widgets/my_app_bar.dart';
|
||||
import '../../commons/Widgets/tag_widget.dart';
|
||||
import '../../commons/colors/app_color.dart';
|
||||
@ -376,6 +379,7 @@ class _CircleUserInfoItemState extends State<CircleUserInfoItem> with AutomaticK
|
||||
final RefreshController refreshController = RefreshController();
|
||||
int page = 1;
|
||||
bool isLoad = true;
|
||||
int chargeFreeNum = 0;
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
@ -526,6 +530,32 @@ class _CircleUserInfoItemState extends State<CircleUserInfoItem> with AutomaticK
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// if (item.imId.isNotEmpty) {
|
||||
|
||||
// if (index > logic.chargeFreeNum && item) {
|
||||
//
|
||||
// }
|
||||
|
||||
if (logic.circleInfo.is_limit && logic.circleInfo.amount > 0 && logic.chargeFreeNum <= index) {
|
||||
showJoinCiclePiker(logic.circleInfo.id.toString(), logic.circleInfo.amount.toString(),
|
||||
logic.circleInfo.oldAmount.toString(), 2, (payResult) {
|
||||
logic.circleInfo.is_limit = false;
|
||||
if (Get.isRegistered<CircleLogic>()) {
|
||||
var logic1 = Get.find<CircleLogic>();
|
||||
for (var element in logic1.circle.lists) {
|
||||
if (element.id == logic.circleInfo.id) {
|
||||
element.is_limit = false;
|
||||
element.isJoin = true;
|
||||
}
|
||||
}
|
||||
logic.circleInfo.is_limit = false;
|
||||
logic1.update();
|
||||
logic.update();
|
||||
}
|
||||
Get.back();
|
||||
}, logic.circleInfo.ios_item);
|
||||
return;
|
||||
}
|
||||
|
||||
pushChatPage(
|
||||
userInfo['id'].toString(),
|
||||
userInfo['imId'].toString(),
|
||||
|
||||
@ -28,10 +28,11 @@ class Lists {
|
||||
String? at;
|
||||
Map? topInteractType;
|
||||
int? isInteract;
|
||||
int? chargeFreeNum;
|
||||
|
||||
String? interactedTypeEmote;
|
||||
Lists(
|
||||
{this.album, this.chat, this.content, this.id, this.isQueen, this.user,this.interactedTypeEmote});
|
||||
{this.album, this.chat, this.content, this.id, this.isQueen, this.user,this.interactedTypeEmote,this.chargeFreeNum});
|
||||
|
||||
Lists.fromJson(Map<String, dynamic> json) {
|
||||
if (json['album'] != null) {
|
||||
@ -44,6 +45,7 @@ class Lists {
|
||||
content = json['content'];
|
||||
id = json['id'];
|
||||
at = json['at'] ?? '';
|
||||
chargeFreeNum = json['chargeFreeNum'] ?? 0;
|
||||
isSystem = json['isSystem'];
|
||||
jumpInfo = json['jumpInfo'] != null
|
||||
? new JumpInfo.fromJson(json['jumpInfo'])
|
||||
|
||||
@ -68,6 +68,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
double widgetWidth = 0.0;
|
||||
Map interestAgentMap = {};
|
||||
HomeLogic homeLogic = Get.find<HomeLogic>();
|
||||
int chargeFreeNum = 0;
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
@ -190,6 +191,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
params: {"page": callOutPage, "page_size": "8"});
|
||||
if (data["code"] == 200) {
|
||||
List dataList = data["data"]["lists"] ?? [];
|
||||
chargeFreeNum = data['data']['chargeFreeNum'] ?? 0;
|
||||
if (callOutPage == 1) {
|
||||
if (lists.isNotEmpty) {
|
||||
lists.clear();
|
||||
@ -272,11 +274,11 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
}
|
||||
}
|
||||
|
||||
pushUserHome(String userId) async {
|
||||
pushUserHome(String userId,bool islimit) async {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
await refreshCircleData();
|
||||
}
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0 && islimit) {
|
||||
Get.toNamed(Routes.UserInfoPage, arguments: userId,parameters: {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})});
|
||||
} else {
|
||||
Get.toNamed(Routes.UserInfoPage, arguments: userId,parameters: {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new',});
|
||||
@ -295,7 +297,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
return;
|
||||
}
|
||||
|
||||
if (widget.bean.is_limit&&widget.bean.amount>0) {
|
||||
if (widget.bean.is_limit&&widget.bean.amount>0 && lists.indexOf(bean) >= chargeFreeNum) {
|
||||
showJoinCiclePiker(cicleId,widget.bean.amount.toString(),widget.bean.oldAmount.toString(),2,(payResult){
|
||||
widget.bean.is_limit = false;
|
||||
if (Get.isRegistered<CircleLogic>()) {
|
||||
@ -1017,13 +1019,13 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
}
|
||||
|
||||
///至尊喊话
|
||||
vipDynamicItem(Lists lists) {
|
||||
int type = (lists.topInteractType?['type'] ?? 1) - 1;
|
||||
Widget descText = widget.logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
lists.content!,
|
||||
vipDynamicItem(Lists list) {
|
||||
int type = (list.topInteractType?['type'] ?? 1) - 1;
|
||||
Widget descText = widget.logic.openCallOutIdList.contains(list.id) ? Text(
|
||||
list.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: 5,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
widget.logic.openCallOutIdList.add(lists.id);
|
||||
) : HideText(text: list.content!,maxWidth: Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 5,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
widget.logic.openCallOutIdList.add(list.id);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
@ -1033,7 +1035,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
// List<JoinUser> urlList = bean.lastJoinUsers;
|
||||
List<Widget> widgets = [];
|
||||
int index = 0;
|
||||
for (var element in lists.chat!.users!) {
|
||||
for (var element in list.chat!.users!) {
|
||||
widgets.add(Positioned(
|
||||
left: 12.sp * index,
|
||||
child: circleWidget(element.avatar!,element.id.toString(), width: 24),
|
||||
@ -1042,7 +1044,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
}
|
||||
if (widgets.isNotEmpty) {
|
||||
widgets.add(Positioned(
|
||||
left: 12.sp * lists.chat!.users!.length,
|
||||
left: 12.sp * list.chat!.users!.length,
|
||||
child: Image.asset(
|
||||
getCircleImage('more'),
|
||||
width: 24.sp,
|
||||
@ -1053,17 +1055,17 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
|
||||
|
||||
double ratio = 0;
|
||||
if (lists.album != null) {
|
||||
if (lists.album!.isNotEmpty) {
|
||||
Album info = lists.album!.first;
|
||||
if (list.album != null) {
|
||||
if (list.album!.isNotEmpty) {
|
||||
Album info = list.album!.first;
|
||||
|
||||
if (info.type == 1) {
|
||||
double picWidth = (widgetWidth - 8.sp)/3 + 45;
|
||||
ratio = (widgetWidth - 8.sp - 24.sp) / 3 / picWidth;
|
||||
if (lists.album!.length > 3) {
|
||||
if (list.album!.length > 3) {
|
||||
picHeight = picWidth * 2;
|
||||
} else {
|
||||
if (lists.album!.length == 1) {
|
||||
if (list.album!.length == 1) {
|
||||
picHeight = 250;
|
||||
} else {
|
||||
picHeight = picWidth;
|
||||
@ -1078,8 +1080,8 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Widget atWidget = Container();
|
||||
|
||||
List<Widget> atList = [];
|
||||
if (lists.at!.isNotEmpty) {
|
||||
List infoList = jsonDecode(lists.at!);
|
||||
if (list.at!.isNotEmpty) {
|
||||
List infoList = jsonDecode(list.at!);
|
||||
infoList.forEach((element) {
|
||||
atList.add(GestureDetector(
|
||||
onTap: () {
|
||||
@ -1145,7 +1147,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
),
|
||||
child:Text(
|
||||
|
||||
(lists.user!.city ?? '外星').length > 4 ? (lists.user!.city ?? '外星').substring(0,4) + '...' :(lists.user!.city ?? '外星'),
|
||||
(list.user!.city ?? '外星').length > 4 ? (list.user!.city ?? '外星').substring(0,4) + '...' :(list.user!.city ?? '外星'),
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
),
|
||||
)
|
||||
@ -1168,11 +1170,11 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
var sp = await SharedPreferencesHelper.getInstance();
|
||||
String myUserId = sp.getMyUserId();
|
||||
|
||||
if(lists.user?.id!.toString() == myUserId){
|
||||
if(list.user?.id!.toString() == myUserId){
|
||||
Get.toNamed(Routes.UserInfoPage);
|
||||
return;
|
||||
}
|
||||
pushUserHome(lists.user!.id!.toString());
|
||||
pushUserHome(list.user!.id!.toString(),lists.indexOf(list) >= chargeFreeNum);
|
||||
|
||||
},
|
||||
child: Stack(
|
||||
@ -1184,7 +1186,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
),
|
||||
ClipOval(
|
||||
child: CachedImg(
|
||||
imageUrl:lists.user!.avatar_thumb!,
|
||||
imageUrl:list.user!.avatar_thumb!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.cover,
|
||||
@ -1202,7 +1204,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
lists.user!.nickname!,
|
||||
list.user!.nickname!,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
@ -1211,7 +1213,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
UserTagWidget(lists.user!.mark!),
|
||||
UserTagWidget(list.user!.mark!),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
@ -1226,13 +1228,13 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
EdgeInsets.only(left: 6.sp, right: 6.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(9.sp),
|
||||
gradient: sexBgGradient(lists.user!.gender ?? 0,)),
|
||||
gradient: sexBgGradient(list.user!.gender ?? 0,)),
|
||||
child: Text(
|
||||
getAgeCOntent(lists.user!.gender??0, lists.user!.age??0,
|
||||
lists.user!.role??0, lists.user!.orientation??0),
|
||||
getAgeCOntent(list.user!.gender??0, list.user!.age??0,
|
||||
list.user!.role??0, list.user!.orientation??0),
|
||||
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
|
||||
style: TextStyle(
|
||||
color: sexBgColor(lists.user!.gender ?? 0,),
|
||||
color: sexBgColor(list.user!.gender ?? 0,),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
@ -1258,18 +1260,18 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
child: picHeight == 200.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(lists.album![0].url!,lists.id!.toString(),lists.user!.id.toString()))
|
||||
child: VideoItemWidget(list.album![0].url!,list.id!.toString(),list.user!.id.toString()))
|
||||
: picHeight == 250 ? GestureDetector(
|
||||
onTap: () async {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
for (var element in list.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Map<String, String> params = {};
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
await refreshCircleData();
|
||||
}
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0 && lists.indexOf(list) >= chargeFreeNum) {
|
||||
params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})};
|
||||
|
||||
// return;
|
||||
@ -1282,19 +1284,19 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': 0,
|
||||
'userId':lists.user?.id!.toString()
|
||||
'userId':list.user?.id!.toString()
|
||||
},parameters: params);
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius.circular(6.sp),
|
||||
child: CachedImg(
|
||||
imageUrl: lists.album!.first.url!,
|
||||
imageUrl: list.album!.first.url!,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
) : GridView.builder(
|
||||
itemCount: lists.album!.length,
|
||||
itemCount: list.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
@ -1304,18 +1306,18 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
childAspectRatio: ratio //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
Album album = list.album![currentIndex];
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
for (var element in list.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
await refreshCircleData();
|
||||
}
|
||||
Map<String, String>? params;
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0 && lists.indexOf(list) >= chargeFreeNum) {
|
||||
params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})};
|
||||
|
||||
// return;
|
||||
@ -1328,7 +1330,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex,
|
||||
'userId':lists.user?.id!.toString()
|
||||
'userId':list.user?.id!.toString()
|
||||
},parameters: params);
|
||||
},
|
||||
child: ClipRRect(
|
||||
@ -1346,7 +1348,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
CallOutShareDialog('','',lists), isScrollControlled: true,
|
||||
CallOutShareDialog('','',list), isScrollControlled: true,
|
||||
enableDrag: false
|
||||
);
|
||||
|
||||
@ -1362,7 +1364,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 5.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -1383,14 +1385,14 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
widgets.isNotEmpty
|
||||
? Expanded(
|
||||
child: Text(
|
||||
'${lists.chat!.count!}位圈友已私聊',
|
||||
'${list.chat!.count!}位圈友已私聊',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
@ -1398,7 +1400,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
pushMsgPage(
|
||||
lists,
|
||||
list,
|
||||
widget.bean.id.toString(),
|
||||
);
|
||||
},
|
||||
@ -1413,16 +1415,16 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
),
|
||||
GestureDetector(
|
||||
onTapUp: (TapUpDetails details) {
|
||||
if (lists.isInteract! > 0) {
|
||||
if (list.isInteract! > 0) {
|
||||
showOKToast('这个喊话已经点过了哦');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_showEmojiPicker(lists,lists.id!,context, details.globalPosition);
|
||||
_showEmojiPicker(list,list.id!,context, details.globalPosition);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 10.sp, bottom: (lists.topInteractType!['userCount'] ?? 0) > 0 ? 10.sp : 5.sp),
|
||||
margin: EdgeInsets.only(left: 10.sp, bottom: (list.topInteractType!['userCount'] ?? 0) > 0 ? 10.sp : 5.sp),
|
||||
// height: 40.sp,
|
||||
alignment: Alignment.center,
|
||||
child: Stack(
|
||||
@ -1432,15 +1434,15 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
height: 43.sp,
|
||||
),
|
||||
Text(
|
||||
lists.interactedTypeEmote ?? '❤',
|
||||
list.interactedTypeEmote ?? '❤',
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 20.sp),
|
||||
),
|
||||
if ((lists.topInteractType!['userCount'] ?? 0) > 0)
|
||||
if ((list.topInteractType!['userCount'] ?? 0) > 0)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
child: Text(
|
||||
'${lists.topInteractType!['userCount']}',
|
||||
'${list.topInteractType!['userCount']}',
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 10.sp),
|
||||
),
|
||||
@ -1458,13 +1460,13 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
}
|
||||
|
||||
///普通图文喊话
|
||||
normalDynamicItem(Lists lists) {
|
||||
int type = (lists.topInteractType?['type'] ?? 1) - 1;
|
||||
Widget descText = widget.logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
lists.content!,
|
||||
normalDynamicItem(Lists list) {
|
||||
int type = (list.topInteractType?['type'] ?? 1) - 1;
|
||||
Widget descText = widget.logic.openCallOutIdList.contains(list.id) ? Text(
|
||||
list.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: 5,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
widget.logic.openCallOutIdList.add(lists.id);
|
||||
) : HideText(text: list.content!,maxWidth: Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 5,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
widget.logic.openCallOutIdList.add(list.id);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
@ -1474,16 +1476,16 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
double picHeight = 0.0;
|
||||
double ratio = 0.0;
|
||||
double picWidth = (widgetWidth - 8.sp )/3 + 45;
|
||||
if (lists.album != null) {
|
||||
if (lists.album!.isNotEmpty) {
|
||||
Album info = lists.album!.first;
|
||||
if (list.album != null) {
|
||||
if (list.album!.isNotEmpty) {
|
||||
Album info = list.album!.first;
|
||||
|
||||
if (info.type == 1) {
|
||||
ratio = (widgetWidth - 8.sp - 24.sp) / 3 / picWidth;
|
||||
if (lists.album!.length > 3) {
|
||||
if (list.album!.length > 3) {
|
||||
picHeight = picWidth * 2;
|
||||
} else {
|
||||
if (lists.album!.length == 1) {
|
||||
if (list.album!.length == 1) {
|
||||
picHeight = 250;
|
||||
} else {
|
||||
picHeight = picWidth;
|
||||
@ -1497,7 +1499,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
|
||||
List<Widget> widgets = [];
|
||||
int index = 0;
|
||||
lists.chat!.users!.forEach((element) {
|
||||
list.chat!.users!.forEach((element) {
|
||||
widgets.add(Positioned(
|
||||
left: 12.sp * index,
|
||||
child: circleWidget(element.avatar!,element.id.toString(), width: 24),
|
||||
@ -1506,7 +1508,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
});
|
||||
if (widgets.isNotEmpty) {
|
||||
widgets.add(Positioned(
|
||||
left: 12.sp * lists.chat!.users!.length,
|
||||
left: 12.sp * list.chat!.users!.length,
|
||||
child: Image.asset(
|
||||
getCircleImage('more'),
|
||||
width: 24.sp,
|
||||
@ -1516,8 +1518,8 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Widget atWidget = Container();
|
||||
|
||||
List<Widget> atList = [];
|
||||
if (lists.at!.isNotEmpty) {
|
||||
List infoList = jsonDecode(lists.at!);
|
||||
if (list.at!.isNotEmpty) {
|
||||
List infoList = jsonDecode(list.at!);
|
||||
infoList.forEach((element) {
|
||||
atList.add(GestureDetector(
|
||||
onTap: () {
|
||||
@ -1578,7 +1580,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(0),bottomRight: Radius.circular(0),topRight: Radius.circular(12.sp),bottomLeft: Radius.circular(12.sp) )
|
||||
),
|
||||
child: Text(
|
||||
(lists.user!.city ?? '外星').length > 4 ? (lists.user!.city ?? '外星').substring(0,4) + '...' :(lists.user!.city ?? '外星'),
|
||||
(list.user!.city ?? '外星').length > 4 ? (list.user!.city ?? '外星').substring(0,4) + '...' :(list.user!.city ?? '外星'),
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
),
|
||||
)
|
||||
@ -1602,11 +1604,11 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
onTap: ()async {
|
||||
var sp = await SharedPreferencesHelper.getInstance();
|
||||
String myUserId = sp.getMyUserId();
|
||||
if(lists.user?.id!.toString() == myUserId){
|
||||
if(list.user?.id!.toString() == myUserId){
|
||||
Get.toNamed(Routes.UserInfoPage);
|
||||
return;
|
||||
}
|
||||
pushUserHome(lists.user!.id!.toString());
|
||||
pushUserHome(list.user!.id!.toString(),lists.indexOf(list) >= chargeFreeNum);
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
@ -1617,7 +1619,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
),
|
||||
ClipOval(
|
||||
child: CachedImg(
|
||||
imageUrl:lists.user!.avatar_thumb!,
|
||||
imageUrl:list.user!.avatar_thumb!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.cover,
|
||||
@ -1637,7 +1639,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
lists.user!.nickname!,
|
||||
list.user!.nickname!,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
@ -1646,7 +1648,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
UserTagWidget(lists.user!.mark!),
|
||||
UserTagWidget(list.user!.mark!),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
@ -1662,12 +1664,12 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(9.sp),
|
||||
gradient: sexBgGradient(lists.user!.gender ?? 0,)),
|
||||
gradient: sexBgGradient(list.user!.gender ?? 0,)),
|
||||
child: Text(
|
||||
getAgeCOntent(lists.user!.gender??0, lists.user!.age??0,
|
||||
lists.user!.role??0, lists.user!.orientation??0),
|
||||
getAgeCOntent(list.user!.gender??0, list.user!.age??0,
|
||||
list.user!.role??0, list.user!.orientation??0),
|
||||
style: TextStyle(
|
||||
color: sexBgColor(lists.user!.gender ?? 0,),
|
||||
color: sexBgColor(list.user!.gender ?? 0,),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
@ -1693,18 +1695,18 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
child: picHeight == 200.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(lists.album![0].url!,lists.id!.toString(),lists.user!.id.toString()))
|
||||
child: VideoItemWidget(list.album![0].url!,list.id!.toString(),list.user!.id.toString()))
|
||||
: picHeight == 250 ? GestureDetector(
|
||||
onTap: () async {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
for (var element in list.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Map<String, String> params = {};
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
await refreshCircleData();
|
||||
}
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0 && lists.indexOf(list) >= chargeFreeNum) {
|
||||
params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})};
|
||||
|
||||
// return;
|
||||
@ -1717,19 +1719,19 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': 0,
|
||||
'userId':lists.user?.id!.toString()
|
||||
'userId':list.user?.id!.toString()
|
||||
},parameters: params);
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius.circular(6.sp),
|
||||
child: CachedImg(
|
||||
imageUrl: lists.album!.first.url!,
|
||||
imageUrl: list.album!.first.url!,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
) : GridView.builder(
|
||||
itemCount: lists.album!.length,
|
||||
itemCount: list.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
@ -1739,18 +1741,18 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
childAspectRatio:ratio //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
Album album = list.album![currentIndex];
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
for (var element in list.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
await refreshCircleData();
|
||||
}
|
||||
Map<String, String>? params;
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0 && lists.indexOf(list) >= chargeFreeNum) {
|
||||
params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})};
|
||||
|
||||
// return;
|
||||
@ -1763,7 +1765,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex,
|
||||
'userId':lists.user?.id!.toString()
|
||||
'userId':list.user?.id!.toString()
|
||||
},parameters: params);
|
||||
},
|
||||
child: Container(
|
||||
@ -1784,7 +1786,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
CallOutShareDialog('','',lists), isScrollControlled: true,
|
||||
CallOutShareDialog('','',list), isScrollControlled: true,
|
||||
enableDrag: false
|
||||
);
|
||||
|
||||
@ -1800,7 +1802,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 5.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -1821,14 +1823,14 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
widgets.isNotEmpty
|
||||
? Expanded(
|
||||
child: Text(
|
||||
'${lists.chat!.count!}位圈友已私聊',
|
||||
'${list.chat!.count!}位圈友已私聊',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
@ -1836,7 +1838,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
pushMsgPage(
|
||||
lists,
|
||||
list,
|
||||
widget.bean.id.toString(),
|
||||
);
|
||||
},
|
||||
@ -1851,15 +1853,15 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
),
|
||||
GestureDetector(
|
||||
onTapUp: (TapUpDetails details) {
|
||||
if (lists.isInteract! > 0) {
|
||||
if (list.isInteract! > 0) {
|
||||
showOKToast('这个喊话已经点过了哦');
|
||||
return;
|
||||
}
|
||||
|
||||
_showEmojiPicker(lists,lists.id!,context, details.globalPosition);
|
||||
_showEmojiPicker(list,list.id!,context, details.globalPosition);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 10.sp, bottom: (lists.topInteractType!['userCount'] ?? 0) > 0 ? 10.sp : 5.sp),
|
||||
margin: EdgeInsets.only(left: 10.sp, bottom: (list.topInteractType!['userCount'] ?? 0) > 0 ? 10.sp : 5.sp),
|
||||
// height: 40.sp,
|
||||
alignment: Alignment.center,
|
||||
child: Stack(
|
||||
@ -1869,15 +1871,15 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
height: 43.sp,
|
||||
),
|
||||
Text(
|
||||
lists.interactedTypeEmote ?? '❤',
|
||||
list.interactedTypeEmote ?? '❤',
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 20.sp),
|
||||
),
|
||||
if ((lists.topInteractType!['userCount'] ?? 0) > 0)
|
||||
if ((list.topInteractType!['userCount'] ?? 0) > 0)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
child: Text(
|
||||
'${lists.topInteractType!['userCount']}',
|
||||
'${list.topInteractType!['userCount']}',
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 10.sp),
|
||||
),
|
||||
@ -2163,7 +2165,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
circleWidget(String url, String userId,{double width = 24}) {
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
pushUserHome(userId);
|
||||
pushUserHome(userId,false);
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
|
||||
@ -1159,7 +1159,7 @@ class _LikeViewState extends State<LikeView>
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 0.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -1187,7 +1187,7 @@ class _LikeViewState extends State<LikeView>
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
@ -1561,7 +1561,7 @@ class _LikeViewState extends State<LikeView>
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 0.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -1589,7 +1589,7 @@ class _LikeViewState extends State<LikeView>
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
|
||||
@ -109,7 +109,7 @@ class _PlayVideoViewState extends State<PlayVideoView>
|
||||
});
|
||||
|
||||
userList = [list];
|
||||
|
||||
sendReadRequest();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
|
||||
_pageController.addListener(_pageListener);
|
||||
|
||||
@ -389,7 +389,7 @@ class _VideoPlayerWidgetState extends State<VideoPlayerWidget> with RouteAware {
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的圈友吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 14.sp),
|
||||
|
||||
@ -1112,7 +1112,7 @@ class _AllCircleItemState extends State<AllCircleItem>
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -1140,7 +1140,7 @@ class _AllCircleItemState extends State<AllCircleItem>
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
@ -1609,7 +1609,7 @@ class _AllCircleItemState extends State<AllCircleItem>
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -1637,7 +1637,7 @@ class _AllCircleItemState extends State<AllCircleItem>
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
|
||||
@ -37,6 +37,8 @@ class _MoreVideoItemState extends State<MoreVideoItem> {
|
||||
Get.to(
|
||||
PlayVideoView(bean.album!.first.url!, bean.id!.toString(), bean.user!.id!.toString(),bean.chat!.toJson(),bean.user!.imId!,bean.content!,bean.user!
|
||||
.avatar!,bean.user!.nickname!,bean.interest!.title!));
|
||||
loadRecommandVideoData();
|
||||
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
@ -75,7 +77,8 @@ class _MoreVideoItemState extends State<MoreVideoItem> {
|
||||
|
||||
void loadRecommandVideoData() async {
|
||||
var data = await DioManager.getInstance()
|
||||
.get(url: Api.queryNextVideoStorysByType, params: {'pageIndex':1,'curCalloutId':0});
|
||||
|
||||
.get(url: Api.queryNextVideoStorysByType, params: {'pageIndex':1,'curCalloutId':recommandVideoList.isNotEmpty ? recommandVideoList.first.id! : 0});
|
||||
if (data['code'] == 200) {
|
||||
recommandVideoList.clear();
|
||||
List dataList = data['data']['lists'];
|
||||
|
||||
@ -1522,7 +1522,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
int chargeFreeNum = 0;
|
||||
StreamSubscription? callRefreshCicle = null;
|
||||
StreamSubscription? cicleInfoRefresh = null;
|
||||
StreamSubscription? scroToTop = null;
|
||||
@ -1634,6 +1634,8 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
refreshController.refreshCompleted();
|
||||
if (data["code"] == 200) {
|
||||
List dataList = data["data"]["lists"] ?? [];
|
||||
// "total" -> 0"chargeType" -> 1
|
||||
chargeFreeNum = data['data']['chargeFreeNum'] ?? 0;
|
||||
if (callOutPage == 1) {
|
||||
if (lists.isNotEmpty) {
|
||||
lists.clear();
|
||||
@ -1651,6 +1653,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
|
||||
// 只有当 ID 不存在时才添加
|
||||
if (!existingIds.contains(newItem.id)) {
|
||||
|
||||
lists.add(newItem);
|
||||
existingIds.add(newItem.id!); // 记录新的 ID
|
||||
}
|
||||
@ -1715,12 +1718,9 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
});
|
||||
}
|
||||
|
||||
void pushMsgPage(Lists bean, String cicleId) async {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
await refreshCircleData();
|
||||
}
|
||||
bool checkOpen(Lists bean, String cicleId) {
|
||||
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0 && (lists.indexOf(bean) >= chargeFreeNum)) {
|
||||
showJoinCiclePiker(cicleId, widget.bean.amount.toString(),
|
||||
widget.bean.oldAmount.toString(), 2, (payResult) {
|
||||
widget.bean.is_limit = false;
|
||||
@ -1736,6 +1736,17 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
}
|
||||
Get.back();
|
||||
}, widget.bean.ios_item);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void pushMsgPage(Lists bean, String cicleId) async {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
await refreshCircleData();
|
||||
}
|
||||
|
||||
if (!checkOpen(bean,cicleId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1800,7 +1811,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
child: circleWidget(
|
||||
element.avatar! ??
|
||||
"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
|
||||
element.id.toString()),
|
||||
element.id.toString(),widget.bean),
|
||||
));
|
||||
i++;
|
||||
});
|
||||
@ -1882,15 +1893,15 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
}
|
||||
|
||||
///至尊喊话
|
||||
vipDynamicItem(Lists lists) {
|
||||
int type = (lists.topInteractType?['type'] ?? 1) - 1;
|
||||
Widget descText = widget.logic.openCallOutIdList.contains(lists.id)
|
||||
vipDynamicItem(Lists list) {
|
||||
int type = (list.topInteractType?['type'] ?? 1) - 1;
|
||||
Widget descText = widget.logic.openCallOutIdList.contains(list.id)
|
||||
? Text(
|
||||
lists.content!,
|
||||
list.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
)
|
||||
: HideText(
|
||||
text: lists.content!,
|
||||
text: list.content!,
|
||||
maxWidth: Get.currentRoute == Routes.Home
|
||||
? Get.width - 90.sp
|
||||
: Get.width - 20.sp,
|
||||
@ -1900,7 +1911,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
additionStyle:
|
||||
TextStyle(color: const Color(0xFFFF4DF6), fontSize: 15.sp),
|
||||
onTap: () {
|
||||
widget.logic.openCallOutIdList.add(lists.id);
|
||||
widget.logic.openCallOutIdList.add(list.id);
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
@ -1908,16 +1919,16 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
// List<JoinUser> urlList = bean.lastJoinUsers;
|
||||
List<Widget> widgets = [];
|
||||
int index = 0;
|
||||
for (var element in lists.chat!.users!) {
|
||||
for (var element in list.chat!.users!) {
|
||||
widgets.add(Positioned(
|
||||
left: 12.sp * index,
|
||||
child: circleWidget(element.avatar!, element.id.toString(), width: 24),
|
||||
child: circleWidget(element.avatar!, element.id.toString(),list, width: 24),
|
||||
));
|
||||
index++;
|
||||
}
|
||||
if (widgets.isNotEmpty) {
|
||||
widgets.add(Positioned(
|
||||
left: 12.sp * lists.chat!.users!.length,
|
||||
left: 12.sp * list.chat!.users!.length,
|
||||
child: Image.asset(
|
||||
getCircleImage('more'),
|
||||
width: 24.sp,
|
||||
@ -1926,9 +1937,9 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
|
||||
double picHeight = 0.0;
|
||||
|
||||
if (lists.album != null) {
|
||||
if (lists.album!.isNotEmpty) {
|
||||
Album info = lists.album!.first;
|
||||
if (list.album != null) {
|
||||
if (list.album!.isNotEmpty) {
|
||||
Album info = list.album!.first;
|
||||
|
||||
if (info.type == 1) {
|
||||
double picWidth = (Get.width -
|
||||
@ -1937,10 +1948,10 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
: 60.sp)) /
|
||||
3 +
|
||||
45;
|
||||
if (lists.album!.length > 3) {
|
||||
if (list.album!.length > 3) {
|
||||
picHeight = picWidth * 2;
|
||||
} else {
|
||||
if (lists.album!.length == 1) {
|
||||
if (list.album!.length == 1) {
|
||||
picHeight = 250;
|
||||
} else {
|
||||
picHeight = picWidth;
|
||||
@ -1955,8 +1966,8 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
Widget atWidget = Container();
|
||||
|
||||
List<Widget> atList = [];
|
||||
if (lists.at!.isNotEmpty) {
|
||||
List infoList = jsonDecode(lists.at!);
|
||||
if (list.at!.isNotEmpty) {
|
||||
List infoList = jsonDecode(list.at!);
|
||||
infoList.forEach((element) {
|
||||
atList.add(GestureDetector(
|
||||
onTap: () {
|
||||
@ -2022,9 +2033,9 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
topRight: Radius.circular(12.sp),
|
||||
bottomLeft: Radius.circular(12.sp))),
|
||||
child: Text(
|
||||
(lists.user!.city ?? '外星').length > 4
|
||||
? (lists.user!.city ?? '外星').substring(0, 4) + '...'
|
||||
: (lists.user!.city ?? '外星'),
|
||||
(list.user!.city ?? '外星').length > 4
|
||||
? (list.user!.city ?? '外星').substring(0, 4) + '...'
|
||||
: (list.user!.city ?? '外星'),
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
)
|
||||
@ -2049,11 +2060,11 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
await SharedPreferencesHelper.getInstance();
|
||||
String myUserId = sp.getMyUserId();
|
||||
|
||||
if (lists.user?.id!.toString() == myUserId) {
|
||||
if (list.user?.id!.toString() == myUserId) {
|
||||
Get.toNamed(Routes.UserInfoPage);
|
||||
return;
|
||||
}
|
||||
pushUserHome(lists.user!.id!.toString());
|
||||
pushUserHome(list.user!.id!.toString(),list);
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
@ -2095,13 +2106,13 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(30.sp),
|
||||
child: Image.network(
|
||||
lists.user!.avatar_thumb!,
|
||||
list.user!.avatar_thumb!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
if ((lists.user!.onlineFlag ?? '').isNotEmpty)
|
||||
if ((list.user!.onlineFlag ?? '').isNotEmpty)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
@ -2120,7 +2131,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
lists.user!.onlineFlag ?? '',
|
||||
list.user!.onlineFlag ?? '',
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(
|
||||
247, 250, 250, 1.0),
|
||||
@ -2139,7 +2150,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
lists.user!.nickname!,
|
||||
list.user!.nickname!,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
@ -2148,7 +2159,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
UserTagWidget(lists.user!.mark!),
|
||||
UserTagWidget(list.user!.mark!),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
@ -2164,18 +2175,18 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(9.sp),
|
||||
gradient: sexBgGradient(
|
||||
lists.user!.gender ?? 0,
|
||||
list.user!.gender ?? 0,
|
||||
)),
|
||||
child: Text(
|
||||
getAgeCOntent(
|
||||
lists.user!.gender ?? 0,
|
||||
lists.user!.age ?? 0,
|
||||
lists.user!.role ?? 0,
|
||||
lists.user!.orientation ?? 0),
|
||||
list.user!.gender ?? 0,
|
||||
list.user!.age ?? 0,
|
||||
list.user!.role ?? 0,
|
||||
list.user!.orientation ?? 0),
|
||||
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
|
||||
style: TextStyle(
|
||||
color: sexBgColor(
|
||||
lists.user!.gender ?? 0,
|
||||
list.user!.gender ?? 0,
|
||||
),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
@ -2203,14 +2214,14 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(
|
||||
lists.album![0].url!,
|
||||
lists.id!.toString(),
|
||||
lists.user!.id.toString()))
|
||||
list.album![0].url!,
|
||||
list.id!.toString(),
|
||||
list.user!.id.toString()))
|
||||
: picHeight == 250
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
for (var element in list.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Map<String, String> params = {};
|
||||
@ -2219,7 +2230,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
await refreshCircleData();
|
||||
}
|
||||
if (widget.bean.is_limit &&
|
||||
widget.bean.amount > 0) {
|
||||
widget.bean.amount > 0 && lists.indexOf(list) >= chargeFreeNum) {
|
||||
params = {
|
||||
'source': widget.index == 0
|
||||
? 'callout_list_hot'
|
||||
@ -2246,21 +2257,21 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': 0,
|
||||
'userId': lists.user?.id!.toString()
|
||||
'userId': list.user?.id!.toString()
|
||||
},
|
||||
parameters: params);
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedImg(
|
||||
imageUrl: lists.album!.first.url!,
|
||||
imageUrl: list.album!.first.url!,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
)
|
||||
: GridView.builder(
|
||||
controller: GridScrollController,
|
||||
itemCount: lists.album!.length,
|
||||
itemCount: list.album!.length,
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
@ -2271,7 +2282,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
childAspectRatio: 0.6 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
Album album = list.album![currentIndex];
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
if (widget.bean.is_limit &&
|
||||
@ -2280,12 +2291,12 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
}
|
||||
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
for (var element in list.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Map<String, String> params = {};
|
||||
if (widget.bean.is_limit &&
|
||||
widget.bean.amount > 0) {
|
||||
widget.bean.amount > 0 && lists.indexOf(list) >= chargeFreeNum) {
|
||||
params = {
|
||||
'source': widget.index == 0
|
||||
? 'callout_list_hot'
|
||||
@ -2313,7 +2324,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex,
|
||||
'userId': lists.user?.id!.toString()
|
||||
'userId': list.user?.id!.toString()
|
||||
},
|
||||
parameters: params);
|
||||
},
|
||||
@ -2333,7 +2344,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
CallOutShareDialog('','',lists), isScrollControlled: true,
|
||||
CallOutShareDialog('','',list), isScrollControlled: true,
|
||||
enableDrag: false
|
||||
);
|
||||
|
||||
@ -2349,7 +2360,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 5.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -2370,14 +2381,14 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
widgets.isNotEmpty
|
||||
? Expanded(
|
||||
child: Text(
|
||||
'${lists.chat!.count!}位圈友已私聊',
|
||||
'${list.chat!.count!}位圈友已私聊',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 14.sp),
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 14.sp),
|
||||
@ -2385,7 +2396,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
pushMsgPage(
|
||||
lists,
|
||||
list,
|
||||
widget.bean.id.toString(),
|
||||
);
|
||||
},
|
||||
@ -2400,19 +2411,19 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
),
|
||||
GestureDetector(
|
||||
onTapUp: (TapUpDetails details) {
|
||||
if (lists.isInteract! > 0) {
|
||||
if (list.isInteract! > 0) {
|
||||
showOKToast('这个喊话已经点过了哦');
|
||||
return;
|
||||
}
|
||||
|
||||
_showEmojiPicker(
|
||||
lists, lists.id!, context, details.globalPosition);
|
||||
list, list.id!, context, details.globalPosition);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 10.sp,
|
||||
bottom:
|
||||
(lists.topInteractType!['userCount'] ?? 0) > 0
|
||||
(list.topInteractType!['userCount'] ?? 0) > 0
|
||||
? 10.sp
|
||||
: 5.sp),
|
||||
// height: 40.sp,
|
||||
@ -2424,15 +2435,15 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
height: 43.sp,
|
||||
),
|
||||
Text(
|
||||
lists.interactedTypeEmote ?? '❤️',
|
||||
list.interactedTypeEmote ?? '❤️',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 20.sp),
|
||||
),
|
||||
if ((lists.topInteractType!['userCount'] ?? 0) > 0)
|
||||
if ((list.topInteractType!['userCount'] ?? 0) > 0)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
child: Text(
|
||||
'${lists.topInteractType!['userCount']}',
|
||||
'${list.topInteractType!['userCount']}',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 10.sp),
|
||||
),
|
||||
@ -2450,16 +2461,16 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
}
|
||||
|
||||
///普通图文喊话
|
||||
normalDynamicItem(Lists lists) {
|
||||
int type = (lists.topInteractType?['type'] ?? 1) - 1;
|
||||
normalDynamicItem(Lists list) {
|
||||
int type = (list.topInteractType?['type'] ?? 1) - 1;
|
||||
|
||||
Widget descText = widget.logic.openCallOutIdList.contains(lists.id)
|
||||
Widget descText = widget.logic.openCallOutIdList.contains(list.id)
|
||||
? Text(
|
||||
lists.content!,
|
||||
list.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
)
|
||||
: HideText(
|
||||
text: lists.content!,
|
||||
text: list.content!,
|
||||
maxWidth: Get.currentRoute == Routes.Home
|
||||
? Get.width - 90.sp
|
||||
: Get.width - 20.sp,
|
||||
@ -2469,7 +2480,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
additionStyle:
|
||||
TextStyle(color: const Color(0xFFFF4DF6), fontSize: 15.sp),
|
||||
onTap: () {
|
||||
widget.logic.openCallOutIdList.add(lists.id);
|
||||
widget.logic.openCallOutIdList.add(list.id);
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
@ -2480,18 +2491,18 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
(Get.width - (widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp)) /
|
||||
3 +
|
||||
45;
|
||||
if (lists.album != null) {
|
||||
if (lists.album!.isNotEmpty) {
|
||||
Album info = lists.album!.first;
|
||||
if (list.album != null) {
|
||||
if (list.album!.isNotEmpty) {
|
||||
Album info = list.album!.first;
|
||||
ratio = ((Get.width -
|
||||
(widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp)) /
|
||||
3) /
|
||||
picWidth;
|
||||
if (info.type == 1) {
|
||||
if (lists.album!.length > 3) {
|
||||
if (list.album!.length > 3) {
|
||||
picHeight = picWidth * 2;
|
||||
} else {
|
||||
if (lists.album!.length == 1) {
|
||||
if (list.album!.length == 1) {
|
||||
picHeight = 250;
|
||||
} else {
|
||||
picHeight = picWidth;
|
||||
@ -2505,16 +2516,16 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
|
||||
List<Widget> widgets = [];
|
||||
int index = 0;
|
||||
lists.chat!.users!.forEach((element) {
|
||||
list.chat!.users!.forEach((element) {
|
||||
widgets.add(Positioned(
|
||||
left: 12.sp * index,
|
||||
child: circleWidget(element.avatar!, element.id.toString(), width: 24),
|
||||
child: circleWidget(element.avatar!, element.id.toString(),list, width: 24),
|
||||
));
|
||||
index++;
|
||||
});
|
||||
if (widgets.isNotEmpty) {
|
||||
widgets.add(Positioned(
|
||||
left: 12.sp * lists.chat!.users!.length,
|
||||
left: 12.sp * list.chat!.users!.length,
|
||||
child: Image.asset(
|
||||
getCircleImage('more'),
|
||||
width: 24.sp,
|
||||
@ -2524,8 +2535,8 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
Widget atWidget = Container();
|
||||
|
||||
List<Widget> atList = [];
|
||||
if (lists.at!.isNotEmpty) {
|
||||
List infoList = jsonDecode(lists.at!);
|
||||
if (list.at!.isNotEmpty) {
|
||||
List infoList = jsonDecode(list.at!);
|
||||
infoList.forEach((element) {
|
||||
atList.add(GestureDetector(
|
||||
onTap: () {
|
||||
@ -2588,9 +2599,9 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
topRight: Radius.circular(12.sp),
|
||||
bottomLeft: Radius.circular(12.sp))),
|
||||
child: Text(
|
||||
(lists.user!.city ?? '外星').length > 4
|
||||
? (lists.user!.city ?? '外星').substring(0, 4) + '...'
|
||||
: (lists.user!.city ?? '外星'),
|
||||
(list.user!.city ?? '外星').length > 4
|
||||
? (list.user!.city ?? '外星').substring(0, 4) + '...'
|
||||
: (list.user!.city ?? '外星'),
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
)
|
||||
@ -2613,7 +2624,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
var sp =
|
||||
await SharedPreferencesHelper.getInstance();
|
||||
String myUserId = sp.getMyUserId();
|
||||
if (lists.user?.id!.toString() == myUserId) {
|
||||
if (list.user?.id!.toString() == myUserId) {
|
||||
Get.toNamed(Routes.UserInfoPage);
|
||||
return;
|
||||
}
|
||||
@ -2621,7 +2632,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
widget.bean.amount > 0) {
|
||||
await refreshCircleData();
|
||||
}
|
||||
pushUserHome(lists.user!.id!.toString()!);
|
||||
pushUserHome(list.user!.id!.toString()!,list);
|
||||
// if (widget.bean.is_limit &&
|
||||
// widget.bean.amount > 0) {
|
||||
// showJoinCiclePiker(
|
||||
@ -2674,13 +2685,13 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(30.sp),
|
||||
child: Image.network(
|
||||
lists.user!.avatar_thumb!,
|
||||
list.user!.avatar_thumb!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
if ((lists.user!.onlineFlag ?? '').isNotEmpty)
|
||||
if ((list.user!.onlineFlag ?? '').isNotEmpty)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
@ -2699,7 +2710,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
lists.user!.onlineFlag ?? '',
|
||||
list.user!.onlineFlag ?? '',
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(
|
||||
247, 250, 250, 1.0),
|
||||
@ -2718,7 +2729,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
lists.user!.nickname!,
|
||||
list.user!.nickname!,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
@ -2727,7 +2738,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
UserTagWidget(lists.user!.mark!),
|
||||
UserTagWidget(list.user!.mark!),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
@ -2744,17 +2755,17 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
borderRadius:
|
||||
BorderRadius.circular(9.sp),
|
||||
gradient: sexBgGradient(
|
||||
lists.user!.gender ?? 0,
|
||||
list.user!.gender ?? 0,
|
||||
)),
|
||||
child: Text(
|
||||
getAgeCOntent(
|
||||
lists.user!.gender ?? 0,
|
||||
lists.user!.age ?? 0,
|
||||
lists.user!.role ?? 0,
|
||||
lists.user!.orientation ?? 0),
|
||||
list.user!.gender ?? 0,
|
||||
list.user!.age ?? 0,
|
||||
list.user!.role ?? 0,
|
||||
list.user!.orientation ?? 0),
|
||||
style: TextStyle(
|
||||
color: sexBgColor(
|
||||
lists.user!.gender ?? 0,
|
||||
list.user!.gender ?? 0,
|
||||
),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
@ -2783,14 +2794,14 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(
|
||||
lists.album![0].url!,
|
||||
lists.id!.toString(),
|
||||
lists.user!.id.toString()))
|
||||
list.album![0].url!,
|
||||
list.id!.toString(),
|
||||
list.user!.id.toString()))
|
||||
: picHeight == 250
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
for (var element in list.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Map<String, String> params = {};
|
||||
@ -2799,7 +2810,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
await refreshCircleData();
|
||||
}
|
||||
if (widget.bean.is_limit &&
|
||||
widget.bean.amount > 0) {
|
||||
widget.bean.amount > 0 && lists.indexOf(list) >= chargeFreeNum) {
|
||||
params = {
|
||||
'source': widget.index == 0
|
||||
? 'callout_list_hot'
|
||||
@ -2828,7 +2839,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
'imaglist': imgList,
|
||||
'index': 0,
|
||||
'userId':
|
||||
lists.user?.id!.toString()
|
||||
list.user?.id!.toString()
|
||||
},
|
||||
parameters: params);
|
||||
},
|
||||
@ -2836,14 +2847,14 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
borderRadius:
|
||||
BorderRadius.circular(6.sp),
|
||||
child: CachedImg(
|
||||
imageUrl: lists.album!.first.url!,
|
||||
imageUrl: list.album!.first.url!,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
)
|
||||
: GridView.builder(
|
||||
controller: GridScrollController,
|
||||
itemCount: lists.album!.length,
|
||||
itemCount: list.album!.length,
|
||||
physics:
|
||||
const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
@ -2856,11 +2867,11 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album =
|
||||
lists.album![currentIndex];
|
||||
list.album![currentIndex];
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
for (var element in list.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Map<String, String> params = {};
|
||||
@ -2901,7 +2912,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex,
|
||||
'userId':
|
||||
lists.user?.id!.toString()
|
||||
list.user?.id!.toString()
|
||||
},
|
||||
parameters: params);
|
||||
},
|
||||
@ -2921,7 +2932,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
CallOutShareDialog('','',lists), isScrollControlled: true,
|
||||
CallOutShareDialog('','',list), isScrollControlled: true,
|
||||
enableDrag: false
|
||||
);
|
||||
|
||||
@ -2937,7 +2948,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 5.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -2958,14 +2969,14 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
widgets.isNotEmpty
|
||||
? Expanded(
|
||||
child: Text(
|
||||
'${lists.chat!.count!}位圈友已私聊',
|
||||
'${list.chat!.count!}位圈友已私聊',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
@ -2973,7 +2984,7 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
pushMsgPage(
|
||||
lists,
|
||||
list,
|
||||
widget.bean.id.toString(),
|
||||
);
|
||||
},
|
||||
@ -2988,19 +2999,19 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
),
|
||||
GestureDetector(
|
||||
onTapUp: (TapUpDetails details) {
|
||||
if (lists.isInteract! > 0) {
|
||||
if (list.isInteract! > 0) {
|
||||
showOKToast('这个喊话已经点过了哦');
|
||||
return;
|
||||
}
|
||||
|
||||
_showEmojiPicker(lists, lists.id!, context,
|
||||
_showEmojiPicker(list, list.id!, context,
|
||||
details.globalPosition);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 10.sp,
|
||||
bottom:
|
||||
(lists.topInteractType!['userCount'] ?? 0) > 0
|
||||
(list.topInteractType!['userCount'] ?? 0) > 0
|
||||
? 10.sp
|
||||
: 5.sp),
|
||||
// height: 40.sp,
|
||||
@ -3012,16 +3023,16 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
height: 43.sp,
|
||||
),
|
||||
Text(
|
||||
lists.interactedTypeEmote ?? '❤️',
|
||||
list.interactedTypeEmote ?? '❤️',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 20.sp),
|
||||
),
|
||||
if ((lists.topInteractType!['userCount'] ?? 0) >
|
||||
if ((list.topInteractType!['userCount'] ?? 0) >
|
||||
0)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
child: Text(
|
||||
'${lists.topInteractType!['userCount']}',
|
||||
'${list.topInteractType!['userCount']}',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 10.sp),
|
||||
),
|
||||
@ -3293,11 +3304,11 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
_overlayEntry = null;
|
||||
}
|
||||
|
||||
pushUserHome(String userId) async {
|
||||
pushUserHome(String userId,Lists list) async {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
await refreshCircleData();
|
||||
}
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0) {
|
||||
if (widget.bean.is_limit && widget.bean.amount > 0 && lists.indexOf(list) >= chargeFreeNum) {
|
||||
Get.toNamed(Routes.UserInfoPage, arguments: userId, parameters: {
|
||||
'source': widget.index == 0 ? 'callout_list_hot' : 'callout_list_new',
|
||||
'bean': jsonEncode({
|
||||
@ -3316,10 +3327,10 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
}
|
||||
}
|
||||
|
||||
circleWidget(String url, String userId, {double width = 24}) {
|
||||
circleWidget(String url, String userId,list, {double width = 24}) {
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
pushUserHome(userId);
|
||||
pushUserHome(userId,list);
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
|
||||
@ -20,6 +20,7 @@ import 'package:connectivity/connectivity.dart';
|
||||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bugly/flutter_bugly.dart';
|
||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@ -642,6 +643,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
loginIM(
|
||||
data['data']['account_id'].toString(), data['data']['user_sig']);
|
||||
accountId = data['data']['account_id'].toString();
|
||||
await FlutterBugly.setUserId(accountId);
|
||||
} else {
|
||||
if (Get.currentRoute != Routes.Login && data['code'] >= 500 && count < 5) {
|
||||
getIMData(count: count++);
|
||||
@ -757,7 +759,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
}
|
||||
}
|
||||
|
||||
loadMyInfoData() async {
|
||||
Future loadMyInfoData() async {
|
||||
var data = await DioManager.instance.get(url: Api.getUserMine,params: {'1':1});
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
data, (data) => MineResponseBean.fromJson(data));
|
||||
@ -790,6 +792,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
// update();
|
||||
// }
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isDifferenceGreaterThan30Days(String dateString) {
|
||||
|
||||
@ -463,8 +463,9 @@ class _ShareState extends State<Share> {
|
||||
String filePath = '';
|
||||
if (byteData != null) {
|
||||
Uint8List pngBytes = byteData!.buffer.asUint8List();
|
||||
Directory directory = await getApplicationDocumentsDirectory();
|
||||
filePath = '${directory.path}/widget_image.png';
|
||||
Directory? directory = await getExternalStorageDirectory();
|
||||
String fileName = 'widget_image_${DateTime.now().millisecondsSinceEpoch}.png';
|
||||
filePath = '${directory!.path}/$fileName';
|
||||
File imageFile = File(filePath);
|
||||
imageFile.writeAsBytesSync(pngBytes);
|
||||
}
|
||||
|
||||
@ -525,7 +525,7 @@ class _LikelistPageState extends State<LikelistPage> with RouteAware {
|
||||
showOKToast('已为你增加10倍曝光啦');
|
||||
} else {
|
||||
showOKToast('开通年VIP可以增加10倍曝光哦~');
|
||||
await showOepnVipDialog('ten_push');
|
||||
await showOepnVipDialog('ten_push',isYear:true);
|
||||
logic.loadMyInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,9 +47,9 @@ class LoginLogic extends GetxController {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
|
||||
if (!kDebugMode) {
|
||||
checkNetworkUrl();
|
||||
}
|
||||
// if (!kDebugMode) {
|
||||
// checkNetworkUrl();
|
||||
// }
|
||||
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
|
||||
loginPhone =
|
||||
await sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE) ??
|
||||
|
||||
@ -278,7 +278,7 @@ class MinefragmentLogic extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
getMode() async {
|
||||
Future getMode() async {
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.getUserMine, params: {'2': 2});
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
|
||||
@ -78,6 +78,7 @@ class MsgLogic extends GetxController {
|
||||
var bean = BaseResponse<UserList>.fromJson(
|
||||
data, (data) => UserList.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
lists.clear();
|
||||
lists.addAll(bean.data.lists);
|
||||
}
|
||||
if (isFresh) {
|
||||
|
||||
@ -400,7 +400,7 @@ class _SwiperPageState extends State<SwiperPage> {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image =
|
||||
await boundary.toImage(pixelRatio: 1.0);
|
||||
await boundary.toImage(pixelRatio: 3.0);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
if (byteData != null) {
|
||||
|
||||
@ -396,10 +396,7 @@ class UserinfoLogic extends GetxController {
|
||||
}
|
||||
|
||||
setLike() async {
|
||||
// if (isBlack || isDestroy) {
|
||||
// showOKToast("喜欢失败,存在拉黑关系或者该账户已注销");
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
var data = await DioManager.instance.post(
|
||||
url: "${Api.setLike + userId}/follow",
|
||||
@ -432,6 +429,7 @@ class UserinfoLogic extends GetxController {
|
||||
serviceLocator<FriendshipServices>();
|
||||
|
||||
isBlack = status == "1";
|
||||
isLike = false;
|
||||
try {
|
||||
if (isBlack) {
|
||||
Navigator.pop(Get.context!);
|
||||
|
||||
@ -26,6 +26,7 @@ import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import '../../circle_app/circle/state.dart';
|
||||
import '../../circle_app/circle/widgets/video_item.dart';
|
||||
import '../../circle_app/home/logic.dart';
|
||||
import '../../circle_app/likelist/logic.dart';
|
||||
import '../../router/routers.dart';
|
||||
import '../../utils/cache_img.dart';
|
||||
@ -46,19 +47,38 @@ class _CircleShareState extends State<CircleShare> {
|
||||
// TODO: add state variables and methods
|
||||
GlobalKey _globalKey = GlobalKey();
|
||||
List<UserListItem> lists = [];
|
||||
late MinefragmentLogic logic;
|
||||
late HomeLogic logic;
|
||||
List<V2TimUserFullInfo> conList = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
Get.lazyPut(() => MinefragmentLogic());
|
||||
logic = Get.find<MinefragmentLogic>();
|
||||
// Get.lazyPut(() => MinefragmentLogic());
|
||||
logic = Get.find<HomeLogic>();
|
||||
loadMyInfoData();
|
||||
loadFollowMeData();
|
||||
loadInviteData();
|
||||
}
|
||||
|
||||
Future loadMyInfoData() async {
|
||||
var data = await DioManager.instance.get(url: Api.getUserMine,params: {'1':1});
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
data, (data) => MineResponseBean.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
logic.model = bean.data.user;
|
||||
var result = await DioManager.instance.get(url: Api.inviteMainPage);
|
||||
if (result['code'] == 200) {
|
||||
Autogenerated info = Autogenerated.fromJson(result);
|
||||
logic.inviteCode = info.data!.inviteCode!;
|
||||
logic.link = info.data!.link!;
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadInviteData() async {
|
||||
var data = await DioManager.instance.get(url: Api.inviteMainPage);
|
||||
if (data['code'] == 200) {
|
||||
@ -75,14 +95,18 @@ class _CircleShareState extends State<CircleShare> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: add widget build method
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Container(
|
||||
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(child: Container()),
|
||||
Spacer(),
|
||||
Container(
|
||||
width: Get.width - 40.sp,
|
||||
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
||||
color: Colors.red,
|
||||
// height: Get.height - Get.bottomBarHeight - 164.sp - 10.sp,
|
||||
child: SingleChildScrollView(
|
||||
child: RepaintBoundary(
|
||||
@ -393,7 +417,7 @@ class _CircleShareState extends State<CircleShare> {
|
||||
shareWxData(2);
|
||||
}),
|
||||
shareAction('save', '复制邀请链接', () {
|
||||
copyInviteText(logic.name);
|
||||
copyInviteText(logic.model!.nickname!);
|
||||
}),
|
||||
shareAction('hb', '保存邀请海报', () {
|
||||
_saveLocalImage();
|
||||
@ -428,13 +452,13 @@ class _CircleShareState extends State<CircleShare> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAvatar1(MinefragmentLogic logic) {
|
||||
Widget _buildAvatar1(HomeLogic logic) {
|
||||
return ClipOval(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (logic.userInfoBean != null) {
|
||||
if (logic.model != null) {
|
||||
var imgList = <String>[];
|
||||
imgList.add(logic.userInfoBean!.avatar);
|
||||
imgList.add(logic.model!.avatar);
|
||||
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
// Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
// 'imaglist': imgList,
|
||||
@ -442,14 +466,14 @@ class _CircleShareState extends State<CircleShare> {
|
||||
// });
|
||||
}
|
||||
},
|
||||
child: logic.userInfoBean == null
|
||||
child: logic.model == null
|
||||
? SizedBox(
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
)
|
||||
: CachedImg(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: logic.avatar,
|
||||
imageUrl: logic.model!.avatar!,
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
),
|
||||
@ -457,14 +481,14 @@ class _CircleShareState extends State<CircleShare> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNameRow(MinefragmentLogic logic) {
|
||||
Widget _buildNameRow(HomeLogic logic) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 6.sp),
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
logic.name,
|
||||
logic.model!.nickname!,
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 16.sp,
|
||||
@ -476,14 +500,14 @@ class _CircleShareState extends State<CircleShare> {
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: sexBgGradient(logic.userInfoBean?.gender ?? 0),
|
||||
gradient: sexBgGradient(logic.model?.gender ?? 0),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp),
|
||||
child: Text(
|
||||
logic.ageMsg,
|
||||
getAgeCOntent(logic.model!.gender, logic.model!.age, logic.model!.role, logic.model!.orientation),
|
||||
style: TextStyle(
|
||||
color: sexBgColor(logic.userInfoBean?.gender ?? 0),
|
||||
color: sexBgColor(logic.model?.gender ?? 0),
|
||||
fontSize: 10.sp,
|
||||
),
|
||||
),
|
||||
@ -493,7 +517,7 @@ class _CircleShareState extends State<CircleShare> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoRow(MinefragmentLogic logic) {
|
||||
Widget _buildInfoRow(HomeLogic logic) {
|
||||
return Row(
|
||||
children: [
|
||||
Text('邀请您加入',
|
||||
@ -756,7 +780,7 @@ class _CircleShareState extends State<CircleShare> {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image =
|
||||
await boundary.toImage(pixelRatio: 1.0);
|
||||
await boundary.toImage(pixelRatio: 3.0);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
if (byteData != null) {
|
||||
@ -794,14 +818,15 @@ class _CircleShareState extends State<CircleShare> {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image =
|
||||
await boundary.toImage(pixelRatio: 1.0);
|
||||
await boundary.toImage(pixelRatio: 3.0);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
String filePath = '';
|
||||
if (byteData != null) {
|
||||
Uint8List pngBytes = byteData!.buffer.asUint8List();
|
||||
Directory directory = await getApplicationDocumentsDirectory();
|
||||
filePath = '${directory.path}/widget_image.png';
|
||||
Directory? directory = await getExternalStorageDirectory();
|
||||
String fileName = 'widget_image_${DateTime.now().millisecondsSinceEpoch}.png';
|
||||
filePath = '${directory!.path}/$fileName';
|
||||
File imageFile = File(filePath);
|
||||
imageFile.writeAsBytesSync(pngBytes);
|
||||
}
|
||||
@ -881,7 +906,7 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
// TODO: add state variables and methods
|
||||
GlobalKey _globalKey = GlobalKey();
|
||||
List<UserListItem> lists = [];
|
||||
late MinefragmentLogic logic;
|
||||
late HomeLogic logic;
|
||||
List<V2TimUserFullInfo> conList = [];
|
||||
|
||||
final ScrollController GridScrollController = ScrollController();
|
||||
@ -890,7 +915,14 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
Get.lazyPut(() => MinefragmentLogic());
|
||||
logic = Get.find<MinefragmentLogic>();
|
||||
logic = Get.find<HomeLogic>();
|
||||
if (logic.model == null) {
|
||||
logic.loadMyInfoData().then((value) {
|
||||
setState(() {
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
loadFollowMeData();
|
||||
loadInviteData();
|
||||
}
|
||||
@ -920,8 +952,9 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
height: Get.height,
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
Container(height: MediaQuery.of(context).padding.top,),
|
||||
|
||||
Spacer(),
|
||||
Container(
|
||||
width: Get.width - 40.sp,
|
||||
child: SingleChildScrollView(
|
||||
@ -1127,10 +1160,11 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
),
|
||||
))),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.sp,
|
||||
),
|
||||
Spacer()
|
||||
Spacer(),
|
||||
|
||||
Container(
|
||||
height: lists.isNotEmpty || conList.isNotEmpty ? 264.sp : 164.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -1248,7 +1282,7 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
shareWxData(2);
|
||||
}),
|
||||
shareAction('save', '复制邀请链接', () {
|
||||
copyInviteText(logic.name);
|
||||
copyInviteText(logic.model?.nickname ?? '');
|
||||
}),
|
||||
shareAction('hb', '保存邀请海报', () {
|
||||
_saveLocalImage();
|
||||
@ -1633,7 +1667,7 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 0.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -1661,7 +1695,7 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
@ -2048,7 +2082,7 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 2.sp),
|
||||
margin: EdgeInsets.only(
|
||||
top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
@ -2076,7 +2110,7 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的人吧',
|
||||
'快成为第一位私聊ta的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 13.sp),
|
||||
@ -2288,13 +2322,13 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildAvatar1(MinefragmentLogic logic) {
|
||||
Widget _buildAvatar1(HomeLogic logic) {
|
||||
return ClipOval(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (logic.userInfoBean != null) {
|
||||
if (logic.model != null) {
|
||||
var imgList = <String>[];
|
||||
imgList.add(logic.userInfoBean!.avatar);
|
||||
imgList.add(logic.model!.avatar);
|
||||
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
// Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
// 'imaglist': imgList,
|
||||
@ -2302,14 +2336,14 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
// });
|
||||
}
|
||||
},
|
||||
child: logic.userInfoBean == null
|
||||
child: logic.model == null
|
||||
? SizedBox(
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
)
|
||||
: CachedImg(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: logic.avatar,
|
||||
imageUrl: logic.model!.avatar!,
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
),
|
||||
@ -2317,14 +2351,14 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNameRow(MinefragmentLogic logic) {
|
||||
Widget _buildNameRow(HomeLogic logic) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 6.sp),
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
logic.name,
|
||||
logic.model?.nickname ?? '',
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 16.sp,
|
||||
@ -2336,14 +2370,14 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: sexBgGradient(logic.userInfoBean?.gender ?? 0),
|
||||
gradient: sexBgGradient(logic.model?.gender ?? 0),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp),
|
||||
child: Text(
|
||||
logic.ageMsg,
|
||||
getAgeCOntent(logic.model!.gender, logic.model!.age, logic.model!.role, logic.model!.orientation),
|
||||
style: TextStyle(
|
||||
color: sexBgColor(logic.userInfoBean?.gender ?? 0),
|
||||
color: sexBgColor(logic.model?.gender ?? 0),
|
||||
fontSize: 10.sp,
|
||||
),
|
||||
),
|
||||
@ -2353,7 +2387,7 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoRow(MinefragmentLogic logic) {
|
||||
Widget _buildInfoRow(var logic) {
|
||||
return Row(
|
||||
children: [
|
||||
Text('邀请您加入',
|
||||
@ -2418,7 +2452,7 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image =
|
||||
await boundary.toImage(pixelRatio: 1.0);
|
||||
await boundary.toImage(pixelRatio: 3.0);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
if (byteData != null) {
|
||||
@ -2456,14 +2490,15 @@ class _CallOutShareDialogState extends State<CallOutShareDialog> {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image =
|
||||
await boundary.toImage(pixelRatio: 1.0);
|
||||
await boundary.toImage(pixelRatio: 3.0);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
String filePath = '';
|
||||
if (byteData != null) {
|
||||
Uint8List pngBytes = byteData!.buffer.asUint8List();
|
||||
Directory directory = await getApplicationDocumentsDirectory();
|
||||
filePath = '${directory.path}/widget_image.png';
|
||||
Directory? directory = await getExternalStorageDirectory();
|
||||
String fileName = 'widget_image_${DateTime.now().millisecondsSinceEpoch}.png';
|
||||
filePath = '${directory!.path}/$fileName';
|
||||
File imageFile = File(filePath);
|
||||
imageFile.writeAsBytesSync(pngBytes);
|
||||
}
|
||||
|
||||
@ -369,8 +369,9 @@ class _SignInDialogState extends State<SignInDialog> {
|
||||
var result = await DioManager.instance.post(url: Api.daySignIn);
|
||||
isSign = false;
|
||||
if (result['code'] == 200) {
|
||||
showOKToast('签到成功');
|
||||
loadWeekCofigData();
|
||||
showOKToast(result['msg']);
|
||||
Get.back();
|
||||
// loadWeekCofigData();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:characters/characters.dart';
|
||||
|
||||
///文字超出一定行,自动隐藏,并添加入"...查看更多详情"为它设置点击事件
|
||||
class HideText extends StatefulWidget {
|
||||
@ -32,6 +31,12 @@ class HideText extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _HideTextState extends State<HideText> {
|
||||
|
||||
String safeSubstring(String input, int start, int end) {
|
||||
final chars = input.characters;
|
||||
return chars.getRange(start, end).toString();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
@ -82,7 +87,7 @@ class _HideTextState extends State<HideText> {
|
||||
int num = 0;
|
||||
int skip = 1;
|
||||
while(true){
|
||||
bool isExceed = widget.text.length < num + skip || _textPaint([TextSpan(text: widget.text.substring(0, num + skip) + "...", style: widget.style),
|
||||
bool isExceed = widget.text.length < num + skip || _textPaint([TextSpan(text: "${safeSubstring(widget.text,0, num + skip)}...", style: widget.style),
|
||||
TextSpan(text: widget.additionText, style: widget.additionStyle)]).didExceedMaxLines;
|
||||
if(!isExceed) {
|
||||
num = num + skip;
|
||||
|
||||
@ -582,7 +582,7 @@ class _UserShareState extends State<UserShare> {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image =
|
||||
await boundary.toImage(pixelRatio: 1.0);
|
||||
await boundary.toImage(pixelRatio: 3.0);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
if (byteData != null) {
|
||||
@ -623,14 +623,15 @@ class _UserShareState extends State<UserShare> {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image =
|
||||
await boundary.toImage(pixelRatio: 1.0);
|
||||
await boundary.toImage(pixelRatio: 3.0);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
String filePath = '';
|
||||
if (byteData != null) {
|
||||
Uint8List pngBytes = byteData!.buffer.asUint8List();
|
||||
Directory directory = await getApplicationDocumentsDirectory();
|
||||
filePath = '${directory.path}/widget_image.png';
|
||||
Directory? directory = await getExternalStorageDirectory();
|
||||
String fileName = 'widget_image_${DateTime.now().millisecondsSinceEpoch}.png';
|
||||
filePath = '${directory!.path}/$fileName';
|
||||
File imageFile = File(filePath);
|
||||
imageFile.writeAsBytesSync(pngBytes);
|
||||
}
|
||||
|
||||
@ -411,7 +411,7 @@ class _VideoShareDialogState extends State<VideoShareDialog> {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image =
|
||||
await boundary.toImage(pixelRatio: 1.0);
|
||||
await boundary.toImage(pixelRatio: 3.0);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
if (byteData != null) {
|
||||
@ -452,14 +452,15 @@ class _VideoShareDialogState extends State<VideoShareDialog> {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image =
|
||||
await boundary.toImage(pixelRatio: 1.0);
|
||||
await boundary.toImage(pixelRatio: 3.0);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
String filePath = '';
|
||||
if (byteData != null) {
|
||||
Uint8List pngBytes = byteData!.buffer.asUint8List();
|
||||
Directory directory = await getApplicationDocumentsDirectory();
|
||||
filePath = '${directory.path}/widget_image.png';
|
||||
Directory? directory = await getExternalStorageDirectory();
|
||||
String fileName = 'widget_image_${DateTime.now().millisecondsSinceEpoch}.png';
|
||||
filePath = '${directory!.path}/$fileName';
|
||||
File imageFile = File(filePath);
|
||||
imageFile.writeAsBytesSync(pngBytes);
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ packages:
|
||||
source: hosted
|
||||
version: "4.2.1"
|
||||
characters:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: characters
|
||||
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
|
||||
|
||||
@ -132,6 +132,7 @@ dependencies:
|
||||
quickpass_yidun_flutter: ^1.5.6
|
||||
#视频播放器
|
||||
fijkplayer: ^0.11.0
|
||||
characters: ^1.2.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user