logo和名称替换
This commit is contained in:
@@ -2,26 +2,26 @@ import 'dart:math';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/extension/extensions.dart';
|
||||
import 'package:hgmj/hj_model/comment/comment_model.dart';
|
||||
import 'package:hgmj/hj_model/comment/reply_model.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_page/comment/cell/reply_comment_item.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/comment_service.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/common_service.dart';
|
||||
import 'package:hgmj/hj_utils/date_time_util.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/debug_log.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/extension/extensions.dart';
|
||||
import 'package:wydj/hj_model/comment/comment_model.dart';
|
||||
import 'package:wydj/hj_model/comment/reply_model.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_page/comment/cell/reply_comment_item.dart';
|
||||
import 'package:wydj/hj_utils/api_service/comment_service.dart';
|
||||
import 'package:wydj/hj_utils/api_service/common_service.dart';
|
||||
import 'package:wydj/hj_utils/date_time_util.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/debug_log.dart';
|
||||
import 'package:like_button/like_button.dart';
|
||||
|
||||
import '../../../tools_base/widget/net_image_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/image_browser_page.dart';
|
||||
import 'package:wydj/tools_base/widget/image_browser_page.dart';
|
||||
import '../../home/widget/user_avatar.dart';
|
||||
import '../../home/widget/user_name_view.dart';
|
||||
import '../widget/comment_rich_text.dart';
|
||||
import '../widget/comment_top_banner.dart';
|
||||
import 'package:hgmj/hj_model/banner/comment_top_banner_model.dart';
|
||||
import 'package:wydj/hj_model/banner/comment_top_banner_model.dart';
|
||||
|
||||
/// 一条评论:头像 + 昵称 + 正文(可带图) + 时间/点赞/回复 + 折叠的回复列表
|
||||
class CommentItem extends StatefulWidget {
|
||||
@@ -93,7 +93,8 @@ class _CommentItemState extends State<CommentItem> {
|
||||
),
|
||||
if ((comment.vipLevel ?? 0) > 0) ...[
|
||||
4.sizeBoxW,
|
||||
Image.asset("vip_v.webp".commentPath, width: 16),
|
||||
Image.asset("vip_v.webp".commentPath,
|
||||
width: 16),
|
||||
]
|
||||
],
|
||||
),
|
||||
@@ -108,11 +109,13 @@ class _CommentItemState extends State<CommentItem> {
|
||||
margin: EdgeInsets.only(top: 6),
|
||||
alignment: Alignment.centerLeft,
|
||||
constraints: BoxConstraints(maxWidth: 150),
|
||||
child: NetworkImageLoader(imageUrl: comment.image ?? ""),
|
||||
child: NetworkImageLoader(
|
||||
imageUrl: comment.image ?? ""),
|
||||
),
|
||||
),
|
||||
// 置顶评论配置 Banner(多图轮播,支持 GIF / 内外链)
|
||||
if (widget.topBanners?.isNotEmpty == true) CommentTopBanner(banners: widget.topBanners!),
|
||||
if (widget.topBanners?.isNotEmpty == true)
|
||||
CommentTopBanner(banners: widget.topBanners!),
|
||||
8.sizeBoxH,
|
||||
Row(
|
||||
children: [
|
||||
@@ -124,7 +127,8 @@ class _CommentItemState extends State<CommentItem> {
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
if (!comment.isOfficial && !comment.isHideLikeOrComment) ...[
|
||||
if (!comment.isOfficial &&
|
||||
!comment.isHideLikeOrComment) ...[
|
||||
ValueListenableBuilder(
|
||||
valueListenable: isLikedNof,
|
||||
builder: (context, value, child) => Row(
|
||||
@@ -134,7 +138,9 @@ class _CommentItemState extends State<CommentItem> {
|
||||
onTap: (_) => _toggleLike(),
|
||||
size: 20,
|
||||
likeBuilder: (isLiked) {
|
||||
return Image.asset(isLiked ? 'like_red.webp'.commentPath : 'like_white.webp'.commentPath);
|
||||
return Image.asset(isLiked
|
||||
? 'like_red.webp'.commentPath
|
||||
: 'like_white.webp'.commentPath);
|
||||
},
|
||||
),
|
||||
Text(
|
||||
@@ -149,15 +155,18 @@ class _CommentItemState extends State<CommentItem> {
|
||||
),
|
||||
12.sizeBoxW,
|
||||
GestureDetector(
|
||||
onTap: () => widget.replyHandler?.call(comment),
|
||||
child: Image.asset('msg_icon.png'.commentPath, width: 20),
|
||||
onTap: () =>
|
||||
widget.replyHandler?.call(comment),
|
||||
child: Image.asset('msg_icon.png'.commentPath,
|
||||
width: 20),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
_replyList(),
|
||||
// 展开更多评论
|
||||
if ((comment.replies?.length ?? 0) > 0) _moreReplyBar(),
|
||||
if ((comment.replies?.length ?? 0) > 0)
|
||||
_moreReplyBar(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -192,7 +201,11 @@ class _CommentItemState extends State<CommentItem> {
|
||||
children: [
|
||||
Container(width: 20, height: 1, color: const Color(0xff989898)),
|
||||
4.sizeBoxW,
|
||||
Text(text, style: const TextStyle(fontSize: 12, color: Color(0xff989898), fontWeight: FontWeight.w500)),
|
||||
Text(text,
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
color: Color(0xff989898),
|
||||
fontWeight: FontWeight.w500)),
|
||||
2.sizeBoxW,
|
||||
isUp ? Transform.rotate(angle: pi, child: chevron) : chevron,
|
||||
],
|
||||
@@ -250,8 +263,8 @@ class _CommentItemState extends State<CommentItem> {
|
||||
if (comment.hasMoreReply ?? false) {
|
||||
final curTime = DateTimeUtil.format2utc(DateTime.now());
|
||||
final fastId = comment.replies!.first.id ?? '';
|
||||
final result =
|
||||
await CommentService.getReplyList(widget.objId, comment.id ?? '', curTime, comment.replyPage ?? _page, 5, fastId);
|
||||
final result = await CommentService.getReplyList(widget.objId,
|
||||
comment.id ?? '', curTime, comment.replyPage ?? _page, 5, fastId);
|
||||
comment.hasMoreReply = result?.hasNext ?? false;
|
||||
comment.replies?.addAll(result?.list ?? []);
|
||||
if (result?.hasNext == true) {
|
||||
@@ -296,7 +309,8 @@ class _CommentItemState extends State<CommentItem> {
|
||||
length,
|
||||
(i) => ReplyCommentItem(
|
||||
replies[i],
|
||||
replyHandler: (reply) => widget.replyHandler?.call(comment, reply: reply),
|
||||
replyHandler: (reply) =>
|
||||
widget.replyHandler?.call(comment, reply: reply),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/extension/extensions.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/extension/extensions.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:like_button/like_button.dart';
|
||||
|
||||
import '../../../hj_model/comment/reply_model.dart';
|
||||
import '../../../hj_utils/api_service/common_service.dart';
|
||||
import '../../../tools_base/widget/net_image_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/image_browser_page.dart';
|
||||
import 'package:wydj/tools_base/widget/image_browser_page.dart';
|
||||
import '../../user_center_page/user_center_page.dart';
|
||||
|
||||
/// 评论下的一条回复:小头像 + 「A ▸ B」 + 正文(可带图) + 时间/点赞/回复
|
||||
@@ -81,7 +81,8 @@ class _ReplyCommentItemState extends State<ReplyCommentItem> {
|
||||
3.sizeBoxW,
|
||||
Text(
|
||||
reply.toUserName ?? '',
|
||||
style: TextStyle(color: Color(0x73FFFFFF), fontSize: 14),
|
||||
style:
|
||||
TextStyle(color: Color(0x73FFFFFF), fontSize: 14),
|
||||
),
|
||||
]
|
||||
],
|
||||
@@ -111,7 +112,8 @@ class _ReplyCommentItemState extends State<ReplyCommentItem> {
|
||||
children: [
|
||||
Text(
|
||||
reply.createdAt?.utcToAgo() ?? "",
|
||||
style: const TextStyle(color: Color(0x73FFFFFF), fontSize: 12),
|
||||
style: const TextStyle(
|
||||
color: Color(0x73FFFFFF), fontSize: 12),
|
||||
),
|
||||
const Spacer(),
|
||||
ValueListenableBuilder(
|
||||
@@ -123,7 +125,9 @@ class _ReplyCommentItemState extends State<ReplyCommentItem> {
|
||||
onTap: (_) => _toggleLike(),
|
||||
size: 20,
|
||||
likeBuilder: (isLiked) {
|
||||
return Image.asset(isLiked ? 'like_red.webp'.commentPath : 'like_white.webp'.commentPath);
|
||||
return Image.asset(isLiked
|
||||
? 'like_red.webp'.commentPath
|
||||
: 'like_white.webp'.commentPath);
|
||||
},
|
||||
),
|
||||
Text(
|
||||
@@ -139,7 +143,8 @@ class _ReplyCommentItemState extends State<ReplyCommentItem> {
|
||||
12.sizeBoxW,
|
||||
GestureDetector(
|
||||
onTap: () => widget.replyHandler?.call(reply),
|
||||
child: Image.asset('msg_icon.png'.commentPath, width: 20),
|
||||
child:
|
||||
Image.asset('msg_icon.png'.commentPath, width: 20),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user