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