mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: failed to remove when showing multi popup dialogs
This commit is contained in:
@@ -13,7 +13,7 @@ class RcmdController extends GetxController {
|
||||
int _currentPage = 0;
|
||||
// RxList<RecVideoItemAppModel> appVideoList = <RecVideoItemAppModel>[].obs;
|
||||
// RxList<RecVideoItemModel> webVideoList = <RecVideoItemModel>[].obs;
|
||||
OverlayEntry? popupDialog;
|
||||
List<OverlayEntry?> popupDialog = <OverlayEntry?>[];
|
||||
Box setting = GStorage.setting;
|
||||
RxInt crossAxisCount = 2.obs;
|
||||
late bool enableSaveLastData;
|
||||
|
||||
@@ -128,12 +128,19 @@ class _RcmdPageState extends State<RcmdPage>
|
||||
);
|
||||
}
|
||||
|
||||
void _removePopupDialog() {
|
||||
_rcmdController.popupDialog.last?.remove();
|
||||
_rcmdController.popupDialog.removeLast();
|
||||
}
|
||||
|
||||
OverlayEntry _createPopupDialog(videoItem) {
|
||||
return OverlayEntry(
|
||||
builder: (context) => AnimatedDialog(
|
||||
closeFn: _rcmdController.popupDialog?.remove,
|
||||
closeFn: _removePopupDialog,
|
||||
child: OverlayPop(
|
||||
videoItem: videoItem, closeFn: _rcmdController.popupDialog?.remove),
|
||||
videoItem: videoItem,
|
||||
closeFn: _removePopupDialog,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -156,13 +163,12 @@ class _RcmdPageState extends State<RcmdPage>
|
||||
? VideoCardV(
|
||||
videoItem: videoList[index],
|
||||
longPress: () {
|
||||
_rcmdController.popupDialog =
|
||||
_createPopupDialog(videoList[index]);
|
||||
Overlay.of(context).insert(_rcmdController.popupDialog!);
|
||||
},
|
||||
longPressEnd: () {
|
||||
_rcmdController.popupDialog?.remove();
|
||||
_rcmdController.popupDialog
|
||||
.add(_createPopupDialog(videoList[index]));
|
||||
Overlay.of(context)
|
||||
.insert(_rcmdController.popupDialog.last!);
|
||||
},
|
||||
longPressEnd: _removePopupDialog,
|
||||
)
|
||||
: const VideoCardVSkeleton();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user