圈子相关点击滑动到顶部 还有bug修改
This commit is contained in:
parent
613660f1ce
commit
030041e5ca
@ -155,7 +155,7 @@ class Call_outLogic extends GetxController {
|
|||||||
final logic = Get.put(CircleLogic());
|
final logic = Get.put(CircleLogic());
|
||||||
logic.setCircle(numbers[0].id);
|
logic.setCircle(numbers[0].id);
|
||||||
logic.refresh();
|
logic.refresh();
|
||||||
logic.update();
|
// logic.update();
|
||||||
// Navigator.pop(Get.context!, numbers);
|
// Navigator.pop(Get.context!, numbers);
|
||||||
Get.back();
|
Get.back();
|
||||||
} else if (beandata.code == 30503) {
|
} else if (beandata.code == 30503) {
|
||||||
@ -181,7 +181,7 @@ class Call_outLogic extends GetxController {
|
|||||||
// showDialog();
|
// showDialog();
|
||||||
print(numbers[0].id);
|
print(numbers[0].id);
|
||||||
|
|
||||||
showJoinCiclePiker(numbers[0].id.toString(),callOutBean.data.amount,callOutBean.data.oldAmount,0,(payResult){
|
showJoinCiclePiker(numbers[0].id.toString(),callOutBean.data.amount.toString(),callOutBean.data.oldAmount.toString(),0,(payResult){
|
||||||
final logic = Get.put(CircleLogic());
|
final logic = Get.put(CircleLogic());
|
||||||
logic.circle.lists.forEach((element) {
|
logic.circle.lists.forEach((element) {
|
||||||
if(element.id == numbers[0].id){
|
if(element.id == numbers[0].id){
|
||||||
|
|||||||
@ -2,10 +2,13 @@ import 'package:circle_app/main.dart';
|
|||||||
import 'package:circle_app/router/app_routers.dart';
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import '../../common/Widgets/open_vip_tip/view.dart';
|
||||||
import '../../network/api.dart';
|
import '../../network/api.dart';
|
||||||
import '../../network/dio_manager.dart';
|
import '../../network/dio_manager.dart';
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||||
|
|
||||||
class CircleLogic extends GetxController {
|
class CircleLogic extends GetxController {
|
||||||
|
|
||||||
@ -19,6 +22,9 @@ class CircleLogic extends GetxController {
|
|||||||
|
|
||||||
bool isMore = true;
|
bool isMore = true;
|
||||||
|
|
||||||
|
AutoScrollController scrollController = AutoScrollController();
|
||||||
|
ScrollController listScrollController = ScrollController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
@ -121,11 +127,28 @@ class CircleLogic extends GetxController {
|
|||||||
if (!isSuccess) {
|
if (!isSuccess) {
|
||||||
await sendTextMsg(data['data']['account_id']);
|
await sendTextMsg(data['data']['account_id']);
|
||||||
}
|
}
|
||||||
} else {
|
} else if(data['code'] == 21201){
|
||||||
|
showRechargeDialog();
|
||||||
|
}else{
|
||||||
showOKToast(data['msg']);
|
showOKToast(data['msg']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showRechargeDialog(){
|
||||||
|
Get.bottomSheet(
|
||||||
|
Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
body: Open_vip_tipPage(false),
|
||||||
|
),
|
||||||
|
isScrollControlled: true,
|
||||||
|
enableDrag: false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,13 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
final state = Get.find<CircleLogic>().state;
|
final state = Get.find<CircleLogic>().state;
|
||||||
|
|
||||||
var getContext;
|
var getContext;
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
// TODO: implement dispose
|
||||||
|
scrollController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -62,7 +69,8 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
child: Swiper(
|
child: Swiper(
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
var bean = logic.circle.lists[index];
|
var bean = logic.circle.lists[index];
|
||||||
return InfoListView(index, bean, logic,scrollController);
|
final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||||
|
return InfoListView(key:infoListViewKey,index:index,bean: bean, logic:logic,scrollController:scrollController);
|
||||||
},
|
},
|
||||||
onIndexChanged: (index) {
|
onIndexChanged: (index) {
|
||||||
controller.state.index = index;
|
controller.state.index = index;
|
||||||
|
|||||||
@ -20,18 +20,28 @@ import '../../../util/SharedPreferencesHelper.dart';
|
|||||||
class InfoListView extends StatefulWidget {
|
class InfoListView extends StatefulWidget {
|
||||||
// Get.lazyPut(() => ListLogic());
|
// Get.lazyPut(() => ListLogic());
|
||||||
|
|
||||||
var logic;
|
|
||||||
Circle bean;
|
|
||||||
int index;
|
|
||||||
ScrollController scrollController;
|
|
||||||
|
|
||||||
InfoListView(this.index, this.bean, this.logic,this.scrollController, {super.key});
|
|
||||||
|
|
||||||
|
final int index;
|
||||||
|
late final Circle bean;
|
||||||
|
var logic;
|
||||||
|
final ScrollController scrollController;
|
||||||
|
|
||||||
|
InfoListView({
|
||||||
|
Key? key,
|
||||||
|
required this.index,
|
||||||
|
required this.bean,
|
||||||
|
required this.logic,
|
||||||
|
required this.scrollController,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<InfoListView> createState() => _InfoListViewState();
|
State<InfoListView> createState() => InfoListViewState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClientMixin {
|
class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClientMixin {
|
||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
@ -67,8 +77,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
});
|
});
|
||||||
circleId = widget.bean.id
|
circleId = widget.bean.id.toString();
|
||||||
.toString();
|
|
||||||
loadCallOutListData();
|
loadCallOutListData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -147,10 +147,15 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
"帮助与反馈",
|
"帮助与反馈",
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
|
const Text(
|
||||||
|
"乐园客服在线等您哦",
|
||||||
|
style: TextStyle(color: Colors.white30),
|
||||||
|
),
|
||||||
Image(
|
Image(
|
||||||
image: AssetImage(getHomeImage("icon_in")),
|
image: AssetImage(getHomeImage("icon_in")),
|
||||||
width: 24.sp,
|
width: 24.sp,
|
||||||
@ -158,6 +163,7 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -41,6 +41,11 @@ class TIMConversation extends StatefulWidget {
|
|||||||
/// conversation controller
|
/// conversation controller
|
||||||
final TIMUIKitConversationController? controller;
|
final TIMUIKitConversationController? controller;
|
||||||
|
|
||||||
|
final AutoScrollController? autoScrollController;
|
||||||
|
|
||||||
|
|
||||||
|
final ScrollController? scrollController;
|
||||||
|
|
||||||
/// the builder for conversation item
|
/// the builder for conversation item
|
||||||
final TIMConversationItemBuilder? itemBuilder;
|
final TIMConversationItemBuilder? itemBuilder;
|
||||||
|
|
||||||
@ -76,7 +81,9 @@ class TIMConversation extends StatefulWidget {
|
|||||||
this.lifeCycle,
|
this.lifeCycle,
|
||||||
this.onTapItem,
|
this.onTapItem,
|
||||||
this.controller,
|
this.controller,
|
||||||
|
this.autoScrollController,
|
||||||
this.itemSecondaryMenuBuilder,
|
this.itemSecondaryMenuBuilder,
|
||||||
|
this.scrollController,
|
||||||
this.itemBuilder,
|
this.itemBuilder,
|
||||||
this.isShowDraft = true,
|
this.isShowDraft = true,
|
||||||
this.itemSlideBuilder,
|
this.itemSlideBuilder,
|
||||||
@ -154,7 +161,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
final TUIThemeViewModel themeViewModel = serviceLocator<TUIThemeViewModel>();
|
final TUIThemeViewModel themeViewModel = serviceLocator<TUIThemeViewModel>();
|
||||||
final TUIFriendShipViewModel friendShipViewModel =
|
final TUIFriendShipViewModel friendShipViewModel =
|
||||||
serviceLocator<TUIFriendShipViewModel>();
|
serviceLocator<TUIFriendShipViewModel>();
|
||||||
late AutoScrollController _autoScrollController;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -162,7 +169,14 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
final controller = getController();
|
final controller = getController();
|
||||||
_timuiKitConversationController = controller;
|
_timuiKitConversationController = controller;
|
||||||
_timuiKitConversationController.model = model;
|
_timuiKitConversationController.model = model;
|
||||||
_autoScrollController = AutoScrollController();
|
}
|
||||||
|
|
||||||
|
scrollToTop() {
|
||||||
|
widget.autoScrollController!.animateTo(
|
||||||
|
0.0, // Scroll to the top
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
TIMUIKitConversationController getController() {
|
TIMUIKitConversationController getController() {
|
||||||
@ -219,7 +233,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isFound) {
|
if (isFound) {
|
||||||
_autoScrollController.scrollToIndex(
|
widget.autoScrollController!.scrollToIndex(
|
||||||
targetIndex,
|
targetIndex,
|
||||||
preferPosition: AutoScrollPosition.begin,
|
preferPosition: AutoScrollPosition.begin,
|
||||||
);
|
);
|
||||||
@ -308,30 +322,32 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
return widget.itemSlideBuilder ?? _defaultSlideBuilder;
|
return widget.itemSlideBuilder ?? _defaultSlideBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<V2TimUserFullInfo>> getUserListInfo(List<String> userIdList) async {
|
Future<List<V2TimUserFullInfo>> getUserListInfo(
|
||||||
|
List<String> userIdList) async {
|
||||||
V2TimValueCallback<String> getLoginUserRes =
|
V2TimValueCallback<String> getLoginUserRes =
|
||||||
await TencentImSDKPlugin.v2TIMManager.getLoginUser();
|
await TencentImSDKPlugin.v2TIMManager.getLoginUser();
|
||||||
if (getLoginUserRes.code == 0) {
|
if (getLoginUserRes.code == 0) {
|
||||||
//获取成功
|
//获取成功
|
||||||
userIdList.insert(0, getLoginUserRes.data!);// getLoginUserRes.data为查询到的登录用户的UserID
|
userIdList.insert(
|
||||||
|
0, getLoginUserRes.data!); // getLoginUserRes.data为查询到的登录用户的UserID
|
||||||
}
|
}
|
||||||
//获取用户资料
|
//获取用户资料
|
||||||
V2TimValueCallback<List<V2TimUserFullInfo>> getUsersInfoRes =
|
V2TimValueCallback<List<V2TimUserFullInfo>> getUsersInfoRes =
|
||||||
await TencentImSDKPlugin.v2TIMManager.getUsersInfo(userIDList: userIdList);//需要查询的用户id列表
|
await TencentImSDKPlugin.v2TIMManager
|
||||||
|
.getUsersInfo(userIDList: userIdList); //需要查询的用户id列表
|
||||||
if (getUsersInfoRes.code == 0) {
|
if (getUsersInfoRes.code == 0) {
|
||||||
// 查询成功
|
// 查询成功
|
||||||
getUsersInfoRes.data?.forEach((element) {
|
getUsersInfoRes.data?.forEach((element) {
|
||||||
element.allowType;//用户的好友验证方式 0:允许所有人加我好友 1:不允许所有人加我好友 2:加我好友需我确认
|
element.allowType; //用户的好友验证方式 0:允许所有人加我好友 1:不允许所有人加我好友 2:加我好友需我确认
|
||||||
element.birthday;//用户生日
|
element.birthday; //用户生日
|
||||||
element.customInfo;//用户的自定义状态
|
element.customInfo; //用户的自定义状态
|
||||||
element.faceUrl;//用户头像 url
|
element.faceUrl; //用户头像 url
|
||||||
element.gender;//用户的性别 1:男 2:女
|
element.gender; //用户的性别 1:男 2:女
|
||||||
element.level;//用户的等级
|
element.level; //用户的等级
|
||||||
element.nickName;//用户昵称
|
element.nickName; //用户昵称
|
||||||
element.role;//用户的角色
|
element.role; //用户的角色
|
||||||
element.selfSignature;//用户的签名
|
element.selfSignature; //用户的签名
|
||||||
element.userID;//用户 ID
|
element.userID; //用户 ID
|
||||||
});
|
});
|
||||||
return getUsersInfoRes.data ?? [];
|
return getUsersInfoRes.data ?? [];
|
||||||
}
|
}
|
||||||
@ -368,22 +384,20 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
_model.clearScrollToConversation();
|
_model.clearScrollToConversation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
List<String> userIdList = [];
|
List<String> userIdList = [];
|
||||||
|
|
||||||
|
|
||||||
filteredConversationList.forEach((element) {
|
filteredConversationList.forEach((element) {
|
||||||
userIdList.add(element!.userID!);
|
userIdList.add(element!.userID!);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Widget conversationList() {
|
Widget conversationList() {
|
||||||
return filteredConversationList.isNotEmpty
|
return filteredConversationList.isNotEmpty
|
||||||
? FutureBuilder<List<V2TimUserFullInfo>>(
|
? FutureBuilder<List<V2TimUserFullInfo>>(
|
||||||
future: getUserListInfo(userIdList),
|
future: getUserListInfo(userIdList),
|
||||||
builder: (BuildContext context, AsyncSnapshot<List<V2TimUserFullInfo>> snapshot) {
|
builder: (BuildContext context,
|
||||||
|
AsyncSnapshot<List<V2TimUserFullInfo>> snapshot) {
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
controller: _autoScrollController,
|
controller: widget.scrollController!,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: filteredConversationList.length,
|
itemCount: filteredConversationList.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
@ -393,12 +407,15 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final conversationItem = filteredConversationList[index];
|
final conversationItem =
|
||||||
|
filteredConversationList[index];
|
||||||
|
|
||||||
final V2TimUserStatus? onlineStatus =
|
final V2TimUserStatus? onlineStatus =
|
||||||
_friendShipViewModel.userStatusList.firstWhere(
|
_friendShipViewModel.userStatusList.firstWhere(
|
||||||
(item) => item.userID == conversationItem?.userID,
|
(item) =>
|
||||||
orElse: () => V2TimUserStatus(statusType: 0));
|
item.userID == conversationItem?.userID,
|
||||||
|
orElse: () =>
|
||||||
|
V2TimUserStatus(statusType: 0));
|
||||||
|
|
||||||
if (widget.itemBuilder != null) {
|
if (widget.itemBuilder != null) {
|
||||||
return widget.itemBuilder!(
|
return widget.itemBuilder!(
|
||||||
@ -413,30 +430,39 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
|
|
||||||
final isPined = conversationItem.isPinned ?? false;
|
final isPined = conversationItem.isPinned ?? false;
|
||||||
|
|
||||||
|
|
||||||
V2TimUserFullInfo? userFullInfo;
|
V2TimUserFullInfo? userFullInfo;
|
||||||
bool isOfficial = false;
|
bool isOfficial = false;
|
||||||
bool isSameCity = false;
|
bool isSameCity = false;
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState ==
|
||||||
|
ConnectionState.done) {
|
||||||
snapshot.data!.forEach((element) {
|
snapshot.data!.forEach((element) {
|
||||||
if (element.userID == conversationItem.userID) {
|
if (element.userID == conversationItem.userID) {
|
||||||
userFullInfo = element;
|
userFullInfo = element;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//自己的信息
|
//自己的信息
|
||||||
V2TimUserFullInfo myuserFullInfo = snapshot.data!.first;
|
V2TimUserFullInfo myuserFullInfo =
|
||||||
|
snapshot.data!.first;
|
||||||
|
|
||||||
if (userFullInfo!.customInfo!.containsKey('Label')) {
|
if (userFullInfo!.customInfo!
|
||||||
var otherInfo = jsonDecode(userFullInfo!.customInfo!['Label'].toString());
|
.containsKey('Label')) {
|
||||||
var myInfo = jsonDecode(myuserFullInfo!.customInfo!['Label'].toString());
|
var otherInfo = jsonDecode(userFullInfo!
|
||||||
if (myInfo['city'].toString().contains(otherInfo['city'].toString())) {
|
.customInfo!['Label']
|
||||||
|
.toString());
|
||||||
|
var myInfo = jsonDecode(myuserFullInfo!
|
||||||
|
.customInfo!['Label']
|
||||||
|
.toString());
|
||||||
|
if (myInfo['city']
|
||||||
|
.toString()
|
||||||
|
.contains(otherInfo['city'].toString())) {
|
||||||
isSameCity = true;
|
isSameCity = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userFullInfo != null) {
|
if (userFullInfo != null) {
|
||||||
List<String> userIdList = userFullInfo!.userID!.split('_');
|
List<String> userIdList =
|
||||||
if (userIdList.length >= 4 ) {
|
userFullInfo!.userID!.split('_');
|
||||||
|
if (userIdList.length >= 4) {
|
||||||
if (int.parse(userIdList[2]) == 10) {
|
if (int.parse(userIdList[2]) == 10) {
|
||||||
isOfficial = true;
|
isOfficial = true;
|
||||||
} else {
|
} else {
|
||||||
@ -444,14 +470,9 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Widget conversationLineItem() {
|
Widget conversationLineItem() {
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
@ -461,22 +482,28 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
isCurrent: isCurrent,
|
isCurrent: isCurrent,
|
||||||
userInfo: userFullInfo,
|
userInfo: userFullInfo,
|
||||||
isShowDraft: widget.isShowDraft,
|
isShowDraft: widget.isShowDraft,
|
||||||
lastMessageBuilder: widget.lastMessageBuilder,
|
lastMessageBuilder:
|
||||||
|
widget.lastMessageBuilder,
|
||||||
faceUrl: conversationItem.faceUrl ?? "",
|
faceUrl: conversationItem.faceUrl ?? "",
|
||||||
nickName: conversationItem.showName ?? "",
|
nickName: conversationItem.showName ?? "",
|
||||||
isDisturb: conversationItem.recvOpt != 0,
|
isDisturb: conversationItem.recvOpt != 0,
|
||||||
lastMsg: conversationItem.lastMessage,
|
lastMsg: conversationItem.lastMessage,
|
||||||
isPined: isPined,
|
isPined: isPined,
|
||||||
groupAtInfoList:
|
groupAtInfoList:
|
||||||
conversationItem.groupAtInfoList ?? [],
|
conversationItem.groupAtInfoList ??
|
||||||
unreadCount: conversationItem.unreadCount ?? 0,
|
[],
|
||||||
|
unreadCount:
|
||||||
|
conversationItem.unreadCount ?? 0,
|
||||||
draftText: conversationItem.draftText,
|
draftText: conversationItem.draftText,
|
||||||
onlineStatus: (widget.isShowOnlineStatus &&
|
onlineStatus: (widget
|
||||||
|
.isShowOnlineStatus &&
|
||||||
conversationItem.userID != null &&
|
conversationItem.userID != null &&
|
||||||
conversationItem.userID!.isNotEmpty)
|
conversationItem
|
||||||
|
.userID!.isNotEmpty)
|
||||||
? onlineStatus
|
? onlineStatus
|
||||||
: null,
|
: null,
|
||||||
draftTimestamp: conversationItem.draftTimestamp,
|
draftTimestamp:
|
||||||
|
conversationItem.draftTimestamp,
|
||||||
convType: conversationItem.type),
|
convType: conversationItem.type),
|
||||||
onTap: () => onTapConvItem(conversationItem),
|
onTap: () => onTapConvItem(conversationItem),
|
||||||
),
|
),
|
||||||
@ -485,13 +512,15 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
|
|
||||||
return TUIKitScreenUtils.getDeviceWidget(
|
return TUIKitScreenUtils.getDeviceWidget(
|
||||||
desktopWidget: AutoScrollTag(
|
desktopWidget: AutoScrollTag(
|
||||||
key: ValueKey(conversationItem.conversationID),
|
key:
|
||||||
controller: _autoScrollController,
|
ValueKey(conversationItem.conversationID),
|
||||||
|
controller: widget.autoScrollController!,
|
||||||
index: index,
|
index: index,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onSecondaryTapDown: (details) {
|
onSecondaryTapDown: (details) {
|
||||||
TUIKitWidePopup.showPopupWindow(
|
TUIKitWidePopup.showPopupWindow(
|
||||||
operationKey: TUIKitWideModalOperationKey
|
operationKey:
|
||||||
|
TUIKitWideModalOperationKey
|
||||||
.conversationSecondaryMenu,
|
.conversationSecondaryMenu,
|
||||||
isDarkBackground: false,
|
isDarkBackground: false,
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
@ -500,11 +529,15 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
offset: Offset(
|
offset: Offset(
|
||||||
min(
|
min(
|
||||||
details.globalPosition.dx,
|
details.globalPosition.dx,
|
||||||
MediaQuery.of(context).size.width -
|
MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width -
|
||||||
80),
|
80),
|
||||||
min(
|
min(
|
||||||
details.globalPosition.dy,
|
details.globalPosition.dy,
|
||||||
MediaQuery.of(context).size.height -
|
MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.height -
|
||||||
130)),
|
130)),
|
||||||
child: (onClose) => _getSecondaryMenu(
|
child: (onClose) => _getSecondaryMenu(
|
||||||
conversationItem, onClose));
|
conversationItem, onClose));
|
||||||
@ -513,15 +546,17 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
defaultWidget: AutoScrollTag(
|
defaultWidget: AutoScrollTag(
|
||||||
key: ValueKey(conversationItem.conversationID),
|
key:
|
||||||
controller: _autoScrollController,
|
ValueKey(conversationItem.conversationID),
|
||||||
|
controller: widget.autoScrollController!,
|
||||||
index: index,
|
index: index,
|
||||||
child: Slidable(
|
child: Slidable(
|
||||||
groupTag: 'conversation-list',
|
groupTag: 'conversation-list',
|
||||||
child: conversationLineItem(),
|
child: conversationLineItem(),
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
extentRatio:
|
extentRatio: slideChildren.length > 2
|
||||||
slideChildren.length > 2 ? 0.77 : 0.5,
|
? 0.77
|
||||||
|
: 0.5,
|
||||||
motion: const DrawerMotion(),
|
motion: const DrawerMotion(),
|
||||||
children: slideChildren)),
|
children: slideChildren)),
|
||||||
));
|
));
|
||||||
@ -539,11 +574,14 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
model.refresh();
|
model.refresh();
|
||||||
},
|
},
|
||||||
|
child:SingleChildScrollView(
|
||||||
|
controller: widget.scrollController,
|
||||||
child: conversationList(),
|
child: conversationList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
desktopWidget: Scrollbar(
|
desktopWidget: Scrollbar(
|
||||||
controller: _autoScrollController,
|
controller: widget.autoScrollController!,
|
||||||
child: conversationList()));
|
child: conversationList()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
class MsgLogic extends GetxController {
|
class MsgLogic extends GetxController {
|
||||||
final MsgState state = MsgState();
|
final MsgState state = MsgState();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,14 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:circle_app/app/circle/logic.dart';
|
import 'package:circle_app/app/circle/logic.dart';
|
||||||
import 'package:circle_app/router/app_routers.dart';
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||||
|
import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_conversation_controller.dart';
|
||||||
|
|
||||||
import 'TIMUIKitConversation/tim_uikit_conversation.dart';
|
import 'TIMUIKitConversation/tim_uikit_conversation.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
@ -14,6 +17,7 @@ class MsgPage extends StatelessWidget {
|
|||||||
MsgPage({Key? key}) : super(key: key);
|
MsgPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
final logic = Get.put(MsgLogic());
|
final logic = Get.put(MsgLogic());
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
@ -24,7 +28,7 @@ class MsgPage extends StatelessWidget {
|
|||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
image: AssetImage(getBaseImage('home_back')))),
|
image: AssetImage(getBaseImage('home_back')))),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
resizeToAvoidBottomInset:false,
|
resizeToAvoidBottomInset: false,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: GetBuilder(builder: (MsgLogic controller) {
|
child: GetBuilder(builder: (MsgLogic controller) {
|
||||||
@ -63,32 +67,43 @@ class MsgPage extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: count .length > 2 ? 45.sp : count .length > 1 ? 38.sp : 35.sp,height: 30.sp,),
|
SizedBox(
|
||||||
|
width: count.length > 2
|
||||||
|
? 45.sp
|
||||||
|
: count.length > 1
|
||||||
|
? 38.sp
|
||||||
|
: 35.sp,
|
||||||
|
height: 30.sp,
|
||||||
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
getMsgImage('msg_love'),
|
getMsgImage('msg_love'),
|
||||||
width: 30.sp,
|
width: 30.sp,
|
||||||
),
|
),
|
||||||
|
int.parse(count) > 0
|
||||||
int.parse(count) > 0 ? Positioned(
|
? Positioned(
|
||||||
right:0,
|
right: 0,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.only(left: 5.sp,right: 5.sp),
|
padding:
|
||||||
|
EdgeInsets.only(left: 5.sp, right: 5.sp),
|
||||||
height: 14.sp,
|
height: 14.sp,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(7.sp),
|
borderRadius: BorderRadius.circular(7.sp),
|
||||||
gradient:const LinearGradient(colors: [
|
gradient: const LinearGradient(
|
||||||
|
colors: [
|
||||||
Color(0xFFC343F9),
|
Color(0xFFC343F9),
|
||||||
Color(0xFFFB34B2),
|
Color(0xFFFB34B2),
|
||||||
],
|
],
|
||||||
)
|
)),
|
||||||
|
|
||||||
),
|
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
int.parse(count) > 99 ? '99+' : count,
|
int.parse(count) > 99 ? '99+' : count,
|
||||||
style: TextStyle(color: Colors.white,fontSize: 10.sp,fontWeight: FontWeight.w500),
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 10.sp,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
)) : Container(),
|
))
|
||||||
|
: Container(),
|
||||||
],
|
],
|
||||||
))),
|
))),
|
||||||
ShaderMask(
|
ShaderMask(
|
||||||
@ -99,6 +114,15 @@ class MsgPage extends StatelessWidget {
|
|||||||
colors: [Color(0xff71F3F2), Color(0xffF657FF)],
|
colors: [Color(0xff71F3F2), Color(0xffF657FF)],
|
||||||
).createShader(Offset.zero & bounds.size);
|
).createShader(Offset.zero & bounds.size);
|
||||||
},
|
},
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
print("123123123");
|
||||||
|
logic.listScrollController.animateTo(
|
||||||
|
0.0,
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
);
|
||||||
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'消息',
|
'消息',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@ -110,6 +134,7 @@ class MsgPage extends StatelessWidget {
|
|||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
right: 0,
|
right: 0,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
@ -144,8 +169,12 @@ class MsgPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
V2TimConversation conv = V2TimConversation(type: 1,userID: '10040818',conversationID: 'c2c_10040818',showName: '456');
|
V2TimConversation conv = V2TimConversation(
|
||||||
Get.toNamed(AppRoutes.Chat,arguments: conv);
|
type: 1,
|
||||||
|
userID: '10040818',
|
||||||
|
conversationID: 'c2c_10040818',
|
||||||
|
showName: '456');
|
||||||
|
Get.toNamed(AppRoutes.Chat, arguments: conv);
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@ -249,19 +278,22 @@ class MsgPage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
msgWdiget(context) {
|
msgWdiget(context) {
|
||||||
|
var logic = Get.find<CircleLogic>();
|
||||||
return TIMConversation(
|
return TIMConversation(
|
||||||
|
autoScrollController: logic.scrollController,
|
||||||
|
scrollController: logic.listScrollController,
|
||||||
onTapItem: (selectedConv) {
|
onTapItem: (selectedConv) {
|
||||||
String type = selectedConv.userID!.split('_')[2];
|
String type = selectedConv.userID!.split('_')[2];
|
||||||
if (int.parse(type) == 11) {
|
if (int.parse(type) == 11) {
|
||||||
Get.toNamed(AppRoutes.Sys_notify_list,arguments: selectedConv);
|
Get.toNamed(AppRoutes.Sys_notify_list, arguments: selectedConv);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Get.toNamed(AppRoutes.Chat,arguments: selectedConv);
|
Get.toNamed(AppRoutes.Chat, arguments: selectedConv);
|
||||||
},
|
},
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Widget msgItem(conv,status){
|
|
||||||
|
Widget msgItem(conv, status) {
|
||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
|
|
||||||
final state = Get.find<MyCircleLogic>().state;
|
final state = Get.find<MyCircleLogic>().state;
|
||||||
|
|
||||||
|
|
||||||
var getContext;
|
var getContext;
|
||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
|
|
||||||
@ -58,7 +59,15 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
child: logic.circle.lists.isEmpty ? loaddingWidget(true) : Swiper(
|
child: logic.circle.lists.isEmpty ? loaddingWidget(true) : Swiper(
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
var bean = logic.circle.lists[index];
|
var bean = logic.circle.lists[index];
|
||||||
return InfoListView(index, bean, controller,scrollController);
|
final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||||
|
MyinfoListViewKey = infoListViewKey;
|
||||||
|
return InfoListView(
|
||||||
|
key: infoListViewKey, // Assign the key here
|
||||||
|
index: index,
|
||||||
|
bean: bean,
|
||||||
|
logic: controller,
|
||||||
|
scrollController: scrollController,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
index: controller.state.index,
|
index: controller.state.index,
|
||||||
itemCount: logic.circle.lists.length,
|
itemCount: logic.circle.lists.length,
|
||||||
@ -85,17 +94,33 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
var MyinfoListViewKey;
|
||||||
|
|
||||||
backNavigatorItem() {
|
backNavigatorItem() {
|
||||||
return MyAppBar(
|
return MyAppBar(
|
||||||
centerTitle: '我的圈子',
|
centerTitle: '我的圈子',
|
||||||
onPressed: (){
|
onCenterTitlePressed: (){
|
||||||
scrollController.animateTo(
|
scrollController.animateTo(
|
||||||
0.0, // Scroll to the top
|
0.0, // Scroll to the top
|
||||||
duration: Duration(milliseconds: 300),
|
duration: Duration(milliseconds: 300),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
actionWdiget: const Text(
|
||||||
|
"发布喊话",
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
onPressed: () async{
|
||||||
|
List<MyConfigData> numbers = [];
|
||||||
|
numbers.add(MyConfigData(
|
||||||
|
logic.getCircleIndex().id.toString(),
|
||||||
|
logic.getCircleIndex().title!,
|
||||||
|
false));
|
||||||
|
var data = await Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
|
||||||
|
MyinfoListViewKey.currentState?.loadCallOutListData();
|
||||||
|
// logic.refresh();
|
||||||
|
// logic.update();
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class Select_circlePage extends StatelessWidget {
|
|||||||
appBar: MyAppBar(
|
appBar: MyAppBar(
|
||||||
centerTitle: '选择感兴趣的圈子',
|
centerTitle: '选择感兴趣的圈子',
|
||||||
actionWdiget: Text(
|
actionWdiget: Text(
|
||||||
"提交",
|
"完成",
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|||||||
@ -42,12 +42,13 @@ class Signal_circle_listPage extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: controller.circle == null
|
child: controller.circle == null
|
||||||
? loaddingWidget(true)
|
? loaddingWidget(true)
|
||||||
: InfoListView(0, controller.circle!, controller,scrollController))
|
: InfoListView(key:GlobalKey<InfoListViewState>(),index:0,bean: controller.circle!,logic: controller,scrollController:scrollController))
|
||||||
]),
|
]),
|
||||||
));
|
));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
//
|
|
||||||
|
//
|
||||||
// backNavigatorItem() {
|
// backNavigatorItem() {
|
||||||
// return MyAppBar(
|
// return MyAppBar(
|
||||||
// centerTitle: ,
|
// centerTitle: ,
|
||||||
|
|||||||
@ -18,6 +18,7 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
|
|||||||
return StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
return StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
body: Container(
|
body: Container(
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
height: Get.height,
|
height: Get.height,
|
||||||
|
|||||||
@ -16,6 +16,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
this.backImgColor,
|
this.backImgColor,
|
||||||
this.onPressed,
|
this.onPressed,
|
||||||
this.isDiyBack = false,
|
this.isDiyBack = false,
|
||||||
|
this.onCenterTitlePressed,
|
||||||
this.superContext,
|
this.superContext,
|
||||||
this.isBack = true
|
this.isBack = true
|
||||||
}): super(key: key);
|
}): super(key: key);
|
||||||
@ -27,6 +28,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
final Color? backImgColor;
|
final Color? backImgColor;
|
||||||
final Widget? actionWdiget;
|
final Widget? actionWdiget;
|
||||||
final VoidCallback? onPressed;
|
final VoidCallback? onPressed;
|
||||||
|
final VoidCallback? onCenterTitlePressed;
|
||||||
final bool isBack;
|
final bool isBack;
|
||||||
final bool isDiyBack;
|
final bool isDiyBack;
|
||||||
final BuildContext? superContext;
|
final BuildContext? superContext;
|
||||||
@ -63,7 +65,9 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
),
|
),
|
||||||
) : Container();
|
) : Container();
|
||||||
|
|
||||||
final Widget titleWidget = Semantics(
|
final Widget titleWidget = GestureDetector(
|
||||||
|
onTap: onCenterTitlePressed,
|
||||||
|
child: Semantics(
|
||||||
namesRoute: true,
|
namesRoute: true,
|
||||||
header: true,
|
header: true,
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -83,7 +87,8 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
style: TextStyle(fontSize: 18.sp,fontWeight: FontWeight.w600,color: Colors.white,shadows: [Shadow(color: Color(0xffF657FF), offset: Offset(0.0, -1))]),
|
style: TextStyle(fontSize: 18.sp,fontWeight: FontWeight.w600,color: Colors.white,shadows: [Shadow(color: Color(0xffF657FF), offset: Offset(0.0, -1))]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
));
|
)),
|
||||||
|
);
|
||||||
|
|
||||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
value: overlayStyle,
|
value: overlayStyle,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user