feat: add file logs and logging view

This commit is contained in:
Anton Stubenbord
2023-10-11 19:09:26 +02:00
parent a102389cd8
commit f0c3ced804
19 changed files with 681 additions and 231 deletions

View File

@@ -11,19 +11,14 @@ class LabelRepository extends PersistentRepository<LabelRepositoryState> {
LabelRepository(this._api) : super(const LabelRepositoryState());
Future<void> initialize() async {
debugPrint("[LabelRepository] initialize() called.");
try {
await Future.wait([
findAllCorrespondents(),
findAllDocumentTypes(),
findAllStoragePaths(),
findAllTags(),
]);
} catch (error, stackTrace) {
debugPrint(
"[LabelRepository] An error occurred in initialize(): ${error.toString()}");
debugPrintStack(stackTrace: stackTrace);
}
}
Future<Tag> createTag(Tag object) async {
@@ -95,9 +90,7 @@ class LabelRepository extends PersistentRepository<LabelRepositoryState> {
Future<Iterable<Correspondent>> findAllCorrespondents(
[Iterable<int>? ids]) async {
debugPrint("Loading correspondents...");
final correspondents = await _api.getCorrespondents(ids);
debugPrint("${correspondents.length} correspondents successfully loaded.");
final updatedState = {
...state.correspondents,
}..addAll({for (var element in correspondents) element.id!: element});