fix: del history

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-24 20:06:59 +08:00
parent 90c8aeb05d
commit d9a74c43dc
2 changed files with 10 additions and 2 deletions

View File

@@ -296,6 +296,8 @@ class _HistoryPageState extends State<HistoryPage>
videoItem: loadingState.response[index],
ctr: _historyController.baseCtr,
onChoose: () => _historyController.onSelect(index),
onDelete: (kid, business) =>
_historyController.delHistory(kid, business),
);
},
childCount: loadingState.response.length,

View File

@@ -23,11 +23,14 @@ class HistoryItem extends StatelessWidget {
final dynamic videoItem;
final dynamic ctr;
final Function? onChoose;
final Function? onDelete;
const HistoryItem({
super.key,
required this.videoItem,
this.ctr,
this.onChoose,
this.onDelete,
});
@override
@@ -374,8 +377,11 @@ class HistoryItem extends StatelessWidget {
),
),
PopupMenuItem<String>(
onTap: () => ctr!.delHistory(
videoItem.kid, videoItem.history.business),
onTap: () => ctr is HistoryBaseController
? onDelete?.call(
videoItem.kid, videoItem.history.business)
: ctr!.delHistory(
videoItem.kid, videoItem.history.business),
height: 35,
child: const Row(
children: [