mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-10 06:07:57 -06:00
feat: Add inline suggestion in document search, allow removing history entries
This commit is contained in:
@@ -3,7 +3,6 @@ import 'package:hydrated_bloc/hydrated_bloc.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/notifier/document_changed_notifier.dart';
|
||||
import 'package:paperless_mobile/features/paged_document_view/cubit/document_paging_bloc_mixin.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:paperless_mobile/features/paged_document_view/cubit/paged_documents_state.dart';
|
||||
|
||||
@@ -49,6 +48,16 @@ class DocumentSearchCubit extends HydratedCubit<DocumentSearchState>
|
||||
);
|
||||
}
|
||||
|
||||
void removeHistoryEntry(String entry) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
searchHistory: state.searchHistory
|
||||
.whereNot((element) => element == entry)
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> suggest(String query) async {
|
||||
emit(
|
||||
state.copyWith(
|
||||
|
||||
Reference in New Issue
Block a user