feat: Restructure providers and repositories (WIP, not compiling)

This commit is contained in:
Anton Stubenbord
2023-04-30 20:49:36 +02:00
parent 4e87a196f9
commit 88085b5662
14 changed files with 776 additions and 269 deletions

View File

@@ -52,16 +52,18 @@ class InboxCubit extends HydratedCubit<InboxState> with DocumentPagingBlocMixin
emit(state.copyWith(labels: labels));
},
);
refreshItemsInInboxCount(false);
loadInbox();
}
void refreshItemsInInboxCount([bool shouldLoadInbox = true]) async {
Future<void> initialize() async {
await refreshItemsInInboxCount(false);
await loadInbox();
}
Future<void> refreshItemsInInboxCount([bool shouldLoadInbox = true]) async {
final stats = await _statsApi.getServerStatistics();
if (stats.documentsInInbox != state.itemsInInboxCount && shouldLoadInbox) {
loadInbox();
await loadInbox();
}
emit(
state.copyWith(