feat: Replaced old label form fields with full page search, removed badge from edit button in document details

This commit is contained in:
Anton Stubenbord
2023-04-07 18:04:56 +02:00
parent 79ccdd0946
commit 10d48e6a55
58 changed files with 3457 additions and 487 deletions

View File

@@ -145,7 +145,7 @@ class SliverAdaptiveDocumentsView extends AdaptiveDocumentsView {
Widget _buildFullView(BuildContext context) {
if (showLoadingPlaceholder) {
//TODO: Build detailed loading animation
return DocumentsListLoadingWidget.sliver();
return const DocumentsListLoadingWidget.sliver();
}
return SliverList(
delegate: SliverChildBuilderDelegate(

View File

@@ -11,7 +11,7 @@ import 'package:paperless_mobile/features/labels/tags/view/widgets/tags_widget.d
class DocumentListItem extends DocumentItem {
static const _a4AspectRatio = 1 / 1.4142;
const DocumentListItem({
DocumentListItem({
super.key,
required super.document,
required super.isSelected,
@@ -28,7 +28,9 @@ class DocumentListItem extends DocumentItem {
required super.correspondents,
required super.documentTypes,
required super.storagePaths,
});
}) {
print(tags.keys.join(", "));
}
@override
Widget build(BuildContext context) {
@@ -64,11 +66,14 @@ class DocumentListItem extends DocumentItem {
absorbing: isSelectionActive,
child: TagsWidget(
isClickable: isLabelClickable,
tags: document.tags.map((e) => tags[e]!).toList(),
tags: document.tags
.where((e) => tags.containsKey(e))
.map((e) => tags[e]!)
.toList(),
isMultiLine: false,
onTagSelected: (id) => onTagSelected?.call(id),
),
)
),
],
),
subtitle: Padding(

View File

@@ -155,10 +155,9 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
Widget _buildDocumentTypeFormField() {
return LabelFormField<DocumentType>(
formBuilderState: widget.formKey.currentState,
name: DocumentFilterForm.fkDocumentType,
labelOptions: widget.documentTypes,
textFieldLabel: S.of(context)!.documentType,
options: widget.documentTypes,
labelText: S.of(context)!.documentType,
initialValue: widget.initialFilter.documentType,
prefixIcon: const Icon(Icons.description_outlined),
);
@@ -166,10 +165,9 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
Widget _buildCorrespondentFormField() {
return LabelFormField<Correspondent>(
formBuilderState: widget.formKey.currentState,
name: DocumentFilterForm.fkCorrespondent,
labelOptions: widget.correspondents,
textFieldLabel: S.of(context)!.correspondent,
options: widget.correspondents,
labelText: S.of(context)!.correspondent,
initialValue: widget.initialFilter.correspondent,
prefixIcon: const Icon(Icons.person_outline),
);
@@ -177,10 +175,9 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
Widget _buildStoragePathFormField() {
return LabelFormField<StoragePath>(
formBuilderState: widget.formKey.currentState,
name: DocumentFilterForm.fkStoragePath,
labelOptions: widget.storagePaths,
textFieldLabel: S.of(context)!.storagePath,
options: widget.storagePaths,
labelText: S.of(context)!.storagePath,
initialValue: widget.initialFilter.storagePath,
prefixIcon: const Icon(Icons.folder_outlined),
);