mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-11 00:07:59 -06:00
Finished inbox, fixed reverse sort order, bloc refactorings
This commit is contained in:
@@ -79,8 +79,10 @@ class DocumentsCubit extends Cubit<DocumentsState> {
|
||||
}
|
||||
final newFilter = state.filter.copyWith(page: state.filter.page + 1);
|
||||
final result = await documentRepository.find(newFilter);
|
||||
emit(DocumentsState(
|
||||
isLoaded: true, value: [...state.value, result], filter: newFilter));
|
||||
emit(
|
||||
DocumentsState(
|
||||
isLoaded: true, value: [...state.value, result], filter: newFilter),
|
||||
);
|
||||
}
|
||||
|
||||
///
|
||||
|
||||
@@ -5,18 +5,18 @@ import 'package:paperless_mobile/core/type/types.dart';
|
||||
|
||||
class DocumentModel extends Equatable {
|
||||
static const idKey = 'id';
|
||||
static const titleKey = "title";
|
||||
static const contentKey = "content";
|
||||
static const archivedFileNameKey = "archived_file_name";
|
||||
static const asnKey = "archive_serial_number";
|
||||
static const createdKey = "created";
|
||||
static const modifiedKey = "modified";
|
||||
static const addedKey = "added";
|
||||
static const correspondentKey = "correspondent";
|
||||
static const titleKey = 'title';
|
||||
static const contentKey = 'content';
|
||||
static const archivedFileNameKey = 'archived_file_name';
|
||||
static const asnKey = 'archive_serial_number';
|
||||
static const createdKey = 'created';
|
||||
static const modifiedKey = 'modified';
|
||||
static const addedKey = 'added';
|
||||
static const correspondentKey = 'correspondent';
|
||||
static const originalFileNameKey = 'original_file_name';
|
||||
static const documentTypeKey = "document_type";
|
||||
static const tagsKey = "tags";
|
||||
static const storagePathKey = "storage_path";
|
||||
static const documentTypeKey = 'document_type';
|
||||
static const tagsKey = 'tags';
|
||||
static const storagePathKey = 'storage_path';
|
||||
|
||||
final int id;
|
||||
final String title;
|
||||
@@ -121,7 +121,7 @@ class DocumentModel extends Equatable {
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
title,
|
||||
content,
|
||||
content.hashCode,
|
||||
tags,
|
||||
documentType,
|
||||
storagePath,
|
||||
|
||||
@@ -18,6 +18,7 @@ class OnlyNotAssignedTagsQuery extends TagsQuery {
|
||||
|
||||
class AnyAssignedTagsQuery extends TagsQuery {
|
||||
final Iterable<int> tagIds;
|
||||
|
||||
const AnyAssignedTagsQuery({
|
||||
this.tagIds = const [],
|
||||
});
|
||||
|
||||
@@ -37,26 +37,21 @@ class DocumentsPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DocumentsPageState extends State<DocumentsPage> {
|
||||
final PagingController<int, DocumentModel> _pagingController =
|
||||
PagingController<int, DocumentModel>(
|
||||
final _pagingController = PagingController<int, DocumentModel>(
|
||||
firstPageKey: 1,
|
||||
);
|
||||
|
||||
final PanelController _filterPanelController = PanelController();
|
||||
final _filterPanelController = PanelController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_initDocuments();
|
||||
_pagingController.addPageRequestListener(_loadNewPage);
|
||||
}
|
||||
|
||||
Future<void> _initDocuments() async {
|
||||
try {
|
||||
BlocProvider.of<DocumentsCubit>(context).load();
|
||||
} on ErrorMessage catch (error, stackTrace) {
|
||||
showErrorMessage(context, error, stackTrace);
|
||||
}
|
||||
_pagingController.addPageRequestListener(_loadNewPage);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -120,7 +115,10 @@ class _DocumentsPageState extends State<DocumentsPage> {
|
||||
return Scaffold(
|
||||
drawer: BlocProvider.value(
|
||||
value: BlocProvider.of<AuthenticationCubit>(context),
|
||||
child: const InfoDrawer(),
|
||||
child: InfoDrawer(
|
||||
afterInboxClosed: () =>
|
||||
BlocProvider.of<DocumentsCubit>(context).reload(),
|
||||
),
|
||||
),
|
||||
resizeToAvoidBottomInset: true,
|
||||
body: SlidingUpPanel(
|
||||
|
||||
Reference in New Issue
Block a user