Enhance contact handling and UI updates across multiple screens

add unfiltered contact access and improve last seen resolution
This commit is contained in:
Winston Lowe
2026-03-25 18:30:27 -07:00
parent 9dbf374ac6
commit 882abf3879
9 changed files with 142 additions and 16 deletions
+15
View File
@@ -328,6 +328,9 @@ class MeshCoreConnector extends ChangeNotifier {
),
]);
List<Contact> get allContactsUnfiltered =>
List.unmodifiable([..._contacts, ..._discoveredContacts]);
List<Contact> get discoveredContacts {
return List.unmodifiable(_discoveredContacts);
}
@@ -2372,6 +2375,18 @@ class MeshCoreConnector extends ChangeNotifier {
});
}
Contact getFromDiscovered(Contact contact) {
final tmp = _discoveredContacts.firstWhere(
(c) => c.publicKeyHex == contact.publicKeyHex,
orElse: () => contact,
);
return contact.copyWith(
rawPacket: tmp.rawPacket,
latitude: tmp.latitude,
longitude: tmp.longitude,
);
}
Future<void> getContacts({int? since, bool preserveExisting = false}) async {
if (!isConnected) return;