mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: medialist page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -55,13 +55,24 @@ class _MediaListPanelState
|
||||
void initState() {
|
||||
super.initState();
|
||||
desc = widget.desc.obs;
|
||||
}
|
||||
|
||||
@override
|
||||
void init() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
int index =
|
||||
widget.mediaList.indexWhere((item) => item.bvid == widget.getBvId());
|
||||
if (index != -1 && index != 0) {
|
||||
try {
|
||||
_scrollController.jumpTo(index: index);
|
||||
} catch (_) {}
|
||||
if (mounted) {
|
||||
int index = widget.mediaList
|
||||
.indexWhere((item) => item.bvid == widget.getBvId());
|
||||
if (index > 0) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
try {
|
||||
_scrollController.jumpTo(index: index);
|
||||
} catch (_) {}
|
||||
});
|
||||
}
|
||||
setState(() {
|
||||
isInit = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user