mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: try-catch dyn scroll action
related #155 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -48,19 +48,21 @@ class _DynamicsTabPageState extends State<DynamicsTabPage>
|
|||||||
tag: widget.dynamicsType,
|
tag: widget.dynamicsType,
|
||||||
);
|
);
|
||||||
_dynamicsTabController.scrollController.addListener(() {
|
_dynamicsTabController.scrollController.addListener(() {
|
||||||
StreamController<bool> mainStream =
|
try {
|
||||||
Get.find<MainController>().bottomBarStream;
|
StreamController<bool> mainStream =
|
||||||
StreamController<bool> searchBarStream =
|
Get.find<MainController>().bottomBarStream;
|
||||||
Get.find<HomeController>().searchBarStream;
|
StreamController<bool> searchBarStream =
|
||||||
final ScrollDirection direction =
|
Get.find<HomeController>().searchBarStream;
|
||||||
_dynamicsTabController.scrollController.position.userScrollDirection;
|
final ScrollDirection direction = _dynamicsTabController
|
||||||
if (direction == ScrollDirection.forward) {
|
.scrollController.position.userScrollDirection;
|
||||||
mainStream.add(true);
|
if (direction == ScrollDirection.forward) {
|
||||||
searchBarStream.add(true);
|
mainStream.add(true);
|
||||||
} else if (direction == ScrollDirection.reverse) {
|
searchBarStream.add(true);
|
||||||
mainStream.add(false);
|
} else if (direction == ScrollDirection.reverse) {
|
||||||
searchBarStream.add(false);
|
mainStream.add(false);
|
||||||
}
|
searchBarStream.add(false);
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
});
|
});
|
||||||
_listener = dynamicsController.mid.listen((mid) {
|
_listener = dynamicsController.mid.listen((mid) {
|
||||||
// debugPrint('midListen: $mid');
|
// debugPrint('midListen: $mid');
|
||||||
|
|||||||
Reference in New Issue
Block a user