mod: 排名

This commit is contained in:
guozhigq
2023-04-29 17:30:54 +08:00
parent e971fbc876
commit 42fd0d7f62
8 changed files with 144 additions and 62 deletions

View File

@ -51,6 +51,7 @@ android {
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
minSdkVersion 17
}
buildTypes {

BIN
assets/fonts/fansCard.ttf Normal file

Binary file not shown.

View File

@ -30,8 +30,11 @@ class NetworkImgLayer extends StatelessWidget {
// double pr = 2;
return src != ''
? ClipRRect(
borderRadius: BorderRadius.circular(
type == 'avatar' ? 50 : StyleString.imgRadius.x),
borderRadius: BorderRadius.circular(type == 'avatar'
? 50
: type == 'emote'
? 0
: StyleString.imgRadius.x),
child: CachedNetworkImage(
imageUrl: src!,
width: width ?? double.infinity,

View File

@ -1,4 +1,4 @@
import 'dart:convert' as convert;
import 'package:get/get.dart';
class ReplyMember {
ReplyMember({
@ -22,6 +22,7 @@ class ReplyMember {
Map? officialVerify;
Map? vip;
Map? fansDetail;
UserSailing? userSailing;
ReplyMember.fromJson(Map<String, dynamic> json) {
mid = json['mid'];
@ -30,9 +31,12 @@ class ReplyMember {
avatar = json['avatar'];
level = json['level_info']['current_level'];
pendant = Pendant.fromJson(json['pendant']);
officialVerify = json['officia_vVerify'];
officialVerify = json['officia_verify'];
vip = json['vip'];
fansDetail = json['fans_detail'];
userSailing = json['user_sailing'] != null
? UserSailing.fromJson(json['user_sailing'])
: UserSailing();
}
}
@ -53,3 +57,15 @@ class Pendant {
image = json['image'];
}
}
class UserSailing {
UserSailing({this.pendant, this.cardbg});
Map? pendant;
Map? cardbg;
UserSailing.fromJson(Map<String, dynamic> json) {
pendant = json['pendant'];
cardbg = json['cardbg'];
}
}

View File

@ -23,7 +23,7 @@ class VideoReplyController extends GetxController {
// 当前页
int currentPage = 0;
bool isLoadingMore = false;
bool noMore = false;
RxBool noMore = false.obs;
Future queryReplyList({type = 'init'}) async {
isLoadingMore = true;
@ -36,14 +36,17 @@ class VideoReplyController extends GetxController {
res['data'] = ReplyData.fromJson(res['data']);
if (res['data'].replies.isNotEmpty) {
currentPage = currentPage + 1;
noMore = false;
noMore.value = false;
} else {
if (currentPage == 0) {
} else {
noMore = true;
noMore.value = true;
return;
}
}
if (res['data'].replies.length >= res['data'].page.count) {
noMore.value = true;
}
if (type == 'init') {
List<ReplyItemModel> replies = res['data'].replies;
// 添加置顶回复

View File

@ -90,9 +90,10 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
height:
MediaQuery.of(context).padding.bottom + 60,
child: Center(
child: Text(_videoReplyController.noMore
child: Obx(() => Text(
_videoReplyController.noMore.value
? '没有更多了'
: '加载中'),
: '加载中')),
),
);
} else {

View File

@ -34,12 +34,40 @@ class ReplyItem extends StatelessWidget {
Widget lfAvtar(context) {
return Container(
margin: const EdgeInsets.only(top: 5),
child: NetworkImgLayer(
child: Stack(
children: [
NetworkImgLayer(
src: replyItem!.member!.avatar,
width: 30,
height: 30,
width: 34,
height: 34,
type: 'avatar',
),
if (replyItem!.member!.officialVerify != null &&
replyItem!.member!.officialVerify!['type'] == 0)
Positioned(
right: 0,
bottom: 0,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(7),
color: Theme.of(context).colorScheme.background,
),
child: Icon(
Icons.offline_bolt,
color: Theme.of(context).colorScheme.primary,
size: 16,
),
),
),
],
)
// child:
// NetworkImgLayer(
// src: replyItem!.member!.avatar,
// width: 30,
// height: 30,
// type: 'avatar',
// ),
);
}
@ -54,21 +82,31 @@ class ReplyItem extends StatelessWidget {
// 'memberAvatar': reply.avatar,
// 'heroTag': reply.userName + heroTag,
// }),
child: Row(
child: Container(
width: double.infinity,
decoration: BoxDecoration(
image: replyItem!.member!.userSailing!.cardbg != null
? DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(
replyItem!.member!.userSailing!.cardbg!['image'],
),
)
: null,
),
child: Stack(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
lfAvtar(context),
const SizedBox(width: 12),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
replyItem!.member!.uname!,
style: TextStyle(
color: replyItem!.isUp!
color: replyItem!.isUp! ||
replyItem!.member!.vip!['vipType'] > 0
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.outline,
fontSize:
@ -81,14 +119,38 @@ class ReplyItem extends StatelessWidget {
height: 11,
),
const SizedBox(width: 6),
if (replyItem!.isUp!) UpTag()
if (replyItem!.isUp!) UpTag(),
],
),
if (replyItem!.member!.userSailing!.cardbg != null &&
replyItem!.member!.userSailing!.cardbg!['fan']['number'] >
0)
Positioned(
top: 8,
left: Get.size.width / 7 * 5.6,
child: DefaultTextStyle(
style: TextStyle(
fontFamily: 'fansCard',
fontSize: 9,
color: Theme.of(context).colorScheme.primary,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text('NO.'),
Text(
replyItem!.member!.userSailing!.cardbg!['fan']
['num_desc'],
),
],
)
),
),
),
],
),
),
),
// title
Container(
margin: const EdgeInsets.only(top: 0, left: 45, right: 6),
@ -329,14 +391,16 @@ InlineSpan buildContent(BuildContext context, content) {
RegExp(r"\[.*?\]"),
onMatch: (Match match) {
String matchStr = match[0]!;
int size = content.emote[matchStr]['meta']['size'];
if (content.emote.isNotEmpty) {
if (content.emote.keys.contains(matchStr)) {
spanChilds.add(
WidgetSpan(
child: NetworkImgLayer(
src: content.emote[matchStr]['url'],
width: 20,
height: 20,
type: 'emote',
width: size * 20,
height: size * 20,
),
),
);

View File

@ -102,17 +102,11 @@ flutter:
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
fonts:
- family: fansCard
fonts:
- asset: assets/fonts/fansCard.ttf
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages