logo和名称替换
This commit is contained in:
@@ -3,15 +3,15 @@ import 'dart:math';
|
||||
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/extension/extensions.dart';
|
||||
import 'package:hgmj/tools_base/indicator/custom_tab_indicator.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:hgmj/tools_base/unique_tag_mixin.dart';
|
||||
import 'package:hgmj/tools_base/widget/follow_button.dart';
|
||||
import 'package:hgmj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/extension/extensions.dart';
|
||||
import 'package:wydj/tools_base/indicator/custom_tab_indicator.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import 'package:wydj/tools_base/unique_tag_mixin.dart';
|
||||
import 'package:wydj/tools_base/widget/follow_button.dart';
|
||||
import 'package:wydj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../hj_utils/const.dart';
|
||||
@@ -38,7 +38,8 @@ class CartoonDetailPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
// 详情页可经「推荐页 → 再开详情页」成环并存,用 UniqueTagMixin 给每个实例唯一 tag
|
||||
class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMixin {
|
||||
class _CartoonDetailPageState extends State<CartoonDetailPage>
|
||||
with UniqueTagMixin {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -65,7 +66,8 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
}
|
||||
|
||||
// 当前内容对应的推荐类型(小说等无对应 tab 时为 null)
|
||||
MediaStyle? _selfStyle(CartoonDetailLogic logic) => switch (logic.mediaInfo?.mediaType) {
|
||||
MediaStyle? _selfStyle(CartoonDetailLogic logic) =>
|
||||
switch (logic.mediaInfo?.mediaType) {
|
||||
'video' => MediaStyle.Cartoon,
|
||||
'image' => MediaStyle.Comics,
|
||||
_ => null,
|
||||
@@ -111,7 +113,8 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
return [
|
||||
SliverToBoxAdapter(child: _buildImgHeader(logic)), //header
|
||||
SliverToBoxAdapter(child: _buildMenu(logic)), //目录
|
||||
SliverToBoxAdapter(child: _buildTabbar(logic, styles)) //推荐 tabbar
|
||||
SliverToBoxAdapter(
|
||||
child: _buildTabbar(logic, styles)) //推荐 tabbar
|
||||
];
|
||||
},
|
||||
//推荐
|
||||
@@ -137,8 +140,10 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
if (logic.isCartoonType) ...[
|
||||
Consumer<ACGSourceManager>(
|
||||
builder: (context, manager, child) {
|
||||
bool liked = manager.mediaInfo?.mediaStatus?.hasLiked == true;
|
||||
return InkWell(enableFeedback: false,
|
||||
bool liked =
|
||||
manager.mediaInfo?.mediaStatus?.hasLiked == true;
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => manager.onLikeAction(),
|
||||
child: Container(
|
||||
width: 108,
|
||||
@@ -152,13 +157,16 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
liked ? 'acg_like_sel.png'.acgImgPath : 'acg_like_nor.png'.acgImgPath,
|
||||
liked
|
||||
? 'acg_like_sel.png'.acgImgPath
|
||||
: 'acg_like_nor.png'.acgImgPath,
|
||||
width: 16,
|
||||
),
|
||||
10.sizeBoxW,
|
||||
Text(
|
||||
'喜欢',
|
||||
style: textStyle(16, Color(0xff989898), FontWeight.w500),
|
||||
style: textStyle(
|
||||
16, Color(0xff989898), FontWeight.w500),
|
||||
),
|
||||
],
|
||||
)),
|
||||
@@ -168,7 +176,8 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
12.sizeBoxW,
|
||||
],
|
||||
Expanded(
|
||||
child: InkWell(enableFeedback: false,
|
||||
child: InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => logic.play(),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
@@ -268,12 +277,14 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
if (logic.mediaInfo?.permission == 0) ...[
|
||||
Text(
|
||||
'VIP',
|
||||
style: textStyle(12, Color(0xff989898), FontWeight.w400),
|
||||
style:
|
||||
textStyle(12, Color(0xff989898), FontWeight.w400),
|
||||
),
|
||||
] else if (logic.mediaInfo?.permission == 1) ...[
|
||||
Text(
|
||||
'${logic.mediaInfo?.price ?? 0}金币',
|
||||
style: textStyle(12, Color(0xff989898), FontWeight.w400),
|
||||
style:
|
||||
textStyle(12, Color(0xff989898), FontWeight.w400),
|
||||
),
|
||||
],
|
||||
],
|
||||
@@ -300,7 +311,8 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (context, index) {
|
||||
TagsBean? tag = logic.mediaInfo?.tagDetails?[index];
|
||||
return InkWell(enableFeedback: false,
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () {
|
||||
Get.to(CartoonTagPage(
|
||||
title: tag?.name ?? '',
|
||||
@@ -310,8 +322,9 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
alignment: Alignment.center,
|
||||
decoration:
|
||||
BoxDecoration(color: Colors.white.withValues(alpha: .05), borderRadius: BorderRadius.circular(3)),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: .05),
|
||||
borderRadius: BorderRadius.circular(3)),
|
||||
height: 26,
|
||||
child: Text(
|
||||
tag?.name ?? '',
|
||||
@@ -375,7 +388,8 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
labelStyle: TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
||||
labelColor: Colors.white.withValues(alpha: 0.9),
|
||||
unselectedLabelColor: Colors.white.withValues(alpha: .55),
|
||||
unselectedLabelStyle: TextStyle(fontSize: 14, fontWeight: FontWeight.w400),
|
||||
unselectedLabelStyle:
|
||||
TextStyle(fontSize: 14, fontWeight: FontWeight.w400),
|
||||
indicator: CustomIndicator(
|
||||
isGradient: true,
|
||||
width: 13,
|
||||
@@ -397,7 +411,9 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
logic.isCartoonType ? '选集' : '共${logic.mediaInfo?.totalEpisode ?? 0}${logic.mediaInfo?.unit}',
|
||||
logic.isCartoonType
|
||||
? '选集'
|
||||
: '共${logic.mediaInfo?.totalEpisode ?? 0}${logic.mediaInfo?.unit}',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
@@ -407,10 +423,13 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
InkWell(enableFeedback: false,
|
||||
InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: logic.onMenuAction,
|
||||
child: Text(
|
||||
logic.isCartoonType ? '全${logic.mediaInfo?.totalEpisode ?? 0}${logic.mediaInfo?.unit}' : '目录',
|
||||
logic.isCartoonType
|
||||
? '全${logic.mediaInfo?.totalEpisode ?? 0}${logic.mediaInfo?.unit}'
|
||||
: '目录',
|
||||
style: TextStyle(
|
||||
color: Color(0xFFA7A7A7),
|
||||
fontSize: 14,
|
||||
@@ -437,10 +456,12 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
final epm = provider.allEpisodes[index];
|
||||
return InkWell(enableFeedback: false,
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => logic.changeEpisode(index, false),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: logic.isCartoonType ? 6 : 12),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: logic.isCartoonType ? 6 : 12),
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
@@ -450,13 +471,18 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: textStyle(
|
||||
16,
|
||||
provider.index == index ? Colors.white.withValues(alpha: .9) : Colors.white.withValues(alpha: .45),
|
||||
provider.index == index ? FontWeight.w500 : FontWeight.w400,
|
||||
provider.index == index
|
||||
? Colors.white.withValues(alpha: .9)
|
||||
: Colors.white.withValues(alpha: .45),
|
||||
provider.index == index
|
||||
? FontWeight.w500
|
||||
: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
//无任何权限时,前 N 集免费展示「免费」角标
|
||||
if (provider.mediaInfo?.hasPermission == false && epm.inFreeEpisode) ...[
|
||||
if (provider.mediaInfo?.hasPermission == false &&
|
||||
epm.inFreeEpisode) ...[
|
||||
8.sizeBoxW,
|
||||
const FreeBadge(),
|
||||
],
|
||||
@@ -478,7 +504,8 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
}
|
||||
|
||||
Widget _buildBackView() {
|
||||
return InkWell(enableFeedback: false,
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
child: Image.asset(
|
||||
'back_circle_grey.png'.commonImgPath,
|
||||
width: 24,
|
||||
@@ -488,7 +515,8 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
}
|
||||
|
||||
Widget _buildShareView(CartoonDetailLogic logic) {
|
||||
return InkWell(enableFeedback: false,
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () {
|
||||
Get.dialog(
|
||||
ShareMediaDialog(
|
||||
@@ -510,20 +538,25 @@ class _CartoonDetailPageState extends State<CartoonDetailPage> with UniqueTagMix
|
||||
return Offstage(
|
||||
offstage: logic.showHeader,
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 16, right: 16, top: screen.paddingTop),
|
||||
padding:
|
||||
EdgeInsets.only(left: 16, right: 16, top: screen.paddingTop),
|
||||
height: 44 + screen.paddingTop,
|
||||
color: Color(0xff05000E),
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => Get.back(),
|
||||
child: Icon(Icons.arrow_back_ios, size: 24, color: Colors.white),
|
||||
child:
|
||||
Icon(Icons.arrow_back_ios, size: 24, color: Colors.white),
|
||||
),
|
||||
8.sizeBoxW,
|
||||
Expanded(
|
||||
child: Text(
|
||||
logic.mediaInfo?.title ?? '',
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user