bug修改
This commit is contained in:
parent
bb286c94ae
commit
f008d4c045
@ -46,13 +46,13 @@ android {
|
||||
signingConfigs {
|
||||
|
||||
debug {
|
||||
storeFile file('../leyuan.jks')
|
||||
storeFile file('leyuan.jks')
|
||||
storePassword 'leyuan'
|
||||
keyAlias = 'leyuan'
|
||||
keyPassword 'leyuan'
|
||||
}
|
||||
release {
|
||||
storeFile file('../leyuan.jks')
|
||||
storeFile file('leyuan.jks')
|
||||
storePassword 'leyuan'
|
||||
keyAlias = 'leyuan'
|
||||
keyPassword 'leyuan'
|
||||
|
||||
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
|
||||
|
||||
@ -381,7 +381,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.1.3;
|
||||
MARKETING_VERSION = 1.2.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -530,7 +530,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.1.3;
|
||||
MARKETING_VERSION = 1.2.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -573,7 +573,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.1.3;
|
||||
MARKETING_VERSION = 1.2.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
||||
@ -456,8 +456,7 @@ class _TIMUIKItHistoryMessageListItemState
|
||||
width: 3,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(1.5),
|
||||
borderRadius: BorderRadius.circular(1.5),
|
||||
color: Color(0xFF00FFF4)),
|
||||
),
|
||||
Expanded(
|
||||
@ -478,40 +477,40 @@ class _TIMUIKItHistoryMessageListItemState
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(top: 10.sp, bottom: 10.sp),
|
||||
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 5.sp,top: 10.sp),
|
||||
width: 3,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(1.5),
|
||||
color: Color(0xFF00FFF4)),
|
||||
),
|
||||
Expanded(child: Text(
|
||||
isFromSelf
|
||||
? '交友宣言:' + info['user']['signature']
|
||||
: '交友宣言:' + info['my']['signature'],
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
)),
|
||||
])),
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(right: 5.sp, top: 10.sp),
|
||||
width: 3,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(1.5),
|
||||
color: Color(0xFF00FFF4)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
isFromSelf
|
||||
? '交友宣言:' + info['user']['signature']
|
||||
: '交友宣言:' + info['my']['signature'],
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
)),
|
||||
])),
|
||||
Image.asset(
|
||||
getCircleImage('line'),
|
||||
width: Get.width,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
interestWdiget(isFromSelf
|
||||
? info['interests']
|
||||
: info['myInterests'])
|
||||
interestWdiget(
|
||||
isFromSelf ? info['interests'] : info['myInterests'])
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -740,7 +739,10 @@ class _TIMUIKItHistoryMessageListItemState
|
||||
}
|
||||
|
||||
interestWdiget(List data) {
|
||||
if (!data.isNotEmpty) return Container(height: 0,);
|
||||
if (!data.isNotEmpty)
|
||||
return Container(
|
||||
height: 0,
|
||||
);
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 49.sp,
|
||||
|
||||
@ -192,17 +192,17 @@ class TIMUIKitMessageTooltipState
|
||||
id: "copyMessage",
|
||||
iconImageAsset: "images/copy_message.png",
|
||||
onClick: () => _onTap("copyMessage", model)),
|
||||
if (shouldShowForwardAction && !isVoteMessage(widget.message))
|
||||
MessageToolTipItem(
|
||||
label: TIM_t("转发"),
|
||||
id: "forwardMessage",
|
||||
iconImageAsset: "images/forward_message.png",
|
||||
onClick: () => _onTap("forwardMessage", model)),
|
||||
MessageToolTipItem(
|
||||
label: TIM_t("多选"),
|
||||
id: "multiSelect",
|
||||
iconImageAsset: "images/multi_message.png",
|
||||
onClick: () => _onTap("multiSelect", model)),
|
||||
// if (shouldShowForwardAction && !isVoteMessage(widget.message))
|
||||
// MessageToolTipItem(
|
||||
// label: TIM_t("转发"),
|
||||
// id: "forwardMessage",
|
||||
// iconImageAsset: "images/forward_message.png",
|
||||
// onClick: () => _onTap("forwardMessage", model)),
|
||||
// MessageToolTipItem(
|
||||
// label: TIM_t("多选"),
|
||||
// id: "multiSelect",
|
||||
// iconImageAsset: "images/multi_message.png",
|
||||
// onClick: () => _onTap("multiSelect", model)),
|
||||
if (shouldShowReplyAction)
|
||||
MessageToolTipItem(
|
||||
label: TIM_t(model.chatConfig.isAtWhenReply ? "回复" : "引用"),
|
||||
@ -214,11 +214,11 @@ class TIMUIKitMessageTooltipState
|
||||
id: "delete",
|
||||
iconImageAsset: "images/delete_message.png",
|
||||
onClick: () => _onTap("delete", model)),
|
||||
MessageToolTipItem(
|
||||
label: TIM_t("翻译"),
|
||||
id: "translate",
|
||||
iconImageAsset: "images/translate.png",
|
||||
onClick: () => _onTap("translate", model)),
|
||||
// MessageToolTipItem(
|
||||
// label: TIM_t("翻译"),
|
||||
// id: "translate",
|
||||
// iconImageAsset: "images/translate.png",
|
||||
// onClick: () => _onTap("translate", model)),
|
||||
if (shouldShowRevokeAction)
|
||||
MessageToolTipItem(
|
||||
label: TIM_t("撤回"),
|
||||
@ -234,26 +234,26 @@ class TIMUIKitMessageTooltipState
|
||||
return tooltipsConfig.showCopyMessage &&
|
||||
widget.message.elemType == MessageElemType.V2TIM_ELEM_TYPE_TEXT;
|
||||
}
|
||||
if (type == "forwardMessage") {
|
||||
return tooltipsConfig.showForwardMessage && !isDesktopScreen;
|
||||
}
|
||||
// if (type == "forwardMessage") {
|
||||
// return tooltipsConfig.showForwardMessage && !isDesktopScreen;
|
||||
// }
|
||||
if (type == "replyMessage") {
|
||||
return tooltipsConfig.showReplyMessage && !isDesktopScreen;
|
||||
}
|
||||
if (type == "delete") {
|
||||
return (!PlatformUtils().isWeb) && tooltipsConfig.showDeleteMessage;
|
||||
}
|
||||
if (type == "multiSelect") {
|
||||
return tooltipsConfig.showMultipleChoiceMessage;
|
||||
}
|
||||
// if (type == "multiSelect") {
|
||||
// return tooltipsConfig.showMultipleChoiceMessage;
|
||||
// }
|
||||
|
||||
if (type == "revoke") {
|
||||
return tooltipsConfig.showRecallMessage;
|
||||
}
|
||||
if (type == "translate") {
|
||||
return tooltipsConfig.showTranslation &&
|
||||
widget.message.elemType == MessageElemType.V2TIM_ELEM_TYPE_TEXT;
|
||||
}
|
||||
// if (type == "translate") {
|
||||
// return tooltipsConfig.showTranslation &&
|
||||
// widget.message.elemType == MessageElemType.V2TIM_ELEM_TYPE_TEXT;
|
||||
// }
|
||||
return true;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
@ -280,8 +280,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
widget.addStickerToText(newText);
|
||||
setSendButton();
|
||||
}),
|
||||
defaultCustomEmojiStickerList:
|
||||
widget.isUseDefaultEmoji ? ConstData.emojiList : [])
|
||||
defaultCustomEmojiStickerList: [])
|
||||
: EmojiPanel(onTapEmoji: (unicode) {
|
||||
final newText = String.fromCharCode(unicode);
|
||||
widget.addStickerToText(newText);
|
||||
|
||||
@ -461,11 +461,11 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
tongueItemBuilder: widget.tongueItemBuilder,
|
||||
onLongPressForOthersHeadPortrait:
|
||||
(String? userId, String? nickName) {
|
||||
if (widget.conversationType !=
|
||||
ConvType.c2c) {
|
||||
textFieldController.longPressToAt(
|
||||
nickName, userId);
|
||||
}
|
||||
// if (widget.conversationType !=
|
||||
// ConvType.c2c) {
|
||||
// textFieldController.longPressToAt(
|
||||
// nickName, userId);
|
||||
// }
|
||||
},
|
||||
mainHistoryListConfig:
|
||||
widget.mainHistoryListConfig,
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/chat/TIMUIKitChat/tim_uikit_chat.dart';
|
||||
import 'package:circle_app/app/minefragment/logic.dart';
|
||||
import 'package:circle_app/components/my_app_bar.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
import 'package:circle_app/network/api.dart';
|
||||
import 'package:circle_app/network/dio_manager.dart';
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
@ -93,8 +94,9 @@ class _ChatPageState extends State<ChatPage> {
|
||||
));
|
||||
}).toList();
|
||||
return StickerPanel(
|
||||
backgroundColor:Colors.transparent,
|
||||
showBottomContainer: false,
|
||||
// height: 100.sp,
|
||||
backgroundColor:Colors.red,
|
||||
showBottomContainer: true,
|
||||
sendTextMsg: sendTextMessage,
|
||||
sendFaceMsg: (index, data) =>
|
||||
sendFaceMessage(index + 1, (data.split("/")[3]).split("@")[0]),
|
||||
@ -110,7 +112,6 @@ class _ChatPageState extends State<ChatPage> {
|
||||
Widget build(BuildContext context) {
|
||||
V2TimConversation con = Get.arguments;
|
||||
return TIMChat(
|
||||
|
||||
conversation: Get.arguments,
|
||||
customStickerPanel: renderCustomStickerPanel,
|
||||
onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{
|
||||
@ -125,12 +126,11 @@ class _ChatPageState extends State<ChatPage> {
|
||||
// 仅供演示,非全部配置项,实际使用中,可只传和默认项不同的参数,无需传入所有开关
|
||||
isAllowClickAvatar: true,
|
||||
isUseDefaultEmoji: true,
|
||||
isAllowLongPressMessage: false,
|
||||
isAllowLongPressMessage: true,
|
||||
isShowReadingStatus: true,
|
||||
isShowGroupReadingStatus: true,
|
||||
notificationTitle: "",
|
||||
isUseMessageReaction: true,
|
||||
|
||||
notificationBody: (V2TimMessage message, String convID, ConvType convType) {
|
||||
// V2TIM_ELEM_TYPE_NONE = 0, ///< 未知消息
|
||||
// V2TIM_ELEM_TYPE_TEXT = 1, ///< 文本消息
|
||||
@ -180,15 +180,18 @@ class _ChatPageState extends State<ChatPage> {
|
||||
),
|
||||
|
||||
userAvatarBuilder: (BuildContext context, V2TimMessage message) {
|
||||
return avatarWidget((message.faceUrl?.isNotEmpty ?? false) ? message.faceUrl! : 'https://qiniuyun.leyuan666.com/quanzi/avatar/default.png');
|
||||
return avatarWidget((message.faceUrl?.isNotEmpty ?? false) ? message.faceUrl! : 'https://qiniuyun.leyuan666.com/quanzi/avatar/default.png',message!);
|
||||
},
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
avatarWidget(String url, {double width = 34}) {
|
||||
avatarWidget(String url,V2TimMessage message, {double width = 34}) {
|
||||
print(url);
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: message.sender!.toString().split('_').last);
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:circle_app/app/likelist/logic.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:circle_app/util/device.dart';
|
||||
@ -28,7 +29,7 @@ class CircleLogic extends GetxController {
|
||||
final CircleState state = CircleState();
|
||||
var statistics = Rx<DataModel>(
|
||||
DataModel(visitCount: 0, lastVisitUsers: [], likeMeCount: 0));
|
||||
|
||||
List<UserListItem> lists = [];
|
||||
//Map? statistics;
|
||||
int page = 1;
|
||||
|
||||
|
||||
@ -528,11 +528,15 @@ class _CirclePageState extends State<CirclePage>
|
||||
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||
return InfoListView(index, bean, logic);
|
||||
},
|
||||
onIndexChanged: (index) {
|
||||
onIndexChanged: (index) async {
|
||||
controller.state.index = index;
|
||||
if (index == logic.circle.lists.length - 1) {
|
||||
logic.loadMore();
|
||||
await logic.loadMore();
|
||||
if (!logic.isMore) {
|
||||
showOKToast('小主,换个方向滑动呗~');
|
||||
}
|
||||
}
|
||||
|
||||
print(index.toString());
|
||||
},
|
||||
index: controller.state.index,
|
||||
@ -674,7 +678,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
TabBar(
|
||||
isScrollable: true,
|
||||
controller: _tabController,
|
||||
labelPadding: EdgeInsets.symmetric(horizontal: 13.0),
|
||||
labelPadding: EdgeInsets.symmetric(horizontal: 8.0.sp),
|
||||
indicator: UnderlineTabIndicator(
|
||||
borderSide: BorderSide(
|
||||
color: const Color(0xFF00FFF4),
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/circle/view.dart';
|
||||
import 'package:circle_app/common/Widgets/base_tip_widget.dart';
|
||||
@ -14,6 +17,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/utils.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import '../../../../util/eventBus.dart';
|
||||
@ -55,11 +59,13 @@ class _DiscoverState extends State<Discover>
|
||||
double nextOffset = 0;
|
||||
int lastPage = 0;
|
||||
|
||||
double screenHeight = Get.height -
|
||||
double screenHeight = Platform.isAndroid ? Get.height -
|
||||
Get.statusBarHeight - Get.bottomBarHeight : Get.height -
|
||||
Get.bottomBarHeight -
|
||||
Get.statusBarHeight -
|
||||
((Get.height > 750 ? 115.sp : 155.sp) - Get.statusBarHeight);
|
||||
|
||||
|
||||
void animateToOffset(ScrollController controller, double offset,
|
||||
void Function() onScrollCompleted) {
|
||||
controller
|
||||
@ -88,9 +94,9 @@ class _DiscoverState extends State<Discover>
|
||||
pointerEnd = event.position;
|
||||
touchRangeY = pointerStart.dy - pointerEnd.dy;
|
||||
|
||||
if (touchRangeY.abs() < screenHeight / 3) {
|
||||
if (touchRangeY.abs() < screenHeight / 8) {
|
||||
// 滑动距离大于屏幕宽度的1/8就可以继续翻页了
|
||||
nextOffset = (screenHeight + 10.sp) * lastPage;
|
||||
nextOffset = (screenHeight + 5.sp) * lastPage;
|
||||
animateToOffset(_scrollController, nextOffset, () {});
|
||||
return;
|
||||
}
|
||||
@ -98,12 +104,12 @@ class _DiscoverState extends State<Discover>
|
||||
// 手指从下向上滑动
|
||||
lastPage--;
|
||||
animateToOffset(
|
||||
_scrollController, lastPage * (screenHeight + 10.sp), () {});
|
||||
_scrollController, lastPage * ( screenHeight + 5.sp), () {});
|
||||
} else if (touchRangeY > 0 && lastPage < list.length - 1) {
|
||||
// 从上向下
|
||||
lastPage++;
|
||||
animateToOffset(
|
||||
_scrollController, lastPage * (screenHeight + 10.sp), () {});
|
||||
_scrollController, lastPage * (screenHeight + 5.sp), () {});
|
||||
if (lastPage == 3 && isPop == false && widget.unlockWxNum == 0) {
|
||||
isPop = true;
|
||||
//弹窗提示
|
||||
@ -252,6 +258,13 @@ class _DiscoverState extends State<Discover>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: add widget build method
|
||||
|
||||
screenHeight = Platform.isAndroid ? Get.height - (widget.unlockWxNum == 1 ? 10.sp : Get.bottomBarHeight + 49.sp + 2.sp) -
|
||||
Get.statusBarHeight : Get.height -
|
||||
Get.bottomBarHeight -
|
||||
Get.statusBarHeight -
|
||||
((Get.height > 750 ? 100.sp : 140.sp) - Get.statusBarHeight);
|
||||
|
||||
return list.isEmpty
|
||||
? isMore
|
||||
? loaddingWidget(true)
|
||||
@ -288,7 +301,7 @@ class _DiscoverState extends State<Discover>
|
||||
height: screenHeight,
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(
|
||||
top: 10.sp, left: 16.sp, right: 16.sp),
|
||||
top: 5.sp, left: 16.sp, right: 16.sp),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'package:circle_app/app/likelist/logic.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@ -6,5 +7,6 @@ class FriendslistBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.lazyPut(() => FriendslistLogic());
|
||||
Get.lazyPut(() => LikelistLogic());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
@ -7,9 +8,10 @@ import '../../network/dio_manager.dart';
|
||||
import '../../util/util.dart';
|
||||
import 'state.dart';
|
||||
|
||||
class FriendslistLogic extends GetxController {
|
||||
class FriendslistLogic extends GetxController {
|
||||
final RefreshController refreshController = RefreshController();
|
||||
final FriendslistState state = FriendslistState();
|
||||
|
||||
int page = 1;
|
||||
int isVip = 0;
|
||||
bool isLoad = true;
|
||||
@ -18,6 +20,8 @@ class FriendslistLogic extends GetxController {
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
|
||||
|
||||
initList();
|
||||
}
|
||||
void dispose() {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/likelist/view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -9,14 +10,34 @@ import '../../router/app_routers.dart';
|
||||
import '../../util/util.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class FriendslistPage extends StatelessWidget {
|
||||
class FriendslistPage extends StatefulWidget {
|
||||
FriendslistPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<FriendslistPage> createState() => _FriendslistPageState();
|
||||
}
|
||||
|
||||
class _FriendslistPageState extends State<FriendslistPage> with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin {
|
||||
final logic = Get.find<FriendslistLogic>();
|
||||
|
||||
final state = Get.find<FriendslistLogic>().state;
|
||||
|
||||
late TabController _tabController;
|
||||
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this, initialIndex: Get.arguments);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return GetBuilder<FriendslistLogic>(builder: (logic) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
@ -27,29 +48,99 @@ class FriendslistPage extends StatelessWidget {
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: const MyAppBar(
|
||||
centerTitle: "我喜欢的",
|
||||
),
|
||||
body: SafeArea(
|
||||
child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher(
|
||||
controller: logic.refreshController,
|
||||
onRefresh: _onRefresh,
|
||||
onLoading: _onLoading,
|
||||
enablePullUp: true,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.all(10.sp),
|
||||
itemCount: logic.lists.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListItem(logic.lists[index],index);
|
||||
},
|
||||
),
|
||||
appBar: MyAppBar(
|
||||
diyTitleWdiget: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
TabBar(
|
||||
isScrollable: true,
|
||||
controller: _tabController,
|
||||
labelPadding: EdgeInsets.symmetric(horizontal: 8.0.sp),
|
||||
indicator: UnderlineTabIndicator(
|
||||
borderSide: BorderSide(
|
||||
color: const Color(0xFF00FFF4),
|
||||
),
|
||||
),
|
||||
indicatorColor: const Color(0xFF00FFF4),
|
||||
indicatorWeight: 2.sp,
|
||||
labelColor: const Color(0xFF00FFF4),
|
||||
unselectedLabelColor: const Color(0xB3FFFFFF),
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
indicatorPadding: EdgeInsets.only(left: 30.sp, right: 30.sp),
|
||||
tabs: [
|
||||
Tab(
|
||||
child: Text(
|
||||
'我喜欢的',
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
Tab(
|
||||
child: Text(
|
||||
'喜欢我的',
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
labelStyle: TextStyle(
|
||||
color: const Color(0xFF00FFF4),
|
||||
fontSize: 18.sp,
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: const Color(0xFFF657FF).withOpacity(0.5),
|
||||
offset: Offset(0, -2), // 阴影偏移
|
||||
blurRadius: 3, // 阴影模糊半径
|
||||
// spreadRadius: 0
|
||||
),
|
||||
],
|
||||
),
|
||||
unselectedLabelStyle: TextStyle(
|
||||
// color: const Color(0xB3FFFFFF),
|
||||
fontSize: 18.sp,
|
||||
shadows: [
|
||||
Shadow(
|
||||
// color: const Color(0xFFF657FF),
|
||||
offset: const Offset(0, -1),
|
||||
blurRadius: 3.0.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: (index) {
|
||||
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
),
|
||||
body: TabBarView(children: [myLiveWidget(),LikelistPage()],controller: _tabController,),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget myLiveWidget() {
|
||||
return SafeArea(
|
||||
child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher(
|
||||
controller: logic.refreshController,
|
||||
onRefresh: _onRefresh,
|
||||
onLoading: _onLoading,
|
||||
enablePullUp: true,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.all(10.sp),
|
||||
itemCount: logic.lists.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListItem(logic.lists[index],index);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget ListItem(UserInfo item,int index) {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
@ -144,8 +235,6 @@ class FriendslistPage extends StatelessWidget {
|
||||
),);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget _buildInfoRow(UserInfo userInfoBean) {
|
||||
String ageMsg = getAgeCOntent(userInfoBean.gender, userInfoBean.age,
|
||||
userInfoBean.role, userInfoBean.orientation);
|
||||
@ -179,7 +268,6 @@ class FriendslistPage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void _onRefresh() async {
|
||||
logic.page = 1;
|
||||
logic.initList();
|
||||
|
||||
@ -212,6 +212,8 @@ class HomeLogic extends GetxController {
|
||||
} else if (index == 2) {
|
||||
final logic = Get.put(MinefragmentLogic());
|
||||
logic.getMode();
|
||||
} else {
|
||||
getUnreadSize();
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
@ -18,37 +18,26 @@ class LikelistPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<LikelistLogic>(builder: (logic) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(getBaseImage("home_back")),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: const MyAppBar(
|
||||
centerTitle: "喜欢我的",
|
||||
),
|
||||
body: SafeArea(
|
||||
child: logic.isLoad
|
||||
? loaddingWidget(true)
|
||||
: logic.lists.isEmpty
|
||||
? noResultWidget()
|
||||
: SmartRefresher(
|
||||
controller: logic.refreshController,
|
||||
onRefresh: _onRefresh,
|
||||
onLoading: _onLoading,
|
||||
enablePullUp: true,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.all(10.sp),
|
||||
itemCount: logic.lists.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListItem(logic.lists[index], index);
|
||||
},
|
||||
),
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
child: logic.isLoad
|
||||
? loaddingWidget(true)
|
||||
: logic.lists.isEmpty
|
||||
? noResultWidget()
|
||||
: SmartRefresher(
|
||||
controller: logic.refreshController,
|
||||
onRefresh: _onRefresh,
|
||||
onLoading: _onLoading,
|
||||
enablePullUp: true,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.all(10.sp),
|
||||
itemCount: logic.lists.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListItem(logic.lists[index], index);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@ -291,7 +291,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.FriendsActivity);
|
||||
Get.toNamed(AppRoutes.FriendsActivity,arguments: 0);
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -329,7 +329,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
sharedPreferences.setInt(SharedPreferencesHelper.LIKEMECOUNT, logic.like_me_count);
|
||||
});
|
||||
Get.toNamed(AppRoutes.LikeListActivity);
|
||||
Get.toNamed(AppRoutes.FriendsActivity,arguments: 1);
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
import 'package:circle_app/app/likelist/logic.dart';
|
||||
import 'package:circle_app/network/api.dart';
|
||||
import 'package:circle_app/network/dio_manager.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -5,6 +8,25 @@ import 'state.dart';
|
||||
|
||||
class MsgLogic extends GetxController {
|
||||
final MsgState state = MsgState();
|
||||
List<UserListItem> lists = [];
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
loadLikeData();
|
||||
}
|
||||
loadLikeData() async {
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.fansList, params: {
|
||||
'page':1,
|
||||
'page_size':3
|
||||
|
||||
});
|
||||
var bean = BaseResponse<UserList>.fromJson(data, (data) => UserList.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
lists.addAll(bean.data.lists);
|
||||
}
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/circle/view.dart';
|
||||
import 'package:circle_app/common/Widgets/open_vip_tip/view.dart';
|
||||
@ -81,12 +82,47 @@ class MsgPage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
circleWidget(String url, String userId,{double width = 30}) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: width.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl:url??"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.cover,
|
||||
memCacheHeight: width.toInt() - 1,
|
||||
memCacheWidth: width.toInt() - 1,
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
navigatorItem(MsgLogic ctr) {
|
||||
var logic = Get.find<CircleLogic>();
|
||||
String count = '0';
|
||||
if (logic != null) {
|
||||
count = (logic.statistics.value.likeMeCount ?? 0).toString();
|
||||
|
||||
List<Widget> widgets = [];
|
||||
int i = 0;
|
||||
// print(urlList);
|
||||
if(ctr.lists!.isNotEmpty){
|
||||
ctr.lists.forEach((element) {
|
||||
if(widgets.length>2){
|
||||
return;
|
||||
}
|
||||
widgets.add(Positioned(
|
||||
left: 15.sp * i,
|
||||
child: circleWidget(element.user.avatar! ?? "https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",element.user.id.toString()),
|
||||
));
|
||||
i++;
|
||||
});
|
||||
}
|
||||
|
||||
return Container(
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(left: 18.sp, right: 18.sp),
|
||||
@ -98,49 +134,20 @@ class MsgPage extends StatelessWidget {
|
||||
left: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.LikeListActivity);
|
||||
Get.toNamed(AppRoutes.FriendsActivity,arguments: 1);
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: count.length > 2
|
||||
? 45.sp
|
||||
: count.length > 1
|
||||
? 38.sp
|
||||
: 35.sp,
|
||||
height: 30.sp,
|
||||
child:ctr.lists.isNotEmpty
|
||||
? SizedBox(
|
||||
height: 30.sp,
|
||||
width: 30.0.sp +
|
||||
15.sp *
|
||||
(widgets.length -
|
||||
1.sp),
|
||||
child: Stack(
|
||||
children: widgets,
|
||||
),
|
||||
Image.asset(
|
||||
getMsgImage('msg_love'),
|
||||
width: 30.sp,
|
||||
),
|
||||
int.parse(count) > 0
|
||||
? Positioned(
|
||||
right: 0,
|
||||
child: Container(
|
||||
padding:
|
||||
EdgeInsets.only(left: 5.sp, right: 5.sp),
|
||||
height: 14.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(7.sp),
|
||||
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),
|
||||
),
|
||||
))
|
||||
: Container(),
|
||||
],
|
||||
))),
|
||||
)
|
||||
: Container(),)),
|
||||
ShaderMask(
|
||||
shaderCallback: (Rect bounds) {
|
||||
return const LinearGradient(
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class AppColor {
|
||||
static Color mainColor = Color(0xFF06F9FA);
|
||||
static Color bgColor = Color(0xFF120D29);
|
||||
static Color mainBgColor = Color(0XFF392D53);
|
||||
|
||||
static Gradient mainVerLinearGradient = const LinearGradient(
|
||||
|
||||
@ -11,6 +11,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
const MyAppBar({
|
||||
Key? key,
|
||||
this.backgroundColor,
|
||||
this.diyTitleWdiget,
|
||||
this.title = '',
|
||||
this.centerTitle = '',
|
||||
this.actionWdiget,
|
||||
@ -30,6 +31,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
final String backImg;
|
||||
final Color? backImgColor;
|
||||
final Widget? actionWdiget;
|
||||
final Widget? diyTitleWdiget;
|
||||
final VoidCallback? onPressed;
|
||||
final VoidCallback? onCenterTitlePressed;
|
||||
final bool isBack;
|
||||
@ -76,7 +78,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
),
|
||||
) : Container();
|
||||
|
||||
final Widget titleWidget = GestureDetector(
|
||||
Widget titleWidget = diyTitleWdiget != null ? diyTitleWdiget! : GestureDetector(
|
||||
onTap: onCenterTitlePressed,
|
||||
child: Semantics(
|
||||
namesRoute: true,
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
|
||||
|
||||
class Api {
|
||||
// static const baseUrl = 'https://leyuan666.com/zuul-service/';
|
||||
static const baseUrl = 'https://leyuan666.com/zuul-service/';
|
||||
|
||||
|
||||
static const baseUrl = 'http://192.168.3.55:2000/';
|
||||
// static const baseUrl = 'http://192.168.3.55:2000/';
|
||||
|
||||
|
||||
// 获取验证码
|
||||
|
||||
@ -39,7 +39,7 @@ dependencies:
|
||||
# 屏幕适配
|
||||
flutter_screenutil: ^5.6.0
|
||||
# 相册库
|
||||
image_picker: ^0.8.6
|
||||
image_picker: ^0.8.7+5
|
||||
# Toast弹窗
|
||||
oktoast: ^3.3.1
|
||||
# 清除缓存
|
||||
@ -142,6 +142,7 @@ flutter:
|
||||
- assets/images/mine/
|
||||
- assets/images/msg/
|
||||
- assets/images/circle/
|
||||
- assets/tencent_cloud_chat_sticker/
|
||||
- assets/province.json
|
||||
# - images/a_dot_ham.jpeg
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user