mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: pages
Closes #644 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -19,8 +19,7 @@ class HomeController extends GetxController
|
||||
RxBool isLogin = false.obs;
|
||||
RxString userFace = ''.obs;
|
||||
dynamic userInfo;
|
||||
late final StreamController<bool> searchBarStream =
|
||||
StreamController<bool>.broadcast();
|
||||
StreamController<bool>? searchBarStream;
|
||||
late bool hideSearchBar;
|
||||
late List defaultTabs;
|
||||
late List<String> tabbarSort;
|
||||
@@ -51,6 +50,9 @@ class HomeController extends GetxController
|
||||
userFace.value = userInfo != null ? userInfo.face : '';
|
||||
hideSearchBar =
|
||||
GStorage.setting.get(SettingBoxKey.hideSearchBar, defaultValue: true);
|
||||
if (hideSearchBar) {
|
||||
searchBarStream = StreamController<bool>.broadcast();
|
||||
}
|
||||
enableSearchWord = GStorage.setting
|
||||
.get(SettingBoxKey.enableSearchWord, defaultValue: true);
|
||||
if (enableSearchWord) {
|
||||
@@ -117,7 +119,7 @@ class HomeController extends GetxController
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
searchBarStream.close();
|
||||
searchBarStream?.close();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,9 +155,9 @@ class _HomePageState extends State<HomePage>
|
||||
return StreamBuilder(
|
||||
stream: _homeController.hideSearchBar
|
||||
? _mainController.navSearchStreamDebounce
|
||||
? _homeController.searchBarStream.stream
|
||||
? _homeController.searchBarStream?.stream
|
||||
.throttle(const Duration(milliseconds: 500))
|
||||
: _homeController.searchBarStream.stream
|
||||
: _homeController.searchBarStream?.stream
|
||||
: null,
|
||||
initialData: true,
|
||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||
|
||||
Reference in New Issue
Block a user