feat: 稍后再看添加/清除已看

This commit is contained in:
guozhigq
2023-08-05 22:24:03 +08:00
parent 6b0adbc3e1
commit 1676f6f473
6 changed files with 107 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:pilipala/http/user.dart';
import 'package:pilipala/models/model_hot_video_item.dart';
@ -16,4 +17,34 @@ class LaterController extends GetxController {
}
return res;
}
Future toViewDel() async {
SmartDialog.show(
useSystem: true,
animationType: SmartAnimationType.centerFade_otherSlide,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('提示'),
content: const Text('即将删除所有已观看视频,此操作不可恢复。确定是否删除?'),
actions: [
TextButton(
onPressed: () => SmartDialog.dismiss(),
child: const Text('取消')),
TextButton(
onPressed: () async {
var res = await UserHttp.toViewDel();
if (res['status']) {
laterList.clear();
queryLaterList();
}
SmartDialog.dismiss();
SmartDialog.showToast(res['msg']);
},
child: const Text('确认删除'),
)
],
);
},
);
}
}