This commit is contained in:
HDDen
2026-04-28 16:26:42 +03:00
67 changed files with 5771 additions and 611 deletions
+4 -12
View File
@@ -41,7 +41,10 @@ class Contact {
String get publicKeyHex => pubKeyToHex(publicKey);
String get typeLabel {
/// Non-localized type label, intended for logs and non-UI exports
/// (e.g. GPX). For UI use the `typeLabel(l10n)` extension in
/// `lib/l10n/contact_localization.dart`.
String get typeLabelRaw {
switch (type) {
case advTypeChat:
return 'Chat';
@@ -56,17 +59,6 @@ class Contact {
}
}
String get pathLabel {
if (pathOverride != null) {
if (pathOverride! < 0) return 'Flood (forced)';
if (pathOverride == 0) return 'Direct (forced)';
return '$pathOverride hops (forced)';
}
if (pathLength < 0) return 'Flood';
if (pathLength == 0) return 'Direct';
return '$pathLength hops';
}
bool get hasLocation {
const double epsilon = 1e-6;
final lat = latitude ?? 0.0;