mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-06 21:15:50 -06:00
fix: Fix scrolling bug on inbox page
This commit is contained in:
@@ -108,8 +108,9 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
|
||||
}
|
||||
|
||||
Widget _buildSuggestionsView(DocumentSearchState state) {
|
||||
final suggestions =
|
||||
state.suggestions.whereNot((element) => state.searchHistory.contains(element)).toList();
|
||||
final suggestions = state.suggestions
|
||||
.whereNot((element) => state.searchHistory.contains(element))
|
||||
.toList();
|
||||
final historyMatches = state.searchHistory
|
||||
.where(
|
||||
(element) => element.startsWith(query),
|
||||
@@ -140,7 +141,7 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
|
||||
childCount: suggestions.length,
|
||||
),
|
||||
),
|
||||
if (suggestions.isEmpty && historyMatches.isEmpty)
|
||||
if (suggestions.isEmpty && historyMatches.isEmpty && state.hasLoaded)
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
sliver: SliverToBoxAdapter(
|
||||
@@ -191,7 +192,8 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
|
||||
builder: (context, state) {
|
||||
return ViewTypeSelectionWidget(
|
||||
viewType: state.viewType,
|
||||
onChanged: (type) => context.read<DocumentSearchCubit>().updateViewType(type),
|
||||
onChanged: (type) =>
|
||||
context.read<DocumentSearchCubit>().updateViewType(type),
|
||||
);
|
||||
},
|
||||
)
|
||||
|
||||
@@ -16,18 +16,22 @@ class SliverSearchBar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final currentUser =
|
||||
Hive.box<GlobalSettings>(HiveBoxes.globalSettings).getValue()!.currentLoggedInUser;
|
||||
final currentUser = Hive.box<GlobalSettings>(HiveBoxes.globalSettings)
|
||||
.getValue()!
|
||||
.currentLoggedInUser;
|
||||
|
||||
return SliverPersistentHeader(
|
||||
floating: floating,
|
||||
pinned: pinned,
|
||||
delegate: CustomizableSliverPersistentHeaderDelegate(
|
||||
minExtent: kToolbarHeight,
|
||||
maxExtent: kToolbarHeight,
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: const DocumentSearchBar(),
|
||||
return SliverPadding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
||||
sliver: SliverPersistentHeader(
|
||||
floating: floating,
|
||||
pinned: pinned,
|
||||
delegate: CustomizableSliverPersistentHeaderDelegate(
|
||||
minExtent: kToolbarHeight,
|
||||
maxExtent: kToolbarHeight,
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: const DocumentSearchBar(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user