logo和名称替换
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import '../community/community_tab_logic.dart';
|
||||
|
||||
/// 社区首页的排序 tab 条,标题取自 CommunityTabLogic.sortTabs
|
||||
@@ -12,7 +12,8 @@ class CommunityMiddleHeader extends StatefulWidget {
|
||||
State<CommunityMiddleHeader> createState() => _CommunityMiddleHeaderState();
|
||||
}
|
||||
|
||||
class _CommunityMiddleHeaderState extends State<CommunityMiddleHeader> with SingleTickerProviderStateMixin {
|
||||
class _CommunityMiddleHeaderState extends State<CommunityMiddleHeader>
|
||||
with SingleTickerProviderStateMixin {
|
||||
//别在这里另写一份标题
|
||||
final sorts = CommunityTabLogic.sortTabs.map((e) => e.name).toList();
|
||||
late final TabController _controller;
|
||||
@@ -47,8 +48,15 @@ class _CommunityMiddleHeaderState extends State<CommunityMiddleHeader> with Sing
|
||||
))
|
||||
.toList(),
|
||||
indicatorWeight: 1,
|
||||
unselectedLabelStyle: TextStyle(color: Colors.white.withValues(alpha: .55), fontSize: 16.sp, height: 1),
|
||||
labelStyle: TextStyle(color: Colors.white.withValues(alpha: .9), fontSize: 16.sp, height: 1, fontWeight: FontWeight.w600),
|
||||
unselectedLabelStyle: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .55),
|
||||
fontSize: 16.sp,
|
||||
height: 1),
|
||||
labelStyle: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .9),
|
||||
fontSize: 16.sp,
|
||||
height: 1,
|
||||
fontWeight: FontWeight.w600),
|
||||
indicator: const BoxDecoration(),
|
||||
controller: _controller,
|
||||
),
|
||||
|
||||
@@ -4,10 +4,10 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_utils/date_time_util.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_utils/date_time_util.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
|
||||
import '../../../hj_model/video_model.dart';
|
||||
import '../../find/rank_module/rank_badge.dart';
|
||||
@@ -16,10 +16,11 @@ import '../community_tag_page/community_tag_page.dart';
|
||||
import '../post_detail_page/post_detail_page.dart';
|
||||
import 'post_user_info_view.dart';
|
||||
import 'post_word_rich_text.dart';
|
||||
import 'package:hgmj/extension/extensions.dart';
|
||||
import 'package:hgmj/tools_base/widget/common_alert.dart';
|
||||
import 'package:wydj/extension/extensions.dart';
|
||||
import 'package:wydj/tools_base/widget/common_alert.dart';
|
||||
|
||||
typedef OnItemCheckCallback = void Function(VideoModel videoModel, bool isChecked);
|
||||
typedef OnItemCheckCallback = void Function(
|
||||
VideoModel videoModel, bool isChecked);
|
||||
|
||||
/// 社区帖子卡片,社区/搜索/个人主页/我的发布/收藏历史多处复用
|
||||
class CommunityPostWidget extends StatelessWidget {
|
||||
@@ -66,7 +67,9 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
_ => '未知状态', //含 5
|
||||
};
|
||||
|
||||
Color get _statusColor => videoModel.status == 2 ? const Color(0xffFD0563) : const Color(0xff3476FF);
|
||||
Color get _statusColor => videoModel.status == 2
|
||||
? const Color(0xffFD0563)
|
||||
: const Color(0xff3476FF);
|
||||
|
||||
bool get _showStatus => videoModel.status != 1 && !showCheck;
|
||||
|
||||
@@ -81,7 +84,8 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
onTap: clickCallback ??
|
||||
() {
|
||||
//在点击时算好:PostDetailPageArgument 内部要过滤整个列表,别丢进 page builder 里重复跑
|
||||
final argument = PostDetailPageArgument(id: videoModel.id, models: videoModels);
|
||||
final argument =
|
||||
PostDetailPageArgument(id: videoModel.id, models: videoModels);
|
||||
Get.to(() => PostDetailPage(argument: argument));
|
||||
},
|
||||
child: Padding(
|
||||
@@ -107,7 +111,8 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
'$_statusPrefix于${formatTimeTwo(videoModel.realCreateAt)}',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(color: Color(0x8CFFFFFF), fontSize: 14),
|
||||
style:
|
||||
const TextStyle(color: Color(0x8CFFFFFF), fontSize: 14),
|
||||
),
|
||||
const Spacer(),
|
||||
if (showCheck)
|
||||
@@ -121,13 +126,18 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
width: 18,
|
||||
height: 18,
|
||||
decoration: BoxDecoration(
|
||||
color: isChecked ? Colors.white : Colors.transparent,
|
||||
color:
|
||||
isChecked ? Colors.white : Colors.transparent,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
isChecked ? CupertinoIcons.checkmark_circle_fill : CupertinoIcons.circle,
|
||||
color: isChecked ? const Color(0xffFFC000) : const Color(0xff999999),
|
||||
isChecked
|
||||
? CupertinoIcons.checkmark_circle_fill
|
||||
: CupertinoIcons.circle,
|
||||
color: isChecked
|
||||
? const Color(0xffFFC000)
|
||||
: const Color(0xff999999),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -145,7 +155,9 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Text(_statusDesc, style: TextStyle(color: _statusColor, fontSize: 14.sp)),
|
||||
child: Text(_statusDesc,
|
||||
style:
|
||||
TextStyle(color: _statusColor, fontSize: 14.sp)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -163,15 +175,19 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
//底部:浏览、评论、点赞 + 右侧话题
|
||||
Row(
|
||||
children: [
|
||||
_countItem(videoModel.pageViewCount?.countStr, "eye_grey.webp".commonImgPath),
|
||||
_countItem(videoModel.pageViewCount?.countStr,
|
||||
"eye_grey.webp".commonImgPath),
|
||||
12.sizeBoxW,
|
||||
_countItem(videoModel.commentCount?.countStr, "count_msg_gray.png".communityPath),
|
||||
_countItem(videoModel.commentCount?.countStr,
|
||||
"count_msg_gray.png".communityPath),
|
||||
12.sizeBoxW,
|
||||
CollectStatusWrapper(
|
||||
videoModel: videoModel,
|
||||
builder: () => _countItem(
|
||||
videoModel.likeCount?.countStr,
|
||||
videoModel.vidStatus?.hasLiked == true ? "like_red.png".commonImgPath : "like_empty_gray.png".communityPath,
|
||||
videoModel.vidStatus?.hasLiked == true
|
||||
? "like_red.png".commonImgPath
|
||||
: "like_empty_gray.png".communityPath,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
@@ -201,8 +217,11 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
NetworkImageLoader(imageUrl: videoModel.cover ?? '', borderRadius: 6),
|
||||
Center(child: Image.asset("play_icon.png".communityPath, width: 32, height: 32)),
|
||||
NetworkImageLoader(
|
||||
imageUrl: videoModel.cover ?? '', borderRadius: 6),
|
||||
Center(
|
||||
child: Image.asset("play_icon.png".communityPath,
|
||||
width: 32, height: 32)),
|
||||
Positioned(right: 0, top: 0, child: _coinBadge()),
|
||||
],
|
||||
),
|
||||
@@ -232,27 +251,36 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
itemBuilder: (context, index) {
|
||||
final isLast = index == 2 || coverCount == index + 1;
|
||||
//视频帖把视频封面排在最后一格,其余格按图集顺序取
|
||||
final imgPath = (isLast && isVideo) || index >= covers.length ? (videoModel.cover ?? "") : covers[index];
|
||||
final imgPath = (isLast && isVideo) || index >= covers.length
|
||||
? (videoModel.cover ?? "")
|
||||
: covers[index];
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
NetworkImageLoader(imageUrl: imgPath, imgBorderRadius: BorderRadius.circular(6)),
|
||||
NetworkImageLoader(
|
||||
imageUrl: imgPath, imgBorderRadius: BorderRadius.circular(6)),
|
||||
if (isLast) Positioned(right: 0, top: 0, child: _coinBadge()),
|
||||
if (isLast && isVideo)
|
||||
Center(child: Image.asset("play_icon.png".communityPath, width: 30))
|
||||
Center(
|
||||
child: Image.asset("play_icon.png".communityPath, width: 30))
|
||||
else if (isLast && coverCount > 3)
|
||||
Positioned(
|
||||
bottom: 6,
|
||||
right: 6,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 1),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 1),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.3),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
child: Text(
|
||||
"+${coverCount - 3}",
|
||||
style: const TextStyle(fontSize: 10, color: Color(0xff141414), fontWeight: FontWeight.w400, height: 1.6),
|
||||
style: const TextStyle(
|
||||
fontSize: 10,
|
||||
color: Color(0xff141414),
|
||||
fontWeight: FontWeight.w400,
|
||||
height: 1.6),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -268,7 +296,8 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 3),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.only(topRight: Radius.circular(6), bottomLeft: Radius.circular(6)),
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(6), bottomLeft: Radius.circular(6)),
|
||||
color: Color(0xffDB361F),
|
||||
),
|
||||
child: Image.asset("coin.webp".commonImgPath, width: 14, height: 14),
|
||||
@@ -281,7 +310,8 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
children: [
|
||||
Image.asset(icon, width: 20, height: 20),
|
||||
const SizedBox(width: 4),
|
||||
Text(title ?? "", style: const TextStyle(color: Color(0xff999999), fontSize: 12)),
|
||||
Text(title ?? "",
|
||||
style: const TextStyle(color: Color(0xff999999), fontSize: 12)),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -295,7 +325,9 @@ class CommunityPostWidget extends StatelessWidget {
|
||||
onTap: () => Get.to(() => CommunityTagDetailPage(model: tagsBean)),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(3), color: const Color(0x0DFFFFFF)),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
color: const Color(0x0DFFFFFF)),
|
||||
child: Text(
|
||||
'#${tagsBean.name ?? ''}',
|
||||
style: TextStyle(color: tagsColor ?? Color(0x8CFFFFFF), fontSize: 12),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
|
||||
class CommunitySortHeader extends StatefulWidget {
|
||||
final Function(int sort) sortOnTap;
|
||||
@@ -15,7 +15,8 @@ class CommunitySortHeader extends StatefulWidget {
|
||||
State<CommunitySortHeader> createState() => _CommunitySortHeaderState();
|
||||
}
|
||||
|
||||
class _CommunitySortHeaderState extends State<CommunitySortHeader> with SingleTickerProviderStateMixin {
|
||||
class _CommunitySortHeaderState extends State<CommunitySortHeader>
|
||||
with SingleTickerProviderStateMixin {
|
||||
final sorts = ['最多收藏', '最新上架', '最新热评'];
|
||||
late TabController _controller;
|
||||
|
||||
@@ -27,7 +28,8 @@ class _CommunitySortHeaderState extends State<CommunitySortHeader> with SingleTi
|
||||
super.initState();
|
||||
//在 initState 定死归属,别用 late 惰性求值——那时读到的可能是 rebuild 后的新 widget
|
||||
_isMine = widget.controller == null;
|
||||
_controller = widget.controller ?? TabController(length: sorts.length, vsync: this);
|
||||
_controller =
|
||||
widget.controller ?? TabController(length: sorts.length, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -50,13 +52,21 @@ class _CommunitySortHeaderState extends State<CommunitySortHeader> with SingleTi
|
||||
tabAlignment: TabAlignment.center,
|
||||
tabs: sorts
|
||||
.map((e) => Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 4.h),
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 12.w, vertical: 4.h),
|
||||
child: Text(e),
|
||||
))
|
||||
.toList(),
|
||||
indicatorWeight: 1,
|
||||
unselectedLabelStyle: TextStyle(color: Colors.white.withValues(alpha: .6), fontSize: 16.sp, height: 1),
|
||||
labelStyle: TextStyle(color: Colors.white, fontSize: 16.sp, height: 1, fontWeight: FontWeight.w600),
|
||||
unselectedLabelStyle: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .6),
|
||||
fontSize: 16.sp,
|
||||
height: 1),
|
||||
labelStyle: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
height: 1,
|
||||
fontWeight: FontWeight.w600),
|
||||
// 无指示器:原 ContainerTabIndicator 为全透明,选中态仅靠文字加粗变白
|
||||
indicator: const BoxDecoration(),
|
||||
controller: _controller,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
|
||||
/// 关注 / 收藏按钮,加载中转菊花
|
||||
class FollowLoadingButton extends StatelessWidget {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
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:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/extension/extensions.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
|
||||
import '../../../hj_model/video_model.dart';
|
||||
import '../../find/pic_collect/pics_detail_page.dart';
|
||||
@@ -17,7 +17,8 @@ class PicSimpleCell extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => Get.to(PicsDetailPage(id: videoModel?.id), preventDuplicates: false),
|
||||
onTap: () =>
|
||||
Get.to(PicsDetailPage(id: videoModel?.id), preventDuplicates: false),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -58,13 +59,16 @@ class PicSimpleCell extends StatelessWidget {
|
||||
),
|
||||
Spacer(),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 1),
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 4, vertical: 1),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset("icon_pic.png".communityPath, width: 16),
|
||||
Image.asset("icon_pic.png".communityPath,
|
||||
width: 16),
|
||||
2.sizeBoxW,
|
||||
Text(
|
||||
videoModel?.seriesCover?.length.toString() ?? "",
|
||||
videoModel?.seriesCover?.length.toString() ??
|
||||
"",
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_page/community/widget/follow_loading_button.dart';
|
||||
import 'package:hgmj/hj_page/home/widget/collect_status_wrapper.dart';
|
||||
import 'package:hgmj/hj_page/home/widget/user_name_view.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/mine_service.dart';
|
||||
import 'package:hgmj/hj_utils/date_time_util.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/routers/jump_router.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_page/community/widget/follow_loading_button.dart';
|
||||
import 'package:wydj/hj_page/home/widget/collect_status_wrapper.dart';
|
||||
import 'package:wydj/hj_page/home/widget/user_name_view.dart';
|
||||
import 'package:wydj/hj_utils/api_service/mine_service.dart';
|
||||
import 'package:wydj/hj_utils/date_time_util.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/routers/jump_router.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
|
||||
//帖子发布者信息:头像 + 昵称 + 发布时间,详情模式额外带关注按钮
|
||||
class PostUserInfoView extends StatefulWidget {
|
||||
@@ -64,7 +64,9 @@ class _PostUserInfoViewState extends State<PostUserInfoView> {
|
||||
builder: () => InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: _toggleFollow,
|
||||
child: FollowLoadingButton(isFollow: publisher?.hasFollowed ?? false, isLoading: _isLoading),
|
||||
child: FollowLoadingButton(
|
||||
isFollow: publisher?.hasFollowed ?? false,
|
||||
isLoading: _isLoading),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/hj_utils/widget_util.dart';
|
||||
import 'package:wydj/hj_utils/widget_util.dart';
|
||||
|
||||
import '../../../hj_model/video_model.dart';
|
||||
|
||||
@@ -18,7 +18,10 @@ class PostWordRichText extends StatelessWidget {
|
||||
if (videoModel?.chosen ?? false) _badge('精华'),
|
||||
TextSpan(
|
||||
text: videoModel?.title ?? '',
|
||||
style: TextStyle(color: Colors.white.withValues(alpha: .9), fontSize: 14, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .9),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -33,8 +36,11 @@ class PostWordRichText extends StatelessWidget {
|
||||
height: 18,
|
||||
alignment: Alignment.topCenter,
|
||||
margin: const EdgeInsets.only(right: 4),
|
||||
decoration: BoxDecoration(color: const Color(0xffF52C56), borderRadius: BorderRadius.circular(2)),
|
||||
child: Text(text, style: textStyle(12, Colors.white, FontWeight.w500)),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xffF52C56),
|
||||
borderRadius: BorderRadius.circular(2)),
|
||||
child:
|
||||
Text(text, style: textStyle(12, Colors.white, FontWeight.w500)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user