mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-15 04:12:30 -06:00
added initial draft of inbox
This commit is contained in:
@@ -27,6 +27,4 @@ abstract class LabelRepository {
|
||||
Future<StoragePath> saveStoragePath(StoragePath path);
|
||||
Future<StoragePath> updateStoragePath(StoragePath path);
|
||||
Future<int> deleteStoragePath(StoragePath path);
|
||||
|
||||
Future<int> getStatistics();
|
||||
}
|
||||
|
||||
@@ -120,15 +120,6 @@ class LabelRepositoryImpl implements LabelRepository {
|
||||
throw const ErrorMessage(ErrorCode.tagCreateFailed);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<int> getStatistics() async {
|
||||
final response = await httpClient.get(Uri.parse('/api/statistics/'));
|
||||
if (response.statusCode == 200) {
|
||||
return jsonDecode(utf8.decode(response.bodyBytes))['documents_total'];
|
||||
}
|
||||
throw const ErrorMessage(ErrorCode.unknown);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<int> deleteCorrespondent(Correspondent correspondent) async {
|
||||
assert(correspondent.id != null);
|
||||
|
||||
@@ -10,7 +10,13 @@ import 'package:paperless_mobile/util.dart';
|
||||
class TagWidget extends StatelessWidget {
|
||||
final Tag tag;
|
||||
final void Function()? afterTagTapped;
|
||||
const TagWidget({super.key, required this.tag, required this.afterTagTapped});
|
||||
final bool isClickable;
|
||||
const TagWidget({
|
||||
super.key,
|
||||
required this.tag,
|
||||
required this.afterTagTapped,
|
||||
this.isClickable = true,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -43,6 +49,9 @@ class TagWidget extends StatelessWidget {
|
||||
}
|
||||
|
||||
void _addTagToFilter(BuildContext context) {
|
||||
if (!isClickable) {
|
||||
return;
|
||||
}
|
||||
final cubit = BlocProvider.of<DocumentsCubit>(context);
|
||||
try {
|
||||
final tagsQuery = cubit.state.filter.tags is IdsTagsQuery
|
||||
|
||||
@@ -35,6 +35,7 @@ class _TagsWidgetState extends State<TagsWidget> {
|
||||
(id) => TagWidget(
|
||||
tag: state[id]!,
|
||||
afterTagTapped: widget.afterTagTapped,
|
||||
isClickable: widget.isClickable,
|
||||
),
|
||||
)
|
||||
.toList();
|
||||
|
||||
Reference in New Issue
Block a user