diff --git a/lib/pages/history/view.dart b/lib/pages/history/view.dart index 1ed321a41..b85f7f120 100644 --- a/lib/pages/history/view.dart +++ b/lib/pages/history/view.dart @@ -296,6 +296,8 @@ class _HistoryPageState extends State videoItem: loadingState.response[index], ctr: _historyController.baseCtr, onChoose: () => _historyController.onSelect(index), + onDelete: (kid, business) => + _historyController.delHistory(kid, business), ); }, childCount: loadingState.response.length, diff --git a/lib/pages/history/widgets/item.dart b/lib/pages/history/widgets/item.dart index 918c6ee37..d7f771308 100644 --- a/lib/pages/history/widgets/item.dart +++ b/lib/pages/history/widgets/item.dart @@ -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( - 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: [