mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: listener
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -105,6 +105,10 @@ class _ListSheetContentState extends State<ListSheetContent>
|
||||
.indexWhere((e) => e.cid == widget.currentCid)
|
||||
: episodes.indexWhere((e) => e.cid == widget.currentCid));
|
||||
|
||||
void listener() {
|
||||
_indexStream?.add(_ctr?.index);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -114,9 +118,7 @@ class _ListSheetContentState extends State<ListSheetContent>
|
||||
vsync: this,
|
||||
length: widget.season.sections.length,
|
||||
initialIndex: _index,
|
||||
)..addListener(() {
|
||||
_indexStream?.add(_ctr?.index);
|
||||
});
|
||||
)..addListener(listener);
|
||||
}
|
||||
itemScrollController = _isList
|
||||
? List.generate(
|
||||
@@ -148,7 +150,7 @@ class _ListSheetContentState extends State<ListSheetContent>
|
||||
_favStream = null;
|
||||
_indexStream?.close();
|
||||
_indexStream = null;
|
||||
_ctr?.removeListener(() {});
|
||||
_ctr?.removeListener(listener);
|
||||
_ctr?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user