logo和名称替换

This commit is contained in:
谢宇宁
2026-10-14 11:23:36 +07:00
parent 1cb514cd02
commit c5c04a7967
478 changed files with 8990 additions and 4948 deletions
+8 -4
View File
@@ -1,6 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
import 'package:hgmj/tools_base/debug_log.dart';
import 'package:wydj/tools_base/debug_log.dart';
import '../hj_model/splash/watch_count_model.dart';
import '../hj_model/video_model.dart';
@@ -32,7 +32,8 @@ class FreePlayManager {
/// 故这些阶段推迟到帧末再通知;空闲/帧末阶段则立即通知。
void _bumpRevision() {
final phase = SchedulerBinding.instance.schedulerPhase;
final safeNow = phase == SchedulerPhase.idle || phase == SchedulerPhase.postFrameCallbacks;
final safeNow = phase == SchedulerPhase.idle ||
phase == SchedulerPhase.postFrameCallbacks;
if (safeNow) {
revision.value++;
return;
@@ -49,7 +50,9 @@ class FreePlayManager {
/// 合并去重而不是清空重填:两个 await 期间可能有视频正好扣了次数 add 进来,清掉会导致它被重复扣
Future<void> refresh() async {
remain = await VidService.fetchWatchCount();
final saved = await lightKV.getStringList(StoreKeys.NEW_FREE_WATCH_VIDEOS) ?? const <String>[];
final saved =
await lightKV.getStringList(StoreKeys.NEW_FREE_WATCH_VIDEOS) ??
const <String>[];
usedIds.addAll(saved.where((e) => !usedIds.contains(e)));
_bumpRevision();
}
@@ -100,7 +103,8 @@ class FreePlayManager {
// 后台上报,成功才落本地缓存;失败只记日志、不影响本次放行
// 注:上报是异步的,异常只能用 catchError 接(try-catch 包不住 then 里的异步错误)
VidService.fetchWatchCount(vid: video.subid ?? id).then<void>((value) {
if (value != null) lightKV.setStringList(StoreKeys.NEW_FREE_WATCH_VIDEOS, usedIds);
if (value != null)
lightKV.setStringList(StoreKeys.NEW_FREE_WATCH_VIDEOS, usedIds);
}).catchError((Object e) => debugLog('免费次数上报失败', e));
return true;
}