mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 14:08:00 -06:00
WIP - more decoupling of blocs
This commit is contained in:
@@ -34,4 +34,10 @@ class AuthenticationInterceptor implements InterceptorContract {
|
||||
Future<BaseResponse> interceptResponse(
|
||||
{required BaseResponse response}) async =>
|
||||
response;
|
||||
|
||||
@override
|
||||
Future<bool> shouldInterceptRequest() async => true;
|
||||
|
||||
@override
|
||||
Future<bool> shouldInterceptResponse() async => true;
|
||||
}
|
||||
|
||||
@@ -25,4 +25,10 @@ class BaseUrlInterceptor implements InterceptorContract {
|
||||
Future<BaseResponse> interceptResponse(
|
||||
{required BaseResponse response}) async =>
|
||||
response;
|
||||
|
||||
@override
|
||||
Future<bool> shouldInterceptRequest() async => true;
|
||||
|
||||
@override
|
||||
Future<bool> shouldInterceptResponse() async => true;
|
||||
}
|
||||
|
||||
@@ -25,4 +25,10 @@ class LanguageHeaderInterceptor implements InterceptorContract {
|
||||
Future<BaseResponse> interceptResponse(
|
||||
{required BaseResponse response}) async =>
|
||||
response;
|
||||
|
||||
@override
|
||||
Future<bool> shouldInterceptRequest() async => true;
|
||||
|
||||
@override
|
||||
Future<bool> shouldInterceptResponse() async => true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:http/http.dart';
|
||||
import 'package:http_interceptor/http/http.dart';
|
||||
import 'package:http_interceptor/http_interceptor.dart';
|
||||
import 'package:injectable/injectable.dart';
|
||||
|
||||
const interceptedRoutes = ['thumb/'];
|
||||
@@ -33,4 +32,10 @@ class ResponseConversionInterceptor implements InterceptorContract {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> shouldInterceptRequest() async => true;
|
||||
|
||||
@override
|
||||
Future<bool> shouldInterceptResponse() async => true;
|
||||
}
|
||||
|
||||
@@ -64,4 +64,7 @@ class CorrespondentRepositoryImpl implements LabelRepository<Correspondent> {
|
||||
void clear() {
|
||||
_subject.add(const {});
|
||||
}
|
||||
|
||||
@override
|
||||
Map<int, Correspondent> get current => _subject.value;
|
||||
}
|
||||
|
||||
@@ -63,4 +63,7 @@ class DocumentTypeRepositoryImpl implements LabelRepository<DocumentType> {
|
||||
void clear() {
|
||||
_subject.add(const {});
|
||||
}
|
||||
|
||||
@override
|
||||
Map<int, DocumentType> get current => _subject.value;
|
||||
}
|
||||
|
||||
@@ -63,4 +63,7 @@ class StoragePathRepositoryImpl implements LabelRepository<StoragePath> {
|
||||
void clear() {
|
||||
_subject.add(const {});
|
||||
}
|
||||
|
||||
@override
|
||||
Map<int, StoragePath> get current => _subject.value;
|
||||
}
|
||||
|
||||
@@ -62,4 +62,7 @@ class TagRepositoryImpl implements LabelRepository<Tag> {
|
||||
void clear() {
|
||||
_subject.add(const {});
|
||||
}
|
||||
|
||||
@override
|
||||
Map<int, Tag> get current => _subject.value;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ import 'package:paperless_api/paperless_api.dart';
|
||||
abstract class LabelRepository<T extends Label> {
|
||||
Stream<Map<int, T>> get labels;
|
||||
|
||||
Map<int, T> get current;
|
||||
|
||||
Future<T> create(T label);
|
||||
Future<T?> find(int id);
|
||||
Future<Iterable<T>> findAll([Iterable<int>? ids]);
|
||||
|
||||
@@ -71,8 +71,7 @@ Note: If you have the GitHub Android app installed, the descriptions will not be
|
||||
Text(
|
||||
'Stack Trace',
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
).padded(
|
||||
const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0)),
|
||||
).paddedOnly(top: 8.0, left: 8.0, right: 8.0),
|
||||
TextButton.icon(
|
||||
label: const Text('Copy'),
|
||||
icon: const Icon(Icons.copy),
|
||||
|
||||
Reference in New Issue
Block a user