increase min sdk and apply new formatter

This commit is contained in:
Fabian Freund
2025-02-18 15:37:03 +01:00
parent f7885fc829
commit a1ee8bef35
266 changed files with 11329 additions and 10058 deletions
@@ -74,13 +74,11 @@ class ChatArchiveSearchRepository extends _$ChatArchiveSearchRepository {
ellipsis: ellipsis,
)
.get()
.then(
(value) {
if (!_streamController.isClosed) {
_streamController.add(value);
}
},
);
.then((value) {
if (!_streamController.isClosed) {
_streamController.add(value);
}
});
}
}
@@ -96,23 +94,24 @@ class ChatArchiveSearchRepository extends _$ChatArchiveSearchRepository {
await searchDatabase.searchDao.indexChats(await _availableChats());
_populatedCompleter.complete();
final changeStreamSubscription =
ref.watch(chatArchiveFileServiceProvider).listen((event) async {
final chat = ChatEntity.fromFileName(path.basename(event.path));
final changeStreamSubscription = ref
.watch(chatArchiveFileServiceProvider)
.listen((event) async {
final chat = ChatEntity.fromFileName(path.basename(event.path));
switch (event.type) {
case ChangeType.ADD:
case ChangeType.MODIFY:
if (chat.name != null) {
final companion = await _readChat(chat);
if (companion != null) {
await searchDatabase.searchDao.upsertChat(companion);
}
switch (event.type) {
case ChangeType.ADD:
case ChangeType.MODIFY:
if (chat.name != null) {
final companion = await _readChat(chat);
if (companion != null) {
await searchDatabase.searchDao.upsertChat(companion);
}
}
case ChangeType.REMOVE:
await searchDatabase.searchDao.deleteChat(chat.fileName);
}
case ChangeType.REMOVE:
await searchDatabase.searchDao.deleteChat(chat.fileName);
}
});
});
ref.onDispose(() async {
await changeStreamSubscription.cancel();