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 LiveController extends GetxController {
|
||||
RxInt crossAxisCount = 2.obs;
|
||||
RxList<LiveItemModel> liveList = <LiveItemModel>[].obs;
|
||||
bool flag = false;
|
||||
OverlayEntry? popupDialog;
|
||||
List<OverlayEntry?> popupDialog = <OverlayEntry?>[];
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
|
||||
@@ -128,12 +128,19 @@ class _LivePageState extends State<LivePage>
|
||||
);
|
||||
}
|
||||
|
||||
void _removePopupDialog() {
|
||||
_liveController.popupDialog.last?.remove();
|
||||
_liveController.popupDialog.removeLast();
|
||||
}
|
||||
|
||||
OverlayEntry _createPopupDialog(liveItem) {
|
||||
return OverlayEntry(
|
||||
builder: (context) => AnimatedDialog(
|
||||
closeFn: _liveController.popupDialog?.remove,
|
||||
closeFn: _removePopupDialog,
|
||||
child: OverlayPop(
|
||||
videoItem: liveItem, closeFn: _liveController.popupDialog?.remove),
|
||||
videoItem: liveItem,
|
||||
closeFn: _removePopupDialog,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -153,13 +160,12 @@ class _LivePageState extends State<LivePage>
|
||||
? LiveCardV(
|
||||
liveItem: liveList[index],
|
||||
longPress: () {
|
||||
_liveController.popupDialog =
|
||||
_createPopupDialog(liveList[index]);
|
||||
Overlay.of(context).insert(_liveController.popupDialog!);
|
||||
},
|
||||
longPressEnd: () {
|
||||
_liveController.popupDialog?.remove();
|
||||
_liveController.popupDialog
|
||||
.add(_createPopupDialog(liveList[index]));
|
||||
Overlay.of(context)
|
||||
.insert(_liveController.popupDialog.last!);
|
||||
},
|
||||
longPressEnd: _removePopupDialog,
|
||||
)
|
||||
: const VideoCardVSkeleton();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user