mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-21 08:38:37 +00:00
@@ -34,7 +34,7 @@ class HistoryBaseController extends GetxController {
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
SmartDialog.showLoading(msg: '请求中');
|
||||
var res = await UserHttp.clearHistory(account: account);
|
||||
final res = await UserHttp.clearHistory(account: account);
|
||||
SmartDialog.dismiss();
|
||||
if (res.isSuccess) {
|
||||
SmartDialog.showToast('清空观看历史');
|
||||
@@ -71,7 +71,7 @@ class HistoryBaseController extends GetxController {
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
SmartDialog.showLoading(msg: '请求中');
|
||||
var res = await UserHttp.pauseHistory(
|
||||
final res = await UserHttp.pauseHistory(
|
||||
pauseStatus,
|
||||
account: account,
|
||||
);
|
||||
|
||||
@@ -78,7 +78,7 @@ class HistoryController
|
||||
|
||||
// 观看历史暂停状态
|
||||
Future<void> historyStatus() async {
|
||||
var res = await UserHttp.historyStatus(account: account);
|
||||
final res = await UserHttp.historyStatus(account: account);
|
||||
if (res case Success(:final response)) {
|
||||
baseCtr.pauseStatus.value = response;
|
||||
GStorage.localCache.put(LocalCacheKey.historyPause, response);
|
||||
|
||||
@@ -217,7 +217,7 @@ class _HistoryPageState extends State<HistoryPage>
|
||||
Widget _buildBody(LoadingState<List<HistoryItemModel>?> loadingState) {
|
||||
return switch (loadingState) {
|
||||
Loading() => gridSkeleton,
|
||||
Success(:var response) =>
|
||||
Success(:final response) =>
|
||||
response != null && response.isNotEmpty
|
||||
? SliverGrid.builder(
|
||||
gridDelegate: gridDelegate,
|
||||
@@ -236,7 +236,7 @@ class _HistoryPageState extends State<HistoryPage>
|
||||
itemCount: response.length,
|
||||
)
|
||||
: HttpError(onReload: _historyController.onReload),
|
||||
Error(:var errMsg) => HttpError(
|
||||
Error(:final errMsg) => HttpError(
|
||||
errMsg: errMsg,
|
||||
onReload: _historyController.onReload,
|
||||
),
|
||||
|
||||
@@ -220,7 +220,7 @@ class HistoryItem extends StatelessWidget {
|
||||
business?.contains('article') != true)
|
||||
PopupMenuItem<String>(
|
||||
onTap: () async {
|
||||
var res = await UserHttp.toViewLater(
|
||||
final res = await UserHttp.toViewLater(
|
||||
bvid: item.history.bvid,
|
||||
);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
|
||||
Reference in New Issue
Block a user