mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-06-25 03:42:55 +10:00
Enhance contact handling and UI updates across multiple screens
add unfiltered contact access and improve last seen resolution
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user