mod: lint

mod: tweaks

opt: publish page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-04 11:37:13 +08:00
parent 2cfad80214
commit caa58e9d7d
313 changed files with 2751 additions and 2789 deletions

View File

@@ -144,7 +144,7 @@ class BangumiIntroController
}
}
void coinVideo(int coin, [bool selectLike = false]) async {
Future<void> coinVideo(int coin, [bool selectLike = false]) async {
var res = await VideoHttp.coinVideo(
bvid: bvid,
multiply: coin,
@@ -383,7 +383,7 @@ class BangumiIntroController
}
// 选择文件夹
onChoose(bool checkValue, int index) {
void onChoose(bool checkValue, int index) {
feedBack();
List<FavFolderItemData> datalist = favFolderData.value.list!;
datalist[index].favState = checkValue ? 1 : 0;
@@ -608,7 +608,7 @@ class BangumiIntroController
}
// 收藏
showFavBottomSheet(BuildContext context, {type = 'tap'}) {
void showFavBottomSheet(BuildContext context, {type = 'tap'}) {
if (userInfo == null) {
SmartDialog.showToast('账号未登录');
return;

View File

@@ -78,7 +78,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
return Obx(() => _buildBody(bangumiIntroController.loadingState.value));
}
_buildBody(LoadingState loadingState) {
Widget _buildBody(LoadingState loadingState) {
return switch (loadingState) {
Loading() => BangumiInfo(
heroTag: widget.heroTag,
@@ -135,7 +135,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
late final BangumiInfoModel? bangumiItem;
int? cid;
bool isProcessing = false;
void handleState(Future Function() action) async {
Future<void> handleState(Future Function() action) async {
if (isProcessing.not) {
isProcessing = true;
await action();
@@ -171,7 +171,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
}
// 视频介绍
showIntroDetail() {
void showIntroDetail() {
feedBack();
widget.showIntroDetail();
}
@@ -275,10 +275,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
horizontal: 20,
vertical: 10,
),
visualDensity: const VisualDensity(
horizontal: -2,
vertical: -2,
),
visualDensity: VisualDensity.compact,
foregroundColor:
bangumiIntroController
.isFollowed.value

View File

@@ -142,7 +142,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
),
child: Material(
color: theme.colorScheme.onInverseSurface,
borderRadius: BorderRadius.circular(6),
borderRadius: const BorderRadius.all(Radius.circular(6)),
clipBehavior: Clip.hardEdge,
child: InkWell(
onTap: () {

View File

@@ -147,8 +147,9 @@ class VideoIntroController extends GetxController {
}
if (videoDetail.value.cid == data.cid) {
// keep reversed pages
data.pages = videoDetail.value.pages;
data.isPageReversed = videoDetail.value.isPageReversed;
data
..pages = videoDetail.value.pages
..isPageReversed = videoDetail.value.isPageReversed;
}
videoDetail.value = data;
videoItem['staff'] = data.staff;
@@ -315,7 +316,7 @@ class VideoIntroController extends GetxController {
SmartDialog.showToast(res['msg']);
}
void coinVideo(int coin, [bool selectLike = false]) async {
Future<void> coinVideo(int coin, [bool selectLike = false]) async {
if (videoDetail.value.stat?.coin == null) {
// not init
return;
@@ -546,7 +547,7 @@ class VideoIntroController extends GetxController {
}
// 选择文件夹
onChoose(bool checkValue, int index) {
void onChoose(bool checkValue, int index) {
feedBack();
List<FavFolderItemData> datalist = favFolderData.value.list!;
datalist[index].favState = checkValue ? 1 : 0;
@@ -595,6 +596,9 @@ class VideoIntroController extends GetxController {
followStatus: followStatus,
callback: (attribute) {
followStatus['attribute'] = attribute;
Future.delayed(const Duration(milliseconds: 500), () {
queryFollowStatus();
});
},
);
}
@@ -636,7 +640,7 @@ class VideoIntroController extends GetxController {
}
// 重新请求相关视频
if (videoDetailCtr.showRelatedVideo) {
if (videoDetailCtr.plPlayerController.showRelatedVideo) {
try {
Get.find<RelatedController>(tag: heroTag)
..bvid = bvid
@@ -779,7 +783,7 @@ class VideoIntroController extends GetxController {
if (episodes.isEmpty) {
if (playRepeat == PlayRepeat.autoPlayRelated &&
videoDetailCtr.showRelatedVideo) {
videoDetailCtr.plPlayerController.showRelatedVideo) {
return playRelated();
}
return false;
@@ -811,7 +815,7 @@ class VideoIntroController extends GetxController {
if (playRepeat == PlayRepeat.listCycle) {
nextIndex = 0;
} else if (playRepeat == PlayRepeat.autoPlayRelated &&
videoDetailCtr.showRelatedVideo) {
videoDetailCtr.plPlayerController.showRelatedVideo) {
return playRelated();
} else {
return false;
@@ -906,7 +910,7 @@ class VideoIntroController extends GetxController {
}
// 收藏
showFavBottomSheet(BuildContext context, {type = 'tap'}) {
void showFavBottomSheet(BuildContext context, {type = 'tap'}) {
if (userInfo == null) {
SmartDialog.showToast('账号未登录');
return;

View File

@@ -28,10 +28,10 @@ import 'package:PiliPlus/utils/storage.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'widgets/action_item.dart';
import 'widgets/action_row_item.dart';
import 'widgets/page.dart';
import 'widgets/season.dart';
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_item.dart';
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_row_item.dart';
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/page.dart';
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/season.dart';
class VideoIntroPanel extends StatefulWidget {
const VideoIntroPanel({
@@ -129,7 +129,7 @@ class _VideoInfoState extends State<VideoInfo> {
late final _horizontalMemberPage = GStorage.horizontalMemberPage;
Widget _buildVideoTitle(ThemeData theme, [bool isExpand = false]) =>
videoDetailCtr.enableSponsorBlock
videoDetailCtr.plPlayerController.enableSponsorBlock
? Obx(
() => Text.rich(
TextSpan(
@@ -144,7 +144,8 @@ class _VideoInfoState extends State<VideoInfo> {
),
decoration: BoxDecoration(
color: theme.colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(4),
borderRadius:
const BorderRadius.all(Radius.circular(4)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
@@ -169,8 +170,9 @@ class _VideoInfoState extends State<VideoInfo> {
),
Text(
videoDetailCtr.videoLabel.value,
textScaler: TextScaler.linear(1),
strutStyle: StrutStyle(leading: 0, height: 1),
textScaler: TextScaler.noScaling,
strutStyle:
const StrutStyle(leading: 0, height: 1),
style: TextStyle(
height: 1,
fontSize: 13,
@@ -181,7 +183,7 @@ class _VideoInfoState extends State<VideoInfo> {
),
),
),
TextSpan(text: ' '),
const TextSpan(text: ' '),
],
TextSpan(
text:
@@ -200,7 +202,7 @@ class _VideoInfoState extends State<VideoInfo> {
style: const TextStyle(fontSize: 16),
);
void handleState(Future Function() action) async {
Future<void> handleState(Future Function() action) async {
if (isProcessing.not) {
isProcessing = true;
await action();
@@ -233,7 +235,7 @@ class _VideoInfoState extends State<VideoInfo> {
}
// 视频介绍
showIntroDetail() {
void showIntroDetail() {
if (widget.loadingStatus) {
return;
}
@@ -242,7 +244,7 @@ class _VideoInfoState extends State<VideoInfo> {
}
// 用户主页
onPushMember() {
void onPushMember() {
feedBack();
int? mid = !widget.loadingStatus
? videoDetail.owner?.mid
@@ -403,7 +405,7 @@ class _VideoInfoState extends State<VideoInfo> {
Positioned(
right: -2,
bottom: -2,
child: Container(
child: DecoratedBox(
decoration: BoxDecoration(
shape: BoxShape.circle,
color:
@@ -652,7 +654,7 @@ class _VideoInfoState extends State<VideoInfo> {
color: theme.colorScheme.outline,
),
),
WidgetSpan(child: SizedBox(width: 2)),
const WidgetSpan(child: SizedBox(width: 2)),
TextSpan(
text:
'${videoIntroController.videoDetail.value.argueMsg}',
@@ -772,7 +774,8 @@ class _VideoInfoState extends State<VideoInfo> {
videoDetail.ugcSeason != null &&
(context.orientation != Orientation.landscape ||
(context.orientation == Orientation.landscape &&
videoDetailCtr.horizontalSeasonPanel.not)))
videoDetailCtr.plPlayerController
.horizontalSeasonPanel.not)))
Obx(
() => SeasonPanel(
key: ValueKey(videoIntroController.videoDetail.value),
@@ -787,7 +790,8 @@ class _VideoInfoState extends State<VideoInfo> {
videoDetail.pages!.length > 1 &&
(context.orientation != Orientation.landscape ||
(context.orientation == Orientation.landscape &&
videoDetailCtr.horizontalSeasonPanel.not))) ...[
videoDetailCtr.plPlayerController
.horizontalSeasonPanel.not))) ...[
Obx(
() => PagesPanel(
key: ValueKey(videoIntroController.videoDetail.value),

View File

@@ -138,7 +138,7 @@ class ActionItemState extends State<ActionItem>
(widget.selectStatus ? "" : "") +
widget.semanticsLabel,
child: InkWell(
borderRadius: BorderRadius.circular(6),
borderRadius: const BorderRadius.all(Radius.circular(6)),
onTap: _isThumbsUp
? null
: () {

View File

@@ -146,7 +146,7 @@ class _PagesPanelState extends State<PagesPanel> {
),
child: Material(
color: theme.colorScheme.onInverseSurface,
borderRadius: BorderRadius.circular(6),
borderRadius: const BorderRadius.all(Radius.circular(6)),
clipBehavior: Clip.hardEdge,
child: InkWell(
onTap: () {

View File

@@ -98,7 +98,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
),
child: Material(
color: theme.colorScheme.onInverseSurface,
borderRadius: BorderRadius.circular(6),
borderRadius: const BorderRadius.all(Radius.circular(6)),
clipBehavior: Clip.hardEdge,
child: InkWell(
onTap: widget.onTap == false