logo和名称替换
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
//查看更多
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
|
||||
import '../../../hj_utils/widget_util.dart';
|
||||
|
||||
@@ -33,7 +33,9 @@ class _AcgShowMoreTextWidgetState extends State<AcgShowMoreTextWidget> {
|
||||
Widget build(BuildContext context) {
|
||||
//用 LayoutBuilder 拿真实约束宽度测量,避免传入的 maxWidth 与实际渲染宽度不符导致"该展开却没按钮"
|
||||
return LayoutBuilder(builder: (context, cons) {
|
||||
final maxWidth = cons.maxWidth.isFinite ? cons.maxWidth : (widget.maxWidth ?? Get.width);
|
||||
final maxWidth = cons.maxWidth.isFinite
|
||||
? cons.maxWidth
|
||||
: (widget.maxWidth ?? Get.width);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -41,7 +43,9 @@ class _AcgShowMoreTextWidgetState extends State<AcgShowMoreTextWidget> {
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
widget.summary?.isNotEmpty == true ? widget.summary ?? '' : '暂无简介',
|
||||
widget.summary?.isNotEmpty == true
|
||||
? widget.summary ?? ''
|
||||
: '暂无简介',
|
||||
textAlign: TextAlign.left,
|
||||
style: textStyle(12, widget.txColor, FontWeight.w400),
|
||||
maxLines: _isFold ? widget.maxLine : null,
|
||||
@@ -59,7 +63,8 @@ class _AcgShowMoreTextWidgetState extends State<AcgShowMoreTextWidget> {
|
||||
children: [
|
||||
Text(
|
||||
_isFold ? '更多简介' : '收起简介',
|
||||
style: textStyle(12, const Color(0xffEFEFEF), FontWeight.w400),
|
||||
style: textStyle(
|
||||
12, const Color(0xffEFEFEF), FontWeight.w400),
|
||||
),
|
||||
2.sizeBoxW,
|
||||
AnimatedRotation(
|
||||
@@ -93,7 +98,8 @@ class _AcgShowMoreTextWidgetState extends State<AcgShowMoreTextWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
bool _textExceedMaxLines(String text, TextStyle style, int maxLine, double maxWidth) {
|
||||
bool _textExceedMaxLines(
|
||||
String text, TextStyle style, int maxLine, double maxWidth) {
|
||||
//与 Text 组件保持一致:合并 DefaultTextStyle(letterSpacing/字体等差异会导致测量行数偏少)
|
||||
final effectiveStyle = DefaultTextStyle.of(context).style.merge(style);
|
||||
final painter = TextPainter(
|
||||
|
||||
@@ -3,13 +3,13 @@ import 'dart:async';
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/cartoon_media_info.dart';
|
||||
import 'package:hgmj/hj_model/media_content.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/common_service.dart';
|
||||
import 'package:hgmj/tools_base/event_bus/event_bus_util.dart';
|
||||
import 'package:hgmj/tools_base/event_bus/events.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_helper.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:wydj/hj_model/cartoon_media_info.dart';
|
||||
import 'package:wydj/hj_model/media_content.dart';
|
||||
import 'package:wydj/hj_utils/api_service/common_service.dart';
|
||||
import 'package:wydj/tools_base/event_bus/event_bus_util.dart';
|
||||
import 'package:wydj/tools_base/event_bus/events.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_helper.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
|
||||
import '../../../alert/video/comic_buy_alert.dart';
|
||||
import '../../../alert/video/vip_acg_dialog.dart';
|
||||
@@ -44,7 +44,9 @@ class ACGSourceManager extends ChangeNotifier {
|
||||
final liked = mediaInfo?.mediaStatus?.hasLiked ?? false;
|
||||
final mid = mediaInfo?.id ?? '';
|
||||
final type = mediaInfo?.mediaType ?? '';
|
||||
final suc = liked ? await CommonService.cancelLike(mid, type) : await CommonService.sendLike(mid, type);
|
||||
final suc = liked
|
||||
? await CommonService.cancelLike(mid, type)
|
||||
: await CommonService.sendLike(mid, type);
|
||||
LoadingHelper.dismissLoading();
|
||||
if (suc) {
|
||||
mediaInfo?.mediaStatus?.hasLiked = !liked;
|
||||
@@ -94,7 +96,8 @@ class ACGSourceManager extends ChangeNotifier {
|
||||
final list = result.list ?? [];
|
||||
// 每页拉到就按集号标免费集(与播放放行/角标同一口径),避免全部拉完才标导致角标迟到
|
||||
for (final e in list) {
|
||||
e.inFreeEpisode = mediaInfo?.isFreeEpisodeNumber(e.episodeNumber) ?? false;
|
||||
e.inFreeEpisode =
|
||||
mediaInfo?.isFreeEpisodeNumber(e.episodeNumber) ?? false;
|
||||
}
|
||||
allEpisodes.addAll(list);
|
||||
notifyListeners();
|
||||
@@ -146,7 +149,8 @@ class ACGSourceManager extends ChangeNotifier {
|
||||
}
|
||||
|
||||
/// 拉漫画章节详情(带缓存 + 权限校验)
|
||||
Future<MediaContent?> getComicsMediaContent({int index = 0, bool showLoading = false}) async {
|
||||
Future<MediaContent?> getComicsMediaContent(
|
||||
{int index = 0, bool showLoading = false}) async {
|
||||
final cached = mediaContentCache[index];
|
||||
if (cached != null) {
|
||||
changeEpisodesIndex(index); // 命中缓存也要同步当前章,否则退回详情页「续看」还停在旧章
|
||||
@@ -244,9 +248,11 @@ class AudioPlayerManager {
|
||||
double playSpeed = 1;
|
||||
|
||||
void initPlayer() {
|
||||
if (_audioPlayer != null) return; // 防重入:已初始化则跳过,避免 5 个 stream 监听重复注册、旧 sub 泄漏
|
||||
if (_audioPlayer != null)
|
||||
return; // 防重入:已初始化则跳过,避免 5 个 stream 监听重复注册、旧 sub 泄漏
|
||||
_audioPlayer = AudioPlayer();
|
||||
_audioPlayer?.setReleaseMode(playMod == AudioPlayMod.loop ? ReleaseMode.loop : ReleaseMode.stop);
|
||||
_audioPlayer?.setReleaseMode(
|
||||
playMod == AudioPlayMod.loop ? ReleaseMode.loop : ReleaseMode.stop);
|
||||
|
||||
_audioDurationSub = _audioPlayer?.onDurationChanged.listen((event) {
|
||||
audioValue.value = AudioPlayerValue.copyWith(value..duration = event);
|
||||
@@ -270,7 +276,8 @@ class AudioPlayerManager {
|
||||
audioValue.value = AudioPlayerValue.copyWith(value..isPlaying = true);
|
||||
break;
|
||||
case PlayerState.paused:
|
||||
audioValue.value = AudioPlayerValue.copyWith(value..isPlaying = false);
|
||||
audioValue.value =
|
||||
AudioPlayerValue.copyWith(value..isPlaying = false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -292,7 +299,8 @@ class AudioPlayerManager {
|
||||
audioValue.value = AudioPlayerValue.copyWith(value..isPlaying = true);
|
||||
});
|
||||
|
||||
audioValue.value = AudioPlayerValue.copyWith(value..isInitialized = _audioPlayer != null);
|
||||
audioValue.value =
|
||||
AudioPlayerValue.copyWith(value..isInitialized = _audioPlayer != null);
|
||||
}
|
||||
|
||||
void setPlaySpeed(double speed) {
|
||||
@@ -355,9 +363,11 @@ class AudioPlayerManager {
|
||||
}
|
||||
|
||||
void setPlayMod(AudioPlayMod mod) {
|
||||
_audioPlayer?.setReleaseMode(mod == AudioPlayMod.loop ? ReleaseMode.loop : ReleaseMode.stop);
|
||||
_audioPlayer?.setReleaseMode(
|
||||
mod == AudioPlayMod.loop ? ReleaseMode.loop : ReleaseMode.stop);
|
||||
playMod = mod;
|
||||
audioValue.value = AudioPlayerValue.copyWith(value..isLooping = mod == AudioPlayMod.loop);
|
||||
audioValue.value =
|
||||
AudioPlayerValue.copyWith(value..isLooping = mod == AudioPlayMod.loop);
|
||||
}
|
||||
|
||||
Future<void> playWithIndex(int index) async {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
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/hj_model/acg/comic_chapters_model.dart';
|
||||
import 'package:hgmj/hj_model/cartoon_media_info.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/widget/sheet_handle_bar.dart';
|
||||
import 'package:hgmj/tools_base/widget/stagger_in_item.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_model/acg/comic_chapters_model.dart';
|
||||
import 'package:wydj/hj_model/cartoon_media_info.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/widget/sheet_handle_bar.dart';
|
||||
import 'package:wydj/tools_base/widget/stagger_in_item.dart';
|
||||
|
||||
import 'acg_source_manager.dart';
|
||||
import 'free_badge.dart';
|
||||
@@ -63,7 +63,8 @@ class _CartoonSubSetAlertState extends State<CartoonSubSetAlert> {
|
||||
16.sizeBoxW,
|
||||
const Text(
|
||||
'漫画列表',
|
||||
style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
10.sizeBoxW,
|
||||
const Spacer(),
|
||||
@@ -117,13 +118,16 @@ class _CartoonSubSetAlertState extends State<CartoonSubSetAlert> {
|
||||
//与详情/阅读抽屉子集 title 一致:第X话(CartoonDetailPage 只处理 image,恒为漫画)
|
||||
'第${info.episodeNumber ?? ''}${mediaInfo?.unit ?? ''}',
|
||||
style: TextStyle(
|
||||
color: sel ? Colors.white.withValues(alpha: .9) : Colors.white.withValues(alpha: .45),
|
||||
color: sel
|
||||
? Colors.white.withValues(alpha: .9)
|
||||
: Colors.white.withValues(alpha: .45),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
//无任何权限时,前 N 集免费展示「免费」角标
|
||||
if (mediaInfo?.hasPermission == false && info.inFreeEpisode) ...[
|
||||
if (mediaInfo?.hasPermission == false &&
|
||||
info.inFreeEpisode) ...[
|
||||
8.sizeBoxW,
|
||||
const FreeBadge(),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user