mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-26 12:07:11 +08:00
fix: failed to remove when showing multi popup dialogs
This commit is contained in:
@@ -104,14 +104,13 @@ class _ZonePageState extends State<ZonePage>
|
||||
videoItem: _zoneController.videoList[index],
|
||||
showPubdate: true,
|
||||
longPress: () {
|
||||
_zoneController.popupDialog = _createPopupDialog(
|
||||
_zoneController.videoList[index]);
|
||||
_zoneController.popupDialog.add(
|
||||
_createPopupDialog(
|
||||
_zoneController.videoList[index]));
|
||||
Overlay.of(context)
|
||||
.insert(_zoneController.popupDialog!);
|
||||
},
|
||||
longPressEnd: () {
|
||||
_zoneController.popupDialog?.remove();
|
||||
.insert(_zoneController.popupDialog.last!);
|
||||
},
|
||||
longPressEnd: _removePopupDialog,
|
||||
);
|
||||
}, childCount: _zoneController.videoList.length),
|
||||
),
|
||||
@@ -154,12 +153,19 @@ class _ZonePageState extends State<ZonePage>
|
||||
);
|
||||
}
|
||||
|
||||
void _removePopupDialog() {
|
||||
_zoneController.popupDialog.last?.remove();
|
||||
_zoneController.popupDialog.removeLast();
|
||||
}
|
||||
|
||||
OverlayEntry _createPopupDialog(videoItem) {
|
||||
return OverlayEntry(
|
||||
builder: (context) => AnimatedDialog(
|
||||
closeFn: _zoneController.popupDialog?.remove,
|
||||
closeFn: _removePopupDialog,
|
||||
child: OverlayPop(
|
||||
videoItem: videoItem, closeFn: _zoneController.popupDialog?.remove),
|
||||
videoItem: videoItem,
|
||||
closeFn: _removePopupDialog,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user