diff --git a/lib/common/widgets/html_render.dart b/lib/common/widgets/html_render.dart
index ea0b9f460..86c3b666e 100644
--- a/lib/common/widgets/html_render.dart
+++ b/lib/common/widgets/html_render.dart
@@ -36,15 +36,7 @@ Widget htmlRender({
if (isMall) {
return const SizedBox.shrink();
}
- // bool inTable =
- // extensionContext.element!.previousElementSibling == null ||
- // extensionContext.element!.nextElementSibling == null;
- // imgUrl = Utils().imageUrl(imgUrl!);
- // return CachedNetworkImage(
- // imageUrl: imgUrl,
- // width: isEmote ? 22 : null,
- // height: isEmote ? 22 : null,
- // );
+
String? clazz = attributes['class'];
String? height = RegExp(r'max-height:(\d+)px')
.firstMatch('${attributes['style']}')
@@ -89,7 +81,6 @@ Widget htmlRender({
lineHeight: LineHeight.percent(160),
letterSpacing: 0.3,
),
- // 'br': Style(margin: Margins.zero, padding: HtmlPaddings.zero),
'body': Style(margin: Margins.zero, padding: HtmlPaddings.zero),
'a': Style(
color: Theme.of(context).colorScheme.primary,
@@ -100,7 +91,6 @@ Widget htmlRender({
),
'p': Style(
margin: Margins.only(bottom: 4),
- // margin: Margins.zero,
),
'span': Style(
fontSize: FontSize.large,
@@ -128,7 +118,6 @@ Widget htmlRender({
'figcaption': Style(
fontSize: FontSize.large,
textAlign: TextAlign.center,
- // margin: Margins.only(top: 4),
),
'strong': Style(fontWeight: FontWeight.bold),
'figure': Style(
diff --git a/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart b/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart
index 6b00551c7..d846d7809 100644
--- a/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart
+++ b/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart
@@ -458,23 +458,6 @@ class _InteractiveviewerGalleryState extends State
imageUrl: Utils.thumbnailImgUrl(widget.sources[index].url),
);
},
- // fit: BoxFit.contain,
- // progressIndicatorBuilder: (context, url, progress) {
- // return Center(
- // child: SizedBox(
- // width: 150.0,
- // child:
- // LinearProgressIndicator(value: progress.progress ?? 0),
- // ),
- // );
- // },
- // errorListener: (value) {
- // WidgetsBinding.instance.addPostFrameCallback((_) {
- // setState(() {
- // _thumbList[index] = false;
- // });
- // });
- // },
),
SourceType.livePhoto => Obx(() => currentIndex.value == index
? IgnorePointer(
diff --git a/lib/common/widgets/network_img_layer.dart b/lib/common/widgets/network_img_layer.dart
index 3635811ac..8dbb861ba 100644
--- a/lib/common/widgets/network_img_layer.dart
+++ b/lib/common/widgets/network_img_layer.dart
@@ -106,7 +106,6 @@ class NetworkImgLayer extends StatelessWidget {
width: width,
height: height,
cacheWidth: width.cacheSize(context),
- // cacheHeight: height.cacheSize(context),
),
),
);
diff --git a/lib/common/widgets/video_card_v.dart b/lib/common/widgets/video_card_v.dart
index 077cd0370..ac92d0722 100644
--- a/lib/common/widgets/video_card_v.dart
+++ b/lib/common/widgets/video_card_v.dart
@@ -45,7 +45,6 @@ class VideoCardV extends StatelessWidget {
PageUtils.toVideoPage(
'bvid=$bvid&cid=$cid',
arguments: {
- // 'videoItem': videoItem,
'pic': videoItem.pic,
'heroTag': heroTag,
},
@@ -58,7 +57,6 @@ class VideoCardV extends StatelessWidget {
String uri = videoItem.uri!;
String id = '';
if (uri.startsWith('bilibili://article/')) {
- // https://www.bilibili.com/read/cv27063554
dynamicType = 'read';
RegExp regex = RegExp(r'\d+');
Match match = regex.firstMatch(uri)!;
diff --git a/lib/common/widgets/video_popup_menu.dart b/lib/common/widgets/video_popup_menu.dart
index 2adb6a785..e7fa3faf3 100644
--- a/lib/common/widgets/video_popup_menu.dart
+++ b/lib/common/widgets/video_popup_menu.dart
@@ -60,7 +60,6 @@ class VideoCustomActions {
Icon(MdiIcons.accountCircleOutline, size: 16),
() async {
Get.toNamed('/member?mid=${videoItem.owner.mid}', arguments: {
- // 'face': videoItem.owner.face,
'heroTag': '${videoItem.owner.mid}',
});
},
@@ -145,8 +144,6 @@ class VideoCustomActions {
onPressed: () async {
SmartDialog.showLoading(msg: '正在提交');
var res = await VideoHttp.feedDislikeCancel(
- // reasonId: r?.id,
- // feedbackId: f?.id,
id: v.param!,
goto: v.goto!,
);
diff --git a/lib/http/msg.dart b/lib/http/msg.dart
index 96acac1d1..185458aa2 100644
--- a/lib/http/msg.dart
+++ b/lib/http/msg.dart
@@ -556,36 +556,5 @@ class MsgHttp {
static String getDevId() {
return Uuid().v4();
- // final List b = [
- // '0',
- // '1',
- // '2',
- // '3',
- // '4',
- // '5',
- // '6',
- // '7',
- // '8',
- // '9',
- // 'A',
- // 'B',
- // 'C',
- // 'D',
- // 'E',
- // 'F'
- // ];
- // final List s = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".split('');
- // for (int i = 0; i < s.length; i++) {
- // if ('-' == s[i] || '4' == s[i]) {
- // continue;
- // }
- // final int randomInt = Random().nextInt(16);
- // if ('x' == s[i]) {
- // s[i] = b[randomInt];
- // } else {
- // s[i] = b[3 & randomInt | 8];
- // }
- // }
- // return s.join();
}
}
diff --git a/lib/http/user.dart b/lib/http/user.dart
index 3476eef1f..75b5d1dd9 100644
--- a/lib/http/user.dart
+++ b/lib/http/user.dart
@@ -418,30 +418,6 @@ class UserHttp {
return {'status': false, 'msg': res.data['message']};
}
}
- // // 相互关系查询
- // static Future relationSearch(int mid) async {
- // Map params = await WbiSign.makSign({
- // 'mid': mid,
- // 'token': '',
- // 'platform': 'web',
- // 'web_location': 1550101,
- // });
- // var res = await Request().get(
- // Api.relationSearch,
- // data: {
- // 'mid': mid,
- // 'w_rid': params['w_rid'],
- // 'wts': params['wts'],
- // },
- // );
- // if (res.data['code'] == 0) {
- // // relation 主动状态
- // // 被动状态
- // return {'status': true, 'data': res.data['data']};
- // } else {
- // return {'status': false, 'msg': res.data['message']};
- // }
- // }
// 搜索历史记录
static Future> searchHistory(
diff --git a/lib/http/video.dart b/lib/http/video.dart
index b45d8de2b..f0f58c912 100644
--- a/lib/http/video.dart
+++ b/lib/http/video.dart
@@ -24,9 +24,6 @@ import 'api.dart';
import 'init.dart';
import 'login.dart';
-/// res.data['code'] == 0 请求正常返回结果
-/// res.data['data'] 为结果
-/// 返回{'status': bool, 'data': List}
/// view层根据 status 判断渲染逻辑
class VideoHttp {
static bool enableRcmdDynamic =
@@ -374,28 +371,6 @@ class VideoHttp {
}
}
- // 获取点赞状态
- // static Future hasLikeVideo({required String bvid}) async {
- // var res =
- // await Request().get(Api.hasLikeVideo, queryParameters: {'bvid': bvid});
- // if (res.data['code'] == 0) {
- // return {'status': true, 'data': res.data['data']};
- // } else {
- // return {'status': false, 'msg': res.data['message']};
- // }
- // }
-
- // 获取投币状态
- // static Future hasCoinVideo({required String bvid}) async {
- // var res =
- // await Request().get(Api.hasCoinVideo, queryParameters: {'bvid': bvid});
- // if (res.data['code'] == 0) {
- // return {'status': true, 'data': res.data['data']};
- // } else {
- // return {'status': false, 'msg': res.data['message']};
- // }
- // }
-
// 投币
static Future coinVideo({
required String bvid,
@@ -420,17 +395,6 @@ class VideoHttp {
}
}
- // 获取收藏状态
- // static Future hasFavVideo({required int aid}) async {
- // var res =
- // await Request().get(Api.hasFavVideo, queryParameters: {'aid': aid});
- // if (res.data['code'] == 0) {
- // return {'status': true, 'data': res.data['data']};
- // } else {
- // return {'status': false, 'msg': res.data['message']};
- // }
- // }
-
// 一键三连 bangumi
static Future triple({dynamic epId, required dynamic seasonId}) async {
var res = await Request().post(
@@ -492,11 +456,6 @@ class VideoHttp {
'like': type ? '0' : '1',
},
options: Options(contentType: Headers.formUrlEncodedContentType),
- // queryParameters: {
- // 'bvid': bvid,
- // 'like': type ? 1 : 2,
- // 'csrf': Accounts.main.csrf,
- // },
);
if (res.data['code'] == 0) {
return {'status': true, 'data': res.data['data']};
@@ -541,7 +500,6 @@ class VideoHttp {
var res = await Request().get(Api.feedDislike, queryParameters: {
'goto': goto,
'id': id,
- // 'mid': mid,
if (reasonId != null) 'reason_id': reasonId,
if (feedbackId != null) 'feedback_id': feedbackId,
'build': '1',
@@ -563,11 +521,9 @@ class VideoHttp {
if (Accounts.get(AccountType.recommend).accessKey.isNullOrEmpty) {
return {'status': false, 'msg': "请退出账号后重新登录"};
}
- // assert ((reasonId != null) ^ (feedbackId != null));
var res = await Request().get(Api.feedDislikeCancel, queryParameters: {
'goto': goto,
'id': id,
- // 'mid': mid,
if (reasonId != null) 'reason_id': reasonId,
if (feedbackId != null) 'feedback_id': feedbackId,
'build': '1',
@@ -627,33 +583,6 @@ class VideoHttp {
}
}
- // (取消)收藏 bangumi
- // static Future favBangumi({
- // required dynamic epId,
- // String? addIds,
- // String? delIds,
- // }) async {
- // var res = await Request().post(
- // Api.favBangumi,
- // data: {
- // 'resources': '$epId:24',
- // 'add_media_ids': addIds ?? '',
- // 'del_media_ids': delIds ?? '',
- // 'csrf': Accounts.main.csrf,
- // },
- // options: Options(
- // headers: {
- // 'Content-Type': Headers.formUrlEncodedContentType,
- // },
- // ),
- // );
- // if (res.data['code'] == 0) {
- // return {'status': true, 'data': res.data['data']};
- // } else {
- // return {'status': false, 'msg': res.data['message']};
- // }
- // }
-
static Future copyOrMoveFav({
required bool isCopy,
required bool isFav,
@@ -853,7 +782,6 @@ class VideoHttp {
subType,
}) async {
await Request().post(Api.heartBeat, queryParameters: {
- // 'aid': aid,
'bvid': bvid,
'cid': cid,
if (epid != null) 'epid': epid,
@@ -989,26 +917,10 @@ class VideoHttp {
);
if (res.data['code'] == 0) {
dynamic data = res.data['data'];
- /*
- [
- {
- "id": 1430455228267894300,
- "lan": "ai-zh",
- "lan_doc": "中文(自动生成)",
- "is_lock": false,
- "subtitle_url": "//aisubtitle.hdslb.com/bfs/ai_subtitle/prod/15508958271448462983dacf99a49f40ccdf91a4df8d925e2b58?auth_key=1708941835-aaa0e44844594386ad356795733983a2-0-89af73c6aad5a1fca43b02113fa9d485",
- "type": 1,
- "id_str": "1430455228267894272",
- "ai_type": 0,
- "ai_status": 2
- }
- ]
- */
return {
'status': true,
'subtitles': data['subtitle']['subtitles'],
'view_points': data['view_points'],
- // 'last_play_time': data['last_play_time'],
'last_play_cid': data['last_play_cid'],
'interaction': data['interaction'],
};
diff --git a/lib/models/user/fav_detail.dart b/lib/models/user/fav_detail.dart
index ebef6c5bd..01a8f4306 100644
--- a/lib/models/user/fav_detail.dart
+++ b/lib/models/user/fav_detail.dart
@@ -62,7 +62,4 @@ class FavDetailItemData extends BaseVideoItemModel with MultiSelectData {
static final _digitRegExp = RegExp(r'\d+');
String resolveEpId(String url) => _digitRegExp.firstMatch(url)!.group(0)!;
-
- // @override
- // bool isFollowed;
}
diff --git a/lib/models/video/play/quality.dart b/lib/models/video/play/quality.dart
index 34cb858d3..e41faa9c4 100644
--- a/lib/models/video/play/quality.dart
+++ b/lib/models/video/play/quality.dart
@@ -59,7 +59,6 @@ extension VideoQualityDesc on VideoQuality {
String get description => _descList[index];
}
-///
enum AudioQuality { k64, k132, k192, dolby, hiRes }
extension AudioQualityCode on AudioQuality {
diff --git a/lib/models/video/play/url.dart b/lib/models/video/play/url.dart
index 4a6ed23f1..268e709b3 100644
--- a/lib/models/video/play/url.dart
+++ b/lib/models/video/play/url.dart
@@ -16,7 +16,6 @@ class PlayUrlModel {
this.seekType,
this.dash,
this.supportFormats,
- // this.highFormat,
this.lastPlayTime,
this.lastPlayCid,
});
@@ -36,7 +35,6 @@ class PlayUrlModel {
Dash? dash;
List? durl;
List? supportFormats;
- // String? highFormat;
int? lastPlayTime;
int? lastPlayCid;
@@ -175,8 +173,9 @@ class VideoItem {
baseUrl = json['baseUrl'];
var backupUrls = json['backupUrl']?.toList() ?? [];
backupUrl = backupUrls.isNotEmpty
- ? backupUrls.firstWhere((i) => !_isMCDNorPCDN(i), orElse: () => backupUrls.first)
- : '';
+ ? backupUrls.firstWhere((i) => !_isMCDNorPCDN(i),
+ orElse: () => backupUrls.first)
+ : '';
bandWidth = json['bandWidth'];
mimeType = json['mime_type'];
codecs = json['codecs'];
@@ -248,8 +247,9 @@ class AudioItem {
baseUrl = json['baseUrl'];
var backupUrls = json['backupUrl']?.toList() ?? [];
backupUrl = backupUrls.isNotEmpty
- ? backupUrls.firstWhere((i) => !_isMCDNorPCDN(i), orElse: () => backupUrls.first)
- : '';
+ ? backupUrls.firstWhere((i) => !_isMCDNorPCDN(i),
+ orElse: () => backupUrls.first)
+ : '';
bandWidth = json['bandWidth'];
mimeType = json['mime_type'];
codecs = json['codecs'];
diff --git a/lib/pages/about/index.dart b/lib/pages/about/view.dart
similarity index 69%
rename from lib/pages/about/index.dart
rename to lib/pages/about/view.dart
index d47315187..e7d601929 100644
--- a/lib/pages/about/index.dart
+++ b/lib/pages/about/view.dart
@@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io';
import 'package:PiliPlus/build_config.dart';
+import 'package:PiliPlus/common/widgets/dialog.dart';
import 'package:PiliPlus/services/loggeer.dart';
import 'package:PiliPlus/utils/accounts/account.dart';
import 'package:PiliPlus/utils/login_utils.dart';
@@ -12,7 +13,6 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:package_info_plus/package_info_plus.dart';
-import 'package:PiliPlus/models/github/latest.dart';
import 'package:PiliPlus/utils/storage.dart';
import 'package:PiliPlus/utils/utils.dart';
import '../../utils/cache_manage.dart';
@@ -28,16 +28,33 @@ class AboutPage extends StatefulWidget {
}
class _AboutPageState extends State {
- final AboutController _aboutController = Get.put(AboutController());
final String _sourceCodeUrl = 'https://github.com/bggRGjQaUbCoE/PiliPlus';
- final String _originSourceCodeUrl = 'https://github.com/guozhigq/pilipala';
- final String _upstreamUrl = 'https://github.com/orz12/PiliPalaX';
+
+ RxString currentVersion = ''.obs;
+ RxString cacheSize = ''.obs;
late int _pressCount = 0;
late Color outline;
late TextStyle subTitleStyle;
+ @override
+ void initState() {
+ super.initState();
+ getCacheSize();
+ getCurrentApp();
+ }
+
+ Future getCacheSize() async {
+ cacheSize.value = await CacheManage().loadApplicationCache();
+ }
+
+ Future getCurrentApp() async {
+ var currentInfo = await PackageInfo.fromPlatform();
+ String buildNumber = currentInfo.buildNumber;
+ currentVersion.value = "${currentInfo.version}+$buildNumber";
+ }
+
@override
void didChangeDependencies() {
super.didChangeDependencies();
@@ -46,18 +63,6 @@ class _AboutPageState extends State {
TextStyle(fontSize: 13, color: Theme.of(context).colorScheme.outline);
}
- @override
- void initState() {
- super.initState();
- // 读取缓存占用
- getCacheSize();
- }
-
- Future getCacheSize() async {
- final res = await CacheManage().loadApplicationCache();
- _aboutController.cacheSize.value = res;
- }
-
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -123,12 +128,11 @@ class _AboutPageState extends State {
Obx(
() => ListTile(
onTap: () => Utils.checkUpdate(false),
- onLongPress: () =>
- Utils.copyText(_aboutController.currentVersion.value),
+ onLongPress: () => Utils.copyText(currentVersion.value),
title: const Text('当前版本'),
leading: const Icon(Icons.commit_outlined),
trailing: Text(
- _aboutController.currentVersion.value,
+ currentVersion.value,
style: subTitleStyle,
),
),
@@ -156,24 +160,6 @@ Commit Hash: ${BuildConfig.commitHash}''',
title: const Text('Source Code'),
subtitle: Text(_sourceCodeUrl, style: subTitleStyle),
),
- ListTile(
- onTap: () => PageUtils.launchURL(_originSourceCodeUrl),
- leading: const Icon(Icons.code),
- title: const Text('Origin'),
- subtitle: Text(
- _originSourceCodeUrl,
- style: subTitleStyle,
- ),
- ),
- ListTile(
- onTap: () => PageUtils.launchURL(_upstreamUrl),
- leading: const Icon(Icons.code),
- title: const Text('Upstream'),
- subtitle: Text(
- _upstreamUrl,
- style: subTitleStyle,
- ),
- ),
if (Platform.isAndroid)
ListTile(
onTap: () {
@@ -189,22 +175,7 @@ Commit Hash: ${BuildConfig.commitHash}''',
),
ListTile(
onTap: () {
- showDialog(
- context: context,
- builder: (context) {
- return SimpleDialog(
- clipBehavior: Clip.hardEdge,
- title: const Text('问题反馈'),
- children: [
- ListTile(
- title: const Text('GitHub Issue'),
- onTap: () =>
- PageUtils.launchURL('$_sourceCodeUrl/issues'),
- ),
- ],
- );
- },
- );
+ PageUtils.launchURL('$_sourceCodeUrl/issues');
},
leading: const Icon(Icons.feedback_outlined),
title: const Text('问题反馈'),
@@ -225,15 +196,30 @@ Commit Hash: ${BuildConfig.commitHash}''',
trailing: Icon(Icons.arrow_forward, size: 16, color: outline),
),
ListTile(
- onTap: () async {
- await CacheManage().clearCacheAll(context);
- getCacheSize();
+ onTap: () {
+ showConfirmDialog(
+ context: context,
+ title: '提示',
+ content: '该操作将清除图片及网络请求缓存数据,确认清除?',
+ onConfirm: () async {
+ SmartDialog.showLoading(msg: '正在清除...');
+ try {
+ await CacheManage.clearLibraryCache();
+ SmartDialog.showToast('清除成功');
+ } catch (err) {
+ SmartDialog.showToast(err.toString());
+ } finally {
+ SmartDialog.dismiss();
+ }
+ getCacheSize();
+ },
+ );
},
leading: const Icon(Icons.delete_outline),
title: const Text('清除缓存'),
subtitle: Obx(
() => Text(
- '图片及网络缓存 ${_aboutController.cacheSize.value}',
+ '图片及网络缓存 ${cacheSize.value}',
style: subTitleStyle,
),
),
@@ -254,14 +240,6 @@ Commit Hash: ${BuildConfig.commitHash}''',
Get.back();
String res = jsonEncode(Accounts.account.toMap());
Utils.copyText(res);
- // if (context.mounted) {
- // showDialog(
- // context: context,
- // builder: (context) => AlertDialog(
- // content: SelectableText('$res'),
- // ),
- // );
- // }
},
),
ListTile(
@@ -328,78 +306,79 @@ Commit Hash: ${BuildConfig.commitHash}''',
},
),
ListTile(
- title: const Text('导入/导出设置'),
- dense: false,
- leading: const Icon(Icons.import_export_outlined),
- onTap: () {
- showDialog(
- context: context,
- builder: (context) {
- return SimpleDialog(
- clipBehavior: Clip.hardEdge,
- title: const Text('导入/导出设置'),
- children: [
- ListTile(
- title: const Text('导出设置至剪贴板'),
- onTap: () async {
- Get.back();
- String data = await GStorage.exportAllSettings();
- Utils.copyText(data);
- },
- ),
- ListTile(
- title: const Text('从剪贴板导入设置'),
- onTap: () async {
- Get.back();
- ClipboardData? data =
- await Clipboard.getData('text/plain');
- if (data == null ||
- data.text == null ||
- data.text!.isEmpty) {
- SmartDialog.showToast('剪贴板无数据');
- return;
- }
- if (!context.mounted) return;
- await showDialog(
- context: context,
- builder: (context) {
- return AlertDialog(
- title: const Text('是否导入如下设置?'),
- content: SingleChildScrollView(
- child: Text(data.text!),
+ title: const Text('导入/导出设置'),
+ dense: false,
+ leading: const Icon(Icons.import_export_outlined),
+ onTap: () {
+ showDialog(
+ context: context,
+ builder: (context) {
+ return SimpleDialog(
+ clipBehavior: Clip.hardEdge,
+ title: const Text('导入/导出设置'),
+ children: [
+ ListTile(
+ title: const Text('导出设置至剪贴板'),
+ onTap: () async {
+ Get.back();
+ String data = await GStorage.exportAllSettings();
+ Utils.copyText(data);
+ },
+ ),
+ ListTile(
+ title: const Text('从剪贴板导入设置'),
+ onTap: () async {
+ Get.back();
+ ClipboardData? data =
+ await Clipboard.getData('text/plain');
+ if (data == null ||
+ data.text == null ||
+ data.text!.isEmpty) {
+ SmartDialog.showToast('剪贴板无数据');
+ return;
+ }
+ if (!context.mounted) return;
+ showDialog(
+ context: context,
+ builder: (context) {
+ return AlertDialog(
+ title: const Text('是否导入如下设置?'),
+ content: SingleChildScrollView(
+ child: Text(data.text!),
+ ),
+ actions: [
+ TextButton(
+ onPressed: Get.back,
+ child: Text(
+ '取消',
+ style: TextStyle(color: outline),
+ ),
),
- actions: [
- TextButton(
- onPressed: Get.back,
- child: Text(
- '取消',
- style: TextStyle(color: outline),
- ),
- ),
- TextButton(
- onPressed: () async {
- Get.back();
- try {
- await GStorage.importAllSettings(
- data.text!);
- SmartDialog.showToast('导入成功');
- } catch (e) {
- SmartDialog.showToast('导入失败:$e');
- }
- },
- child: const Text('确定'),
- ),
- ],
- );
- },
- );
- },
- ),
- ],
- );
- },
- );
- }),
+ TextButton(
+ onPressed: () async {
+ Get.back();
+ try {
+ await GStorage.importAllSettings(
+ data.text!);
+ SmartDialog.showToast('导入成功');
+ } catch (e) {
+ SmartDialog.showToast('导入失败:$e');
+ }
+ },
+ child: const Text('确定'),
+ ),
+ ],
+ );
+ },
+ );
+ },
+ ),
+ ],
+ );
+ },
+ );
+ },
+ ),
ListTile(
title: const Text('重置所有设置'),
leading: const Icon(Icons.settings_backup_restore_outlined),
@@ -449,32 +428,9 @@ Commit Hash: ${BuildConfig.commitHash}''',
);
},
),
- SizedBox(height: MediaQuery.paddingOf(context).bottom + 80),
+ const SizedBox(height: 80),
],
),
);
}
}
-
-class AboutController extends GetxController {
- RxString currentVersion = ''.obs;
- RxString remoteVersion = ''.obs;
- LatestDataModel? remoteAppInfo;
- RxBool isUpdate = true.obs;
- RxBool isLoading = true.obs;
- LatestDataModel? data;
- RxString cacheSize = ''.obs;
-
- @override
- void onInit() {
- super.onInit();
- getCurrentApp();
- }
-
- // 获取当前版本
- Future getCurrentApp() async {
- var currentInfo = await PackageInfo.fromPlatform();
- String buildNumber = currentInfo.buildNumber;
- currentVersion.value = "${currentInfo.version}+$buildNumber";
- }
-}
diff --git a/lib/pages/bangumi/introduction/controller.dart b/lib/pages/bangumi/introduction/controller.dart
index be172827b..3f2e98a74 100644
--- a/lib/pages/bangumi/introduction/controller.dart
+++ b/lib/pages/bangumi/introduction/controller.dart
@@ -103,7 +103,6 @@ class BangumiIntroController
var result = await UserHttp.videoTags(bvid: bvid);
if (result['status']) {
videoTags = result['data'];
- // debugPrint('tags: ${result['data']}');
}
}
@@ -562,10 +561,6 @@ class BangumiIntroController
scriptContent['props']['pageProps']['followState']['isFollowed'];
followStatus.value =
scriptContent['props']['pageProps']['followState']['followStatus'];
- // int progress = scriptContent['props']['pageProps']['dehydratedState']
- // ['queries'][0]['state']['data']['result']
- // ['play_view_business_info']['user_status']['watch_progress']
- // ['current_watch_progress'];
}
} catch (_) {}
}
diff --git a/lib/pages/bangumi/introduction/view.dart b/lib/pages/bangumi/introduction/view.dart
index 26251ecfa..05e14aaaf 100644
--- a/lib/pages/bangumi/introduction/view.dart
+++ b/lib/pages/bangumi/introduction/view.dart
@@ -394,16 +394,6 @@ class _BangumiInfoState extends State {
],
),
const SizedBox(height: 6),
- // 点赞收藏转发 布局样式1
- // SingleChildScrollView(
- // padding: const EdgeInsets.only(top: 7, bottom: 7),
- // scrollDirection: Axis.horizontal,
- // child: actionRow(
- // context,
- // bangumiIntroController,
- // videoDetailCtr,
- // ),
- // ),
// 点赞收藏转发 布局样式2
actionGrid(context, bangumiIntroController),
// 番剧分p
diff --git a/lib/pages/bangumi/widgets/bangumi_panel.dart b/lib/pages/bangumi/widgets/bangumi_panel.dart
index 3d497db53..863abec71 100644
--- a/lib/pages/bangumi/widgets/bangumi_panel.dart
+++ b/lib/pages/bangumi/widgets/bangumi_panel.dart
@@ -68,24 +68,8 @@ class _BangumiPanelState extends State {
super.dispose();
}
- // void changeFucCall(item, i) async {
- // if (item.badge != null && item.badge == '会员' && vipStatus != 1) {
- // SmartDialog.showToast('需要大会员');
- // return;
- // }
- // await widget.changeFuc!(
- // item.bvid,
- // item.cid,
- // item.aid,
- // );
- // currentIndex = i;
- // setState(() {});
- // scrollToIndex();
- // }
-
void scrollToIndex() {
WidgetsBinding.instance.addPostFrameCallback((_) {
- // 在回调函数中获取更新后的状态
listViewScrollCtr.animateTo(
(currentIndex * 150.0).clamp(listViewScrollCtr.position.minScrollExtent,
listViewScrollCtr.position.maxScrollExtent),
@@ -148,11 +132,12 @@ class _BangumiPanelState extends State {
scrollDirection: Axis.horizontal,
itemCount: widget.pages.length,
itemExtent: 150,
- itemBuilder: (BuildContext context, int i) {
+ itemBuilder: (BuildContext context, int index) {
+ final item = widget.pages[index];
return Container(
width: 150,
margin: EdgeInsets.only(
- right: i == widget.pages.length - 1 ? 0 : 10,
+ right: index == widget.pages.length - 1 ? 0 : 10,
),
child: Material(
color: Theme.of(context).colorScheme.onInverseSurface,
@@ -160,24 +145,19 @@ class _BangumiPanelState extends State {
clipBehavior: Clip.hardEdge,
child: InkWell(
onTap: () {
- if (widget.pages[i].badge != null &&
- widget.pages[i].badge == '会员' &&
+ if (item.badge != null &&
+ item.badge == '会员' &&
vipStatus != 1) {
SmartDialog.showToast('需要大会员');
- // return;
}
widget.changeFuc(
- widget.pages[i].epId,
- widget.pages[i].bvid,
- widget.pages[i].cid,
- widget.pages[i].aid,
- widget.pages[i].cover,
+ item.epId,
+ item.bvid,
+ item.cid,
+ item.aid,
+ item.cover,
);
- // currentIndex = i;
- // setState(() {});
- // scrollToIndex();
},
- //changeFucCall(widget.pages[i], i),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 8, horizontal: 10),
@@ -186,7 +166,7 @@ class _BangumiPanelState extends State {
children: [
Row(
children: [
- if (i == currentIndex) ...[
+ if (index == currentIndex) ...[
Image.asset(
'assets/images/live.png',
color: Theme.of(context).colorScheme.primary,
@@ -197,32 +177,32 @@ class _BangumiPanelState extends State {
],
Expanded(
child: Text(
- widget.pages[i].title ?? '第${i + 1}话',
- maxLines: (widget.pages[i].longTitle != null &&
- widget.pages[i].longTitle != '')
+ item.title ?? '第${index + 1}话',
+ maxLines: (item.longTitle != null &&
+ item.longTitle != '')
? 1
: 2,
style: TextStyle(
fontSize: 13,
- color: i == currentIndex
+ color: index == currentIndex
? Theme.of(context).colorScheme.primary
: Theme.of(context)
.colorScheme
.onSurface),
)),
const SizedBox(width: 2),
- if (widget.pages[i].badge != null) ...[
+ if (item.badge != null) ...[
const Spacer(),
- if (widget.pages[i].badge == '会员') ...[
+ if (item.badge == '会员') ...[
Image.asset(
'assets/images/big-vip.png',
height: 16,
semanticLabel: "大会员",
),
],
- if (widget.pages[i].badge != '会员') ...[
+ if (item.badge != '会员') ...[
Text(
- widget.pages[i].badge!,
+ item.badge!,
style: TextStyle(
fontSize: 11,
color:
@@ -233,15 +213,15 @@ class _BangumiPanelState extends State {
]
],
),
- if (widget.pages[i].longTitle != null &&
- widget.pages[i].longTitle != '') ...[
+ if (item.longTitle != null &&
+ item.longTitle != '') ...[
const SizedBox(height: 3),
Text(
- widget.pages[i].longTitle!,
+ item.longTitle!,
maxLines: 1,
style: TextStyle(
fontSize: 13,
- color: i == currentIndex
+ color: index == currentIndex
? Theme.of(context).colorScheme.primary
: Theme.of(context)
.colorScheme
diff --git a/lib/pages/danmaku_block/view.dart b/lib/pages/danmaku_block/view.dart
index 545da3fcf..27a88d607 100644
--- a/lib/pages/danmaku_block/view.dart
+++ b/lib/pages/danmaku_block/view.dart
@@ -70,7 +70,6 @@ class _DanmakuBlockPageState extends State {
TextField(
controller: textController,
autofocus: true,
- //decoration: InputDecoration(hintText: hintText),
)
]),
actions: [
diff --git a/lib/pages/dynamics/controller.dart b/lib/pages/dynamics/controller.dart
index 12dc339cf..5d89c16bc 100644
--- a/lib/pages/dynamics/controller.dart
+++ b/lib/pages/dynamics/controller.dart
@@ -70,7 +70,6 @@ class DynamicsController extends GetxController
Future queryFollowing2() async {
if (upData.value.upList != null &&
upData.value.upList!.length >= allFollowedUpsTotal) {
- // SmartDialog.showToast('没有更多了');
return;
}
var res = await FollowHttp.followings(
@@ -187,7 +186,6 @@ class DynamicsController extends GetxController
await controller.onRefresh();
}
- // 返回顶部并刷新
@override
void animateToTop() async {
controller.animateToTop();
diff --git a/lib/pages/dynamics/detail/view.dart b/lib/pages/dynamics/detail/view.dart
index 5a8d18320..839f63e85 100644
--- a/lib/pages/dynamics/detail/view.dart
+++ b/lib/pages/dynamics/detail/view.dart
@@ -31,7 +31,6 @@ import '../../../utils/grid.dart';
import '../widgets/dynamic_panel.dart';
class DynamicDetailPage extends StatefulWidget {
- // const DynamicDetailPage({super.key});
const DynamicDetailPage({super.key});
@override
@@ -43,7 +42,6 @@ class _DynamicDetailPageState extends State
late DynamicDetailController _dynamicDetailController;
AnimationController? _fabAnimationCtr;
final RxBool _visibleTitle = false.obs;
- // String? action;
// 回复类型
late int replyType;
bool _isFabVisible = true;
@@ -124,8 +122,6 @@ class _DynamicDetailPageState extends State
Map args = Get.arguments;
// 楼层
int floor = args['floor'];
- // 从action栏点击进入
- // action = args.containsKey('action') ? args['action'] : null;
// 评论类型
int commentType = args['item'].basic!['comment_type'] ?? 11;
replyType = (commentType == 0) ? 11 : commentType;
diff --git a/lib/pages/dynamics/tab/view.dart b/lib/pages/dynamics/tab/view.dart
index 629785a1a..402a66489 100644
--- a/lib/pages/dynamics/tab/view.dart
+++ b/lib/pages/dynamics/tab/view.dart
@@ -144,10 +144,7 @@ class _DynamicsTabPageState
sliver: dynamicsWaterfallFlow
? SliverWaterfallFlow.extent(
maxCrossAxisExtent: Grid.smallCardWidth * 2,
- //cacheExtent: 0.0,
crossAxisSpacing: StyleString.cardSpace / 2,
- // mainAxisSpacing: StyleString.cardSpace / 2,
-
lastChildLayoutTypeBuilder: (index) {
if (index == loadingState.response!.length - 1) {
controller.onLoadMore();
@@ -163,7 +160,6 @@ class _DynamicsTabPageState
DynamicPanel(
item: i,
onRemove: controller.onRemove,
- // onSetTop: controller.onSetTop,
),
] else ...[
for (var i in loadingState.response!)
@@ -172,7 +168,6 @@ class _DynamicsTabPageState
DynamicPanel(
item: i,
onRemove: controller.onRemove,
- // onSetTop: controller.onSetTop,
),
]
],
@@ -198,7 +193,6 @@ class _DynamicsTabPageState
return DynamicPanel(
item: item,
onRemove: controller.onRemove,
- // onSetTop: controller.onSetTop,
);
}
return const SizedBox.shrink();
diff --git a/lib/pages/dynamics/widgets/additional_panel.dart b/lib/pages/dynamics/widgets/additional_panel.dart
index 9c7147b8c..4a6d9d8c6 100644
--- a/lib/pages/dynamics/widgets/additional_panel.dart
+++ b/lib/pages/dynamics/widgets/additional_panel.dart
@@ -131,7 +131,6 @@ Widget addWidget(item, context, type, {floor = 1}) {
)
],
),
- // TextButton(onPressed: () {}, child: Text('123'))
),
),
)
@@ -140,60 +139,6 @@ Widget addWidget(item, context, type, {floor = 1}) {
case 'ADDITIONAL_TYPE_GOODS':
// 商品
return const SizedBox();
- // return Padding(
- // padding: const EdgeInsets.only(top: 6),
- // child: InkWell(
- // onTap: () {},
- // child: Container(
- // padding:
- // const EdgeInsets.only(left: 12, top: 8, right: 12, bottom: 8),
- // decoration: BoxDecoration(
- // color: bgColor,
- // borderRadius: const BorderRadius.all(Radius.circular(6)),
- // ),
- // child: Row(
- // children: [
- // NetworkImgLayer(
- // width: 75,
- // height: 75,
- // src: dynamicProperty[type].items.first.cover,
- // ),
- // const SizedBox(width: 10),
- // Expanded(
- // child: Column(
- // crossAxisAlignment: CrossAxisAlignment.start,
- // mainAxisAlignment: MainAxisAlignment.start,
- // children: [
- // Text(
- // dynamicProperty[type].items.first.name,
- // maxLines: 1,
- // overflow: TextOverflow.ellipsis,
- // ),
- // Text(
- // dynamicProperty[type].items.first.brief,
- // maxLines: 1,
- // style: TextStyle(
- // color: Theme.of(context).colorScheme.outline,
- // fontSize: Theme.of(context)
- // .textTheme
- // .labelMedium!
- // .fontSize,
- // ),
- // ),
- // const SizedBox(height: 2),
- // Text(
- // dynamicProperty[type].items.first.price,
- // style: TextStyle(
- // color: Theme.of(context).colorScheme.primary,
- // ),
- // ),
- // ],
- // ),
- // ),
- // ],
- // ),
- // ),
- // ),);
case 'ADDITIONAL_TYPE_MATCH':
return const SizedBox();
case 'ADDITIONAL_TYPE_COMMON':
diff --git a/lib/pages/dynamics/widgets/author_panel.dart b/lib/pages/dynamics/widgets/author_panel.dart
index 40699cf80..639fbf949 100644
--- a/lib/pages/dynamics/widgets/author_panel.dart
+++ b/lib/pages/dynamics/widgets/author_panel.dart
@@ -94,7 +94,6 @@ class AuthorPanel extends StatelessWidget {
children: [
Text(
item.modules.moduleAuthor.name,
- // semanticsLabel: "UP主:${item.modules.moduleAuthor.name}",
style: TextStyle(
color: item.modules.moduleAuthor!.vip != null &&
item.modules.moduleAuthor!.vip['status'] > 0 &&
@@ -157,20 +156,6 @@ class AuthorPanel extends StatelessWidget {
? Row(
mainAxisSize: MainAxisSize.min,
children: [
- // GestureDetector(
- // onTap:
- // item.modules.moduleAuthor.decorate['jump_url'] != null
- // ? () {
- // Get.toNamed(
- // '/webview',
- // parameters: {
- // 'url':
- // '${item.modules.moduleAuthor.decorate['jump_url']}'
- // },
- // );
- // }
- // : null,
- // child:
Stack(
clipBehavior: Clip.none,
alignment: Alignment.centerRight,
@@ -210,7 +195,6 @@ class AuthorPanel extends StatelessWidget {
),
],
),
- // ),
_moreWidget(context),
],
)
@@ -294,7 +278,6 @@ class AuthorPanel extends StatelessWidget {
}
},
minLeadingWidth: 0,
- // dense: true,
leading: const Icon(Icons.watch_later_outlined, size: 19),
title: Text(
'稍后再看',
diff --git a/lib/pages/dynamics/widgets/content_panel.dart b/lib/pages/dynamics/widgets/content_panel.dart
index ef123e4d5..e9a5ae950 100644
--- a/lib/pages/dynamics/widgets/content_panel.dart
+++ b/lib/pages/dynamics/widgets/content_panel.dart
@@ -66,7 +66,6 @@ Widget content(bool isSave, BuildContext context, item, source, callback) {
item.modules.moduleDynamic.major.opus.pics.isNotEmpty)
Text.rich(
picsNodes(),
- // semanticsLabel: '动态图片',
),
],
),
diff --git a/lib/pages/dynamics/widgets/dynamic_panel.dart b/lib/pages/dynamics/widgets/dynamic_panel.dart
index cf82019f1..84c457184 100644
--- a/lib/pages/dynamics/widgets/dynamic_panel.dart
+++ b/lib/pages/dynamics/widgets/dynamic_panel.dart
@@ -30,9 +30,6 @@ class DynamicPanel extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
- // padding: source == 'detail'
- // ? const EdgeInsets.only(bottom: 12)
- // : EdgeInsets.zero,
decoration: isSave ||
(source == 'detail' &&
Get.context!.orientation == Orientation.landscape)
@@ -47,11 +44,7 @@ class DynamicPanel extends StatelessWidget {
),
child: Material(
elevation: 0,
- // clipBehavior: Clip.hardEdge,
color: Colors.transparent,
- // shape: RoundedRectangleBorder(
- // borderRadius: BorderRadius.circular(5),
- // ),
child: InkWell(
onTap: source == 'detail' &&
[
diff --git a/lib/pages/dynamics/widgets/forward_panel.dart b/lib/pages/dynamics/widgets/forward_panel.dart
index 6756f88ae..89ad61651 100644
--- a/lib/pages/dynamics/widgets/forward_panel.dart
+++ b/lib/pages/dynamics/widgets/forward_panel.dart
@@ -106,22 +106,6 @@ Widget forWard(bool isSave, item, BuildContext context, source, callback,
],
),
const SizedBox(height: 2),
-
- /// fix #话题跟content重复
- // if (item.modules.moduleDynamic.topic != null) ...[
- // Padding(
- // padding: floor == 2
- // ? EdgeInsets.zero
- // : const EdgeInsets.only(left: 12, right: 12),
- // child: GestureDetector(
- // child: Text(
- // '#${item.modules.moduleDynamic.topic.name}',
- // style: authorStyle,
- // ),
- // ),
- // ),
- // ],
-
if (richNodes != null)
Text.rich(
richNodes,
@@ -140,10 +124,7 @@ Widget forWard(bool isSave, item, BuildContext context, source, callback,
if (hasPics) ...[
Text.rich(
picsNodes(item.modules.moduleDynamic.major.opus.pics, callback),
- // semanticsLabel: '动态图片',
),
- // if (item.modules.moduleDynamic.additional != null)
- // const SizedBox(height: 4),
],
const SizedBox(height: 4),
],
@@ -206,11 +187,6 @@ Widget forWard(bool isSave, item, BuildContext context, source, callback,
: const SizedBox.shrink(),
_ => const SizedBox.shrink(),
};
- // return Container(
- // padding:
- // const EdgeInsets.only(left: 10, top: 12, right: 10, bottom: 10),
- // color: Theme.of(context).dividerColor.withOpacity(0.08),
- // child: articlePanel(item, context, floor: floor));
// 转发
case 'DYNAMIC_TYPE_FORWARD':
return InkWell(
diff --git a/lib/pages/dynamics/widgets/rich_node_panel.dart b/lib/pages/dynamics/widgets/rich_node_panel.dart
index ef6acd2c8..607ff74fe 100644
--- a/lib/pages/dynamics/widgets/rich_node_panel.dart
+++ b/lib/pages/dynamics/widgets/rich_node_panel.dart
@@ -40,9 +40,6 @@ InlineSpan? richNode(item, BuildContext context) {
return null;
} else {
for (var i in richTextNodes) {
- /// fix 渲染专栏时内容会重复
- // if (item.modules.moduleDynamic.major.opus.title == null &&
- // i.type == 'RICH_TEXT_NODE_TYPE_TEXT') {
if (i.type == 'RICH_TEXT_NODE_TYPE_TEXT') {
spanChildren.add(
TextSpan(text: i.origText, style: const TextStyle(height: 1.65)));
@@ -289,121 +286,7 @@ InlineSpan? richNode(item, BuildContext context) {
}
}
- // if (contentType == 'major' &&
- // item.modules.moduleDynamic.major.opus.pics.isNotEmpty) {
- // // 图片可能跟其他widget重复渲染
- // List pics = item.modules.moduleDynamic.major.opus.pics;
- // int len = pics.length;
- // List picList = [];
-
- // if (len == 1) {
- // OpusPicsModel pictureItem = pics.first;
- // picList.add(pictureItem.url!);
- // spanChildren.add(const TextSpan(text: '\n'));
- // spanChildren.add(
- // WidgetSpan(
- // child: LayoutBuilder(
- // builder: (context, BoxConstraints box) {
- // return GestureDetector(
- // onTap: () {
- // showDialog(
- // useSafeArea: false,
- // context: context,
- // builder: (context) {
- // return ImagePreview(initialPage: 0, imgList: picList);
- // },
- // );
- // },
- // child: Padding(
- // padding: const EdgeInsets.only(top: 4),
- // child: NetworkImgLayer(
- // src: pictureItem.url,
- // width: box.maxWidth / 2,
- // height: box.maxWidth *
- // 0.5 *
- // (pictureItem.height != null &&
- // pictureItem.width != null
- // ? pictureItem.height! / pictureItem.width!
- // : 1),
- // ),
- // ),
- // );
- // },
- // ),
- // ),
- // );
- // }
- // if (len > 1) {
- // List list = [];
- // for (var i = 0; i < len; i++) {
- // picList.add(pics[i].url!);
- // list.add(
- // LayoutBuilder(
- // builder: (context, BoxConstraints box) {
- // return GestureDetector(
- // onTap: () {
- // showDialog(
- // useSafeArea: false,
- // context: context,
- // builder: (context) {
- // return ImagePreview(initialPage: i, imgList: picList);
- // },
- // );
- // },
- // child: NetworkImgLayer(
- // src: pics[i].url,
- // width: box.maxWidth,
- // height: box.maxWidth,
- // ),
- // );
- // },
- // ),
- // );
- // }
- // spanChildren.add(
- // WidgetSpan(
- // child: LayoutBuilder(
- // builder: (context, BoxConstraints box) {
- // double maxWidth = box.maxWidth;
- // double crossCount = len < 3 ? 2 : 3;
- // double height = maxWidth /
- // crossCount *
- // (len % crossCount == 0
- // ? len ~/ crossCount
- // : len ~/ crossCount + 1) +
- // 6;
- // return Container(
- // padding: const EdgeInsets.only(top: 6),
- // height: height,
- // child: GridView.count(
- // padding: EdgeInsets.zero,
- // physics: const NeverScrollableScrollPhysics(),
- // crossAxisCount: crossCount.toInt(),
- // mainAxisSpacing: 4.0,
- // crossAxisSpacing: 4.0,
- // childAspectRatio: 1,
- // children: list,
- // ),
- // );
- // },
- // ),
- // ),
- // );
- // }
- // spanChildren.add(
- // WidgetSpan(
- // child: NetworkImgLayer(
- // src: pics.first.url,
- // type: 'emote',
- // width: 100,
- // height: 200,
- // ),
- // ),
- // );
- // }
- return TextSpan(
- children: spanChildren,
- );
+ return TextSpan(children: spanChildren);
}
} catch (err) {
debugPrint('❌rich_node_panel err: $err');
diff --git a/lib/pages/dynamics/widgets/up_panel.dart b/lib/pages/dynamics/widgets/up_panel.dart
index 0d376f2dc..41b11396c 100644
--- a/lib/pages/dynamics/widgets/up_panel.dart
+++ b/lib/pages/dynamics/widgets/up_panel.dart
@@ -109,36 +109,14 @@ class _UpPanelState extends State {
feedBack();
if (data.type == 'up') {
widget.dynamicsController.currentMid = data.mid;
- // dynamicsController.mid.value = data.mid;
widget.dynamicsController
..upInfo.value = data
..onSelectUp(data.mid);
- // int liveLen = liveList.length;
- // int upLen = upList.length;
- // double itemWidth = contentWidth + itemPadding.horizontal;
- // double screenWidth = MediaQuery.sizeOf(context).width;
- // double moveDistance = 0.0;
- // if (itemWidth * (upList.length + liveList.length) <= screenWidth) {
- // } else if ((upLen - i - 0.5) * itemWidth > screenWidth / 2) {
- // moveDistance =
- // (i + liveLen + 0.5) * itemWidth + 46 - screenWidth / 2;
- // } else {
- // moveDistance = (upLen + liveLen) * itemWidth + 46 - screenWidth;
- // }
+
data.hasUpdate = false;
- // scrollController.animateTo(
- // moveDistance,
- // duration: const Duration(milliseconds: 500),
- // curve: Curves.easeInOut,
- // );
+
setState(() {});
} else if (data.type == 'live') {
- // LiveItemModel liveItem = LiveItemModel.fromJson({
- // 'title': data.title,
- // 'uname': data.uname,
- // 'face': data.face,
- // 'roomid': data.roomId,
- // });
Get.toNamed('/liveRoom?roomid=${data.roomId}');
}
},
@@ -224,29 +202,6 @@ class _UpPanelState extends State {
}
}
-// class _SliverHeaderDelegate extends SliverPersistentHeaderDelegate {
-// _SliverHeaderDelegate({required this.height, required this.child});
-
-// final double height;
-// final Widget child;
-
-// @override
-// Widget build(
-// BuildContext context, double shrinkOffset, bool overlapsContent) {
-// return child;
-// }
-
-// @override
-// double get maxExtent => height;
-
-// @override
-// double get minExtent => height;
-
-// @override
-// bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) =>
-// true;
-// }
-
class UpPanelSkeleton extends StatelessWidget {
const UpPanelSkeleton({super.key});
diff --git a/lib/pages/dynamics/widgets/video_panel.dart b/lib/pages/dynamics/widgets/video_panel.dart
index a68ccd963..56bbb040c 100644
--- a/lib/pages/dynamics/widgets/video_panel.dart
+++ b/lib/pages/dynamics/widgets/video_panel.dart
@@ -55,16 +55,12 @@ Widget videoSeasonWidget(source, item, context, type, {floor = 1}) {
double width = box.maxWidth;
return Stack(
children: [
- // Hero(
- // tag: content.bvid,
- // child:
NetworkImgLayer(
width: width,
height: width / StyleString.aspectRatio,
src: content.cover,
semanticsLabel: content.title,
),
- // ),
if (content?.badge?['text'] != null)
PBadge(
text: content.badge['text'],
@@ -161,22 +157,6 @@ Widget videoSeasonWidget(source, item, context, type, {floor = 1}) {
),
const SizedBox(height: 6),
],
- // const SizedBox(height: 4),
- /// fix #话题跟content重复
- // if (item.modules.moduleDynamic.topic != null) ...[
- // Padding(
- // padding: floor == 2
- // ? EdgeInsets.zero
- // : const EdgeInsets.only(left: 12, right: 12),
- // child: GestureDetector(
- // child: Text(
- // '#${item.modules.moduleDynamic.topic.name}',
- // style: authorStyle,
- // ),
- // ),
- // ),
- // const SizedBox(height: 6),
- // ],
if (floor == 2 && item.modules.moduleDynamic.desc != null) ...[
if (richNodes != null) Text.rich(richNodes),
const SizedBox(height: 6),
diff --git a/lib/pages/fav/video/fav_folder_sort_page.dart b/lib/pages/fav/video/fav_folder_sort_page.dart
index 1a996d7d5..26e88d93f 100644
--- a/lib/pages/fav/video/fav_folder_sort_page.dart
+++ b/lib/pages/fav/video/fav_folder_sort_page.dart
@@ -121,15 +121,18 @@ class _FavFolderSortPageState extends State {
(index) {
final item = sortList[index];
final key = item.id.toString();
- return FavItem(
+ return SizedBox(
key: Key(key),
- heroTag: key,
- favFolderItem: item,
- onLongPress: index == 0
- ? () {
- SmartDialog.showToast('默认收藏夹不支持排序');
- }
- : null,
+ height: 98,
+ child: FavItem(
+ heroTag: key,
+ favFolderItem: item,
+ onLongPress: index == 0
+ ? () {
+ SmartDialog.showToast('默认收藏夹不支持排序');
+ }
+ : null,
+ ),
);
},
),
diff --git a/lib/pages/fav_detail/controller.dart b/lib/pages/fav_detail/controller.dart
index 3447468f4..33668b1d5 100644
--- a/lib/pages/fav_detail/controller.dart
+++ b/lib/pages/fav_detail/controller.dart
@@ -24,7 +24,6 @@ class FavDetailController
@override
void onInit() {
- // item = Get.arguments;
if (Get.parameters.keys.isNotEmpty) {
mediaId = int.parse(Get.parameters['mediaId']!);
heroTag = Get.parameters['heroTag']!;
diff --git a/lib/pages/fav_detail/fav_sort_page.dart b/lib/pages/fav_detail/fav_sort_page.dart
index 7d728efd5..feaa9e6cd 100644
--- a/lib/pages/fav_detail/fav_sort_page.dart
+++ b/lib/pages/fav_detail/fav_sort_page.dart
@@ -1,4 +1,3 @@
-import 'package:PiliPlus/build_config.dart';
import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/http/user.dart';
import 'package:PiliPlus/models/user/fav_detail.dart';
@@ -126,20 +125,13 @@ class _FavSortPageState extends State {
),
children: sortList
.map(
- (item) => Stack(
+ (item) => SizedBox(
key: Key(item.id.toString()),
- children: [
- FavVideoCardH(
- isSort: true,
- videoItem: item,
- ),
- if (BuildConfig.isDebug)
- Positioned(
- top: 35,
- right: 10,
- child: Text(item.id.toString()),
- )
- ],
+ height: 98,
+ child: FavVideoCardH(
+ isSort: true,
+ videoItem: item,
+ ),
),
)
.toList(),
diff --git a/lib/pages/follow/view.dart b/lib/pages/follow/view.dart
index 0883917b8..d94c7d404 100644
--- a/lib/pages/follow/view.dart
+++ b/lib/pages/follow/view.dart
@@ -6,6 +6,7 @@ import 'widgets/follow_list.dart';
import 'widgets/owner_follow_list.dart';
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
+// TODO: refactor
class FollowPage extends StatefulWidget {
const FollowPage({super.key});
diff --git a/lib/pages/follow/widgets/follow_list.dart b/lib/pages/follow/widgets/follow_list.dart
index 55b652a3e..f73dd6a8d 100644
--- a/lib/pages/follow/widgets/follow_list.dart
+++ b/lib/pages/follow/widgets/follow_list.dart
@@ -8,6 +8,7 @@ import 'package:PiliPlus/pages/follow/index.dart';
import 'follow_item.dart';
+// TODO: refactor
class FollowList extends StatefulWidget {
final FollowController ctr;
const FollowList({
diff --git a/lib/pages/follow/widgets/owner_follow_list.dart b/lib/pages/follow/widgets/owner_follow_list.dart
index 462048c66..cd33a1dc6 100644
--- a/lib/pages/follow/widgets/owner_follow_list.dart
+++ b/lib/pages/follow/widgets/owner_follow_list.dart
@@ -9,6 +9,7 @@ import 'package:PiliPlus/models/member/tags.dart';
import 'package:PiliPlus/pages/follow/index.dart';
import 'follow_item.dart';
+// TODO: refactor
class OwnerFollowList extends StatefulWidget {
final FollowController ctr;
final MemberTagItemModel? tagItem;
diff --git a/lib/pages/home/view.dart b/lib/pages/home/view.dart
index 0e40fa44a..5a74f6311 100644
--- a/lib/pages/home/view.dart
+++ b/lib/pages/home/view.dart
@@ -30,6 +30,7 @@ class _HomePageState extends State
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
+ resizeToAvoidBottomInset: false,
appBar: AppBar(toolbarHeight: 0),
body: Column(
children: [
diff --git a/lib/pages/hot/controller.dart b/lib/pages/hot/controller.dart
index f054616da..4b5c62a9d 100644
--- a/lib/pages/hot/controller.dart
+++ b/lib/pages/hot/controller.dart
@@ -7,8 +7,6 @@ import 'package:get/get.dart';
class HotController
extends CommonListController, HotVideoItemModel> {
- // int idx = 0;
-
late RxBool showHotRcmd = GStorage.showHotRcmd.obs;
@override
@@ -17,24 +15,10 @@ class HotController
queryData();
}
- // @override
- // Future onRefresh() {
- // idx = 0;
- // return super.onRefresh();
- // }
-
@override
Future>> customGetData() =>
VideoHttp.hotVideoList(
pn: currentPage,
ps: 20,
);
-
- // @override
- // void handleSuccess(List currentList, List dataList) {
- // idx = (dataList.last as Card?)?.smallCoverV5.base.idx.toInt() ?? 0;
- // }
-
- // @override
- // Future customGetData() => VideoHttp.hotVideoListGrpc(idx: idx);
}
diff --git a/lib/pages/html/view.dart b/lib/pages/html/view.dart
index 0baf5234c..26776a66f 100644
--- a/lib/pages/html/view.dart
+++ b/lib/pages/html/view.dart
@@ -127,16 +127,6 @@ class _HtmlRenderPageState extends State
}
void listener() {
- // 标题
- // if (scrollController.offset > 55 && !_visibleTitle) {
- // _visibleTitle = true;
- // titleStreamC.add(true);
- // } else if (scrollController.offset <= 55 && _visibleTitle) {
- // _visibleTitle = false;
- // titleStreamC.add(false);
- // }
-
- // fab按钮
final ScrollDirection direction1 =
_htmlRenderCtr.scrollController.positions.first.userScrollDirection;
late final ScrollDirection direction2 =
diff --git a/lib/pages/live_room/send_dm_panel.dart b/lib/pages/live_room/send_dm_panel.dart
index 137dacd8d..e324bf705 100644
--- a/lib/pages/live_room/send_dm_panel.dart
+++ b/lib/pages/live_room/send_dm_panel.dart
@@ -230,13 +230,6 @@ class _ReplyPageState extends CommonPublishPageState {
Get.back();
liveRoomController.savedDanmaku = null;
SmartDialog.showToast('发送成功');
- // liveRoomController.plPlayerController.danmakuController?.addDanmaku(
- // DanmakuContentItem(
- // emoticonUnique ?? message,
- // type: DanmakuItemType.scroll,
- // selfSend: true,
- // ),
- // );
} else {
SmartDialog.showToast(res['msg']);
}
diff --git a/lib/pages/live_room/view.dart b/lib/pages/live_room/view.dart
index 70c8e8b33..f1a2ff05a 100644
--- a/lib/pages/live_room/view.dart
+++ b/lib/pages/live_room/view.dart
@@ -126,7 +126,6 @@ class _LiveRoomPageState extends State
ScreenBrightness().resetApplicationScreenBrightness();
PlPlayerController.setPlayCallBack(null);
_liveRoomController.msgStream?.close();
- // floating?.dispose();
plPlayerController.removeStatusLister(playerListener);
plPlayerController.dispose();
super.dispose();
@@ -423,17 +422,14 @@ class _LiveRoomPageState extends State
),
),
),
- //刷新
IconButton(
tooltip: '刷新',
onPressed: () {
_futureBuilderFuture =
_liveRoomController.queryLiveInfo();
- // videoSourceInit();
},
icon: const Icon(Icons.refresh),
),
- //内置浏览器打开
IconButton(
tooltip: '浏览器打开',
onPressed: () {
diff --git a/lib/pages/live_room/widgets/bottom_control.dart b/lib/pages/live_room/widgets/bottom_control.dart
index 0c6626b24..5f57920ec 100644
--- a/lib/pages/live_room/widgets/bottom_control.dart
+++ b/lib/pages/live_room/widgets/bottom_control.dart
@@ -46,38 +46,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
),
onTap: onRefresh,
),
- // // ComBtn(
- // icon: const Icon(
- // Icons.subtitles_outlined,
- // size: 18,
- // color: Colors.white,
- // ),
- // fuc: () => Get.back(),
- // ),
const Spacer(),
- // ComBtn(
- // icon: const Icon(
- // Icons.hd_outlined,
- // size: 18,
- // color: Colors.white,
- // ),
- // fuc: () => {},
- // ),
- // const SizedBox(width: 4),
- // Obx(
- // () => ComBtn(
- // icon: Icon(
- // widget.liveRoomCtr!.volumeOff.value
- // ? Icons.volume_off_outlined
- // : Icons.volume_up_outlined,
- // size: 18,
- // color: Colors.white,
- // ),
- // fuc: () => {},
- // ),
- // ),
- // const SizedBox(width: 4),
-
Obx(
() => IconButton(
onPressed: () {
@@ -175,21 +144,3 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
);
}
}
-
-// class MSliderTrackShape extends RoundedRectSliderTrackShape {
-// @override
-// Rect getPreferredRect({
-// required RenderBox parentBox,
-// Offset offset = Offset.zero,
-// SliderThemeData? sliderTheme,
-// bool isEnabled = false,
-// bool isDiscrete = false,
-// }) {
-// const double trackHeight = 3;
-// final double trackLeft = offset.dx;
-// final double trackTop =
-// offset.dy + (parentBox.size.height - trackHeight) / 2 + 4;
-// final double trackWidth = parentBox.size.width;
-// return Rect.fromLTWH(trackLeft, trackTop, trackWidth, trackHeight);
-// }
-// }
diff --git a/lib/pages/live_room/widgets/chat.dart b/lib/pages/live_room/widgets/chat.dart
index 9c426e43c..d31315778 100644
--- a/lib/pages/live_room/widgets/chat.dart
+++ b/lib/pages/live_room/widgets/chat.dart
@@ -65,7 +65,6 @@ class LiveRoomChat extends StatelessWidget {
);
} catch (err) {
debugPrint(err.toString());
- // SmartDialog.showToast(err.toString());
}
},
),
diff --git a/lib/pages/login/controller.dart b/lib/pages/login/controller.dart
index e86265a48..68f207c92 100644
--- a/lib/pages/login/controller.dart
+++ b/lib/pages/login/controller.dart
@@ -628,11 +628,9 @@ class LoginPageController extends GetxController
break;
default:
SmartDialog.showToast(res['msg']);
- // login failed
break;
}
}
- // });
}
bool isGeeArgumentValid(String? geeGt, String? geeChallenge) {
@@ -644,11 +642,7 @@ class LoginPageController extends GetxController
Future setAccount(Map tokenInfo, List cookieInfo) async {
final account = LoginAccount(BiliCookieJar.fromList(cookieInfo),
tokenInfo['access_token'], tokenInfo['refresh_token']);
- await Future.wait([
- account.onChange(),
- AnonymousAccount().delete()
- // .then((_) => Request.buvidActive(AnonymousAccount()))
- ]);
+ await Future.wait([account.onChange(), AnonymousAccount().delete()]);
Accounts.accountMode.updateAll((_, a) => a == account ? account : a);
if (Accounts.main.isLogin) {
SmartDialog.showToast('登录成功');
diff --git a/lib/pages/login/view.dart b/lib/pages/login/view.dart
index 6819c5771..2659914d3 100644
--- a/lib/pages/login/view.dart
+++ b/lib/pages/login/view.dart
@@ -22,7 +22,6 @@ class LoginPage extends StatefulWidget {
class _LoginPageState extends State {
final LoginPageController _loginPageCtr = Get.put(LoginPageController());
- // late Future