chore: clean up

opt: pages

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-19 18:05:02 +08:00
parent e5f3c3c922
commit a2ef4e6f84
99 changed files with 697 additions and 2097 deletions

View File

@@ -595,23 +595,6 @@ class PiliScheme {
}
launchURL();
return false;
// case 'opus':
// String? id = uriDigitRegExp.firstMatch(path)?.group(1);
// if (id != null) {
// PageUtils.toDupNamed(
// '/htmlRender',
// parameters: {
// 'url': 'https://www.bilibili.com/opus/$id',
// 'title': '',
// 'id': id,
// 'dynamicType': 'opus'
// },
// off: off,
// );
// return true;
// }
// launchURL();
// return false;
case 'dynamic' || 'opus':
bool hasMatch = await _onPushDynDetail(path, off);
if (hasMatch.not) {

View File

@@ -1,9 +1,6 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
class CacheManage {
CacheManage._internal();
@@ -76,45 +73,6 @@ class CacheManage {
return size + unitArr[index];
}
// 清除缓存
Future<void> clearCacheAll(BuildContext context) async {
await showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: const Text('提示'),
content: const Text('该操作将清除图片及网络请求缓存数据,确认清除?'),
actions: [
TextButton(
onPressed: () => Get.back(),
child: Text(
'取消',
style: TextStyle(color: Theme.of(context).colorScheme.outline),
),
),
TextButton(
onPressed: () async {
SmartDialog.showLoading(msg: '正在清除...');
try {
// 清除缓存 图片缓存
await clearLibraryCache();
SmartDialog.dismiss().then((res) {
SmartDialog.showToast('清除成功');
});
} catch (err) {
SmartDialog.dismiss();
SmartDialog.showToast(err.toString());
}
Get.back();
},
child: const Text('确认'),
)
],
);
},
);
}
/// 清除 Documents 目录下的 DioCache.db
Future clearApplicationCache() async {
Directory directory = await getApplicationDocumentsDirectory();

View File

@@ -79,24 +79,6 @@ class DownloadUtils {
PermissionStatus status = await Permission.photos.status;
if (status == PermissionStatus.denied ||
status == PermissionStatus.permanentlyDenied) {
// SmartDialog.show(
// useSystem: true,
// animationType: SmartAnimationType.centerFade_otherSlide,
// builder: (BuildContext context) {
// return AlertDialog(
// title: const Text('提示'),
// content: const Text('相册权限未授权'),
// actions: [
// TextButton(
// onPressed: () async {
// openAppSettings();
// },
// child: const Text('去授权'),
// )
// ],
// );
// },
// );
return false;
} else {
return true;

View File

@@ -30,15 +30,5 @@ class Em {
static String decodeHtmlEntities(String title) {
return parse(title).body?.text ?? title;
// return title
// .replaceAll('&lt;', '<')
// .replaceAll('&gt;', '>')
// .replaceAll('&#34;', '"')
// .replaceAll('&#39;', "'")
// .replaceAll('&quot;', '"')
// .replaceAll('&apos;', "'")
// .replaceAll('&nbsp;', " ")
// .replaceAll('&amp;', "&")
// .replaceAll('&#x27;', "'");
}
}

View File

@@ -160,8 +160,7 @@ class PageUtils {
contentPadding: const EdgeInsets.only(),
title: const Text("额外等待视频播放完毕", style: titleStyle),
trailing: Transform.scale(
alignment: Alignment
.centerRight, // 缩放Switch的大小后保持右侧对齐, 避免右侧空隙过大
alignment: Alignment.centerRight,
scale: 0.8,
child: Switch(
thumbIcon: WidgetStateProperty.resolveWith<Icon?>(
@@ -189,18 +188,15 @@ class PageUtils {
onTap: () {
shutdownTimerService.exitApp = false;
setState(() {});
// Get.back();
},
text: " 暂停视频 ",
selectStatus: !shutdownTimerService.exitApp,
),
const Spacer(),
// const SizedBox(width: 10),
ActionRowLineItem(
onTap: () {
shutdownTimerService.exitApp = true;
setState(() {});
// Get.back();
},
text: " 退出APP ",
selectStatus: shutdownTimerService.exitApp,

View File

@@ -4,7 +4,6 @@ import 'package:hive/hive.dart';
import 'storage.dart';
class RecommendFilter {
// static late int filterUnfollowedRatio;
static late int minDurationForRcmd;
static late int minPlayForRcmd;
static late int minLikeRatioForRecommend;
@@ -20,8 +19,6 @@ class RecommendFilter {
static Box get setting => GStorage.setting;
static void update() {
// filterUnfollowedRatio =
// setting.get(SettingBoxKey.filterUnfollowedRatio, defaultValue: 0);
minDurationForRcmd =
setting.get(SettingBoxKey.minDurationForRcmd, defaultValue: 0);
minPlayForRcmd = setting.get(SettingBoxKey.minPlayForRcmd, defaultValue: 0);

View File

@@ -44,10 +44,6 @@ class GStorage {
static late final Box<dynamic> setting;
static late final Box<dynamic> video;
// static bool get isLogin => userInfo.get('userInfoCache') != null;
// static get ownerMid => userInfo.get('userInfoCache')?.mid;
static List<double> get speedList => List<double>.from(
video.get(
VideoBoxKey.speedsList,
@@ -642,7 +638,6 @@ class SettingBoxKey {
// ignore: constant_identifier_names
CDNService = 'CDNService',
disableAudioCDN = 'disableAudioCDN',
// enableCDN = 'enableCDN',
autoPiP = 'autoPiP',
pipNoDanmaku = 'pipNoDanmaku',
enableAutoLongPressSpeed = 'enableAutoLongPressSpeed',
@@ -669,7 +664,6 @@ class SettingBoxKey {
minLikeRatioForRecommend = 'minLikeRatioForRecommend',
exemptFilterForFollowed = 'exemptFilterForFollowed',
banWordForRecommend = 'banWordForRecommend',
//filterUnfollowedRatio = 'filterUnfollowedRatio',
applyFilterToRelatedVideos = 'applyFilterToRelatedVideos',
/// 其他
@@ -806,8 +800,6 @@ class SettingBoxKey {
displayMode = 'displayMode',
smallCardWidth = 'smallCardWidth',
videoPlayerRemoveSafeArea = 'videoPlayerRemoveSafeArea', // 视频播放器移除安全边距
// videoPlayerShowStatusBarBackgroundColor =
// 'videoPlayerShowStatusBarBackgroundColor', // 播放页状态栏显示为背景色
dynamicsWaterfallFlow = 'dynamicsWaterfallFlow', // 动态瀑布流
upPanelPosition = 'upPanelPosition', // up主面板位置
dynamicsShowAllFollowedUp = 'dynamicsShowAllFollowedUp', // 动态显示全部关注up
@@ -818,7 +810,6 @@ class SettingBoxKey {
tabbarSort = 'tabbarSort', // 首页tabbar
dynamicBadgeMode = 'dynamicBadgeMode',
msgBadgeMode = 'msgBadgeMode',
// msgUnReadType = 'msgUnReadType',
msgUnReadTypeV2 = 'msgUnReadTypeV2',
hiddenSettingUnlocked = 'hiddenSettingUnlocked',
enableGradientBg = 'enableGradientBg',

View File

@@ -81,9 +81,6 @@ class ThemeUtils {
: null,
shadowColor: Colors.transparent,
),
// dialogTheme: DialogTheme(
// surfaceTintColor: isDark ? colorScheme.onSurfaceVariant : null,
// ),
progressIndicatorTheme: ProgressIndicatorThemeData(
refreshBackgroundColor: colorScheme.onSecondary,
),

View File

@@ -147,14 +147,6 @@ class Utils {
return base64Encoded;
}
// static String genRandomString(int length) {
// const characters = '0123456789abcdefghijklmnopqrstuvwxyz';
// Random random = Random();
// return List.generate(
// length, (index) => characters[random.nextInt(characters.length)])
// .join();
// }
static String genTraceId() {
String randomId = generateRandomString(32);