Add configurable scroll threshold (#910)

* Add configurable scroll threshold

* update

---------

Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
Tong xuewen
2025-07-29 23:02:05 +08:00
committed by GitHub
parent cf403aaf78
commit 3eb9c5b8ba
8 changed files with 191 additions and 103 deletions

View File

@@ -10,7 +10,6 @@ import 'package:PiliPlus/utils/feed_back.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:stream_transform/stream_transform.dart';
class HomePage extends StatefulWidget {
const HomePage({super.key});
@@ -149,14 +148,11 @@ class _HomePageState extends State<HomePage>
}
Widget customAppBar(ThemeData theme) {
if (!_homeController.hideSearchBar) {
return searchBarAndUser(theme);
}
return StreamBuilder(
stream: _homeController.hideSearchBar
? _mainController.navSearchStreamDebounce
? _homeController.searchBarStream?.stream.distinct().throttle(
const Duration(milliseconds: 500),
)
: _homeController.searchBarStream?.stream.distinct()
: null,
stream: _homeController.searchBarStream?.stream.distinct(),
initialData: true,
builder: (BuildContext context, AsyncSnapshot snapshot) {
return AnimatedOpacity(