* opt: sized

* fix: self send

* feat: ctrl enter to send

* opt: checked

* opt: download notifier

* opt: Future.syncValue

* mod: account

* mod: loading state

* opt: DebounceStreamMixin

* opt: report

* opt: enum map

* opt: file handler

* opt: dyn color

* opt: Uint8List subview

* opt: FileExt

* opt: computeLuminance

* opt: isNullOrEmpty

* opt: Get context

* update [skip ci]

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>

* opt dynamicColor [skip ci]

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>

* fixes [skip ci]

* update

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>

* update

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>

---------

Signed-off-by: My-Responsitories <107370289+My-Responsitories@users.noreply.github.com>
Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
My-Responsitories
2025-12-17 17:01:10 +08:00
committed by GitHub
parent 02e0d34127
commit ce5e85e64b
87 changed files with 707 additions and 646 deletions

View File

@@ -8,9 +8,7 @@ class LaterBaseController extends GetxController {
RxBool enableMultiSelect = false.obs;
RxInt checkedCount = 0.obs;
RxMap<LaterViewType, int> counts = {
for (final item in LaterViewType.values) item: -1,
}.obs;
RxList<int> counts = List.filled(LaterViewType.values.length, -1).obs;
late double dx = 0;
late final RxBool isPlayAll = Pref.enablePlayAll.obs;

View File

@@ -84,7 +84,7 @@ class _LaterViewChildPageState extends State<LaterViewChildPage>
'sourceType': SourceType.watchLater,
'count': _laterController
.baseCtr
.counts[LaterViewType.all],
.counts[LaterViewType.all.index],
'favTitle': '稍后再看',
'mediaId': _laterController.mid,
'desc': _laterController.asc.value,

View File

@@ -11,7 +11,6 @@ import 'package:PiliPlus/pages/common/multi_select/base.dart';
import 'package:PiliPlus/pages/common/multi_select/multi_select_controller.dart';
import 'package:PiliPlus/pages/later/base_controller.dart';
import 'package:PiliPlus/utils/accounts.dart';
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
import 'package:PiliPlus/utils/extension/scroll_controller_ext.dart';
import 'package:PiliPlus/utils/page_utils.dart';
import 'package:flutter/material.dart';
@@ -120,13 +119,13 @@ class LaterController extends MultiSelectController<LaterData, LaterItemModel>
@override
List<LaterItemModel>? getDataList(response) {
baseCtr.counts[laterViewType] = response.count ?? 0;
baseCtr.counts[laterViewType.index] = response.count ?? 0;
return response.list;
}
@override
void checkIsEnd(int length) {
if (length >= baseCtr.counts[laterViewType]!) {
if (length >= baseCtr.counts[laterViewType.index]) {
isEnd = true;
}
}
@@ -144,7 +143,7 @@ class LaterController extends MultiSelectController<LaterData, LaterItemModel>
content: content,
onConfirm: () async {
var res = await UserHttp.toViewClear(cleanType);
if (res['status']) {
if (res.isSuccess) {
onReload();
final restTypes = List<LaterViewType>.from(LaterViewType.values)
..remove(laterViewType);
@@ -153,19 +152,20 @@ class LaterController extends MultiSelectController<LaterData, LaterItemModel>
Get.find<LaterController>(tag: item.type.toString()).onReload();
} catch (_) {}
}
SmartDialog.showToast('操作成功');
} else {
res.toast();
}
SmartDialog.showToast(res['msg']);
},
);
}
// 稍后再看播放全部
void toViewPlayAll() {
if (loadingState.value.isSuccess) {
List<LaterItemModel>? list = loadingState.value.data;
if (list.isNullOrEmpty) return;
if (loadingState.value case Success(:final response)) {
if (response == null || response.isEmpty) return;
for (LaterItemModel item in list!) {
for (LaterItemModel item in response) {
if (item.cid == null || item.pgcLabel?.isNotEmpty == true) {
continue;
} else {
@@ -176,7 +176,7 @@ class LaterController extends MultiSelectController<LaterData, LaterItemModel>
title: item.title,
extraArguments: {
'sourceType': SourceType.watchLater,
'count': baseCtr.counts[LaterViewType.all],
'count': baseCtr.counts[LaterViewType.all.index],
'favTitle': '稍后再看',
'mediaId': mid,
'desc': asc.value,
@@ -190,8 +190,7 @@ class LaterController extends MultiSelectController<LaterData, LaterItemModel>
@override
ValueChanged<int>? get updateCount =>
(count) => baseCtr.counts[laterViewType] =
baseCtr.counts[laterViewType]! - count;
(count) => baseCtr.counts[laterViewType.index] -= count;
@override
Future<void> onReload() {

View File

@@ -116,7 +116,7 @@ class _LaterPageState extends State<LaterPage>
// tabAlignment: TabAlignment.start,
controller: _tabController,
tabs: LaterViewType.values.map((item) {
final count = _baseCtr.counts[item];
final count = _baseCtr.counts[item.index];
return Tab(
text: '${item.title}${count != -1 ? '($count)' : ''}',
);
@@ -216,7 +216,7 @@ class _LaterPageState extends State<LaterPage>
'mediaId': mid,
'mid': mid,
'title': '稍后再看',
'count': _baseCtr.counts[LaterViewType.all],
'count': _baseCtr.counts[LaterViewType.all.index],
},
);
},

View File

@@ -162,7 +162,7 @@ class VideoCardHLater extends StatelessWidget {
Positioned.fill(
child: selectMask(
theme,
videoItem.checked == true,
videoItem.checked,
),
),
],