mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: del history
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -296,6 +296,8 @@ class _HistoryPageState extends State<HistoryPage>
|
|||||||
videoItem: loadingState.response[index],
|
videoItem: loadingState.response[index],
|
||||||
ctr: _historyController.baseCtr,
|
ctr: _historyController.baseCtr,
|
||||||
onChoose: () => _historyController.onSelect(index),
|
onChoose: () => _historyController.onSelect(index),
|
||||||
|
onDelete: (kid, business) =>
|
||||||
|
_historyController.delHistory(kid, business),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
childCount: loadingState.response.length,
|
childCount: loadingState.response.length,
|
||||||
|
|||||||
@@ -23,11 +23,14 @@ class HistoryItem extends StatelessWidget {
|
|||||||
final dynamic videoItem;
|
final dynamic videoItem;
|
||||||
final dynamic ctr;
|
final dynamic ctr;
|
||||||
final Function? onChoose;
|
final Function? onChoose;
|
||||||
|
final Function? onDelete;
|
||||||
|
|
||||||
const HistoryItem({
|
const HistoryItem({
|
||||||
super.key,
|
super.key,
|
||||||
required this.videoItem,
|
required this.videoItem,
|
||||||
this.ctr,
|
this.ctr,
|
||||||
this.onChoose,
|
this.onChoose,
|
||||||
|
this.onDelete,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -374,7 +377,10 @@ class HistoryItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
onTap: () => ctr!.delHistory(
|
onTap: () => ctr is HistoryBaseController
|
||||||
|
? onDelete?.call(
|
||||||
|
videoItem.kid, videoItem.history.business)
|
||||||
|
: ctr!.delHistory(
|
||||||
videoItem.kid, videoItem.history.business),
|
videoItem.kid, videoItem.history.business),
|
||||||
height: 35,
|
height: 35,
|
||||||
child: const Row(
|
child: const Row(
|
||||||
|
|||||||
Reference in New Issue
Block a user