refactor: related

This commit is contained in:
bggRGjQaUbCoE
2024-09-08 16:58:21 +08:00
parent 15c5755392
commit 2bcddc1097
8 changed files with 94 additions and 130 deletions

View File

@@ -102,15 +102,10 @@ class _HotPageState extends State<HotPage> with AutomaticKeepAliveClientMixin {
);
}
void _removePopupDialog() {
_hotController.popupDialog.last?.remove();
_hotController.popupDialog.removeLast();
}
OverlayEntry _createPopupDialog(videoItem) {
return OverlayEntry(
builder: (context) => AnimatedDialog(
closeFn: _removePopupDialog,
closeFn: _hotController.removePopupDialog,
videoItem: videoItem,
),
);
@@ -152,7 +147,7 @@ class _HotPageState extends State<HotPage> with AutomaticKeepAliveClientMixin {
.add(_createPopupDialog(loadingState.response[index]));
Overlay.of(context).insert(_hotController.popupDialog.last!);
},
longPressEnd: _removePopupDialog,
longPressEnd: _hotController.removePopupDialog,
);
},
childCount: loadingState.response.length,