Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 81 additions & 73 deletions lib/app_state.dart

Large diffs are not rendered by default.

23 changes: 16 additions & 7 deletions lib/dev_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const double kButtonBarHeight = 60.0; // Button height (48) + padding (12)

// Map overlay spacing relative to button bar top
const double kAttributionSpacingAboveButtonBar = 10.0; // Attribution above button bar top
const double kZoomIndicatorSpacingAboveButtonBar = 40.0; // Zoom indicator above button bar top
const double kZoomIndicatorSpacingAboveButtonBar = 40.0; // Zoom indicator above button bar top
const double kScaleBarSpacingAboveButtonBar = 70.0; // Scale bar above button bar top
const double kZoomControlsSpacingAboveButtonBar = 20.0; // Zoom controls above button bar top

Expand Down Expand Up @@ -60,7 +60,7 @@ const Duration kUploadHttpTimeout = Duration(seconds: 30); // HTTP request timeo
const Duration kUploadQueueProcessingInterval = Duration(seconds: 5); // How often to check for new uploads to start
const int kMaxConcurrentUploads = 5; // Maximum number of uploads processing simultaneously
const Duration kChangesetCloseInitialRetryDelay = Duration(seconds: 10);
const Duration kChangesetCloseMaxRetryDelay = Duration(minutes: 5); // Cap at 5 minutes
const Duration kChangesetCloseMaxRetryDelay = Duration(minutes: 5); // Cap at 5 minutes
const Duration kChangesetAutoCloseTimeout = Duration(minutes: 59); // Give up and trust OSM auto-close
const double kChangesetCloseBackoffMultiplier = 2.0;

Expand All @@ -78,7 +78,7 @@ const Duration kOverpassQueryTimeout = Duration(seconds: 45); // Timeout for Ove
const String kSuspectedLocationsCsvUrl = 'https://alprwatch.org/suspected-locations/deflock-latest.csv';

// Development/testing features - set to false for production builds
const bool kEnableDevelopmentModes = false; // Set to false to hide sandbox/simulate modes and force production mode
const bool kEnableDevelopmentModes = true; // Set to false to hide sandbox/simulate modes and force production mode

// Navigation features - set to false to hide navigation UI elements while in development
const bool kEnableNavigationFeatures = true; // Hide navigation until fully implemented
Expand Down Expand Up @@ -109,10 +109,19 @@ const Duration kMarkerTapTimeout = Duration(milliseconds: 250);
const Duration kMapLongPressTimeout = Duration(milliseconds: 600); // Duration to trigger "add node here" on empty map area
const Duration kDebounceCameraRefresh = Duration(milliseconds: 500);

//Release date for stale node detection feature (used as default check_date for nodes without a check_date)
final kFeatureReleaseDate = DateTime.utc(2026, 8, 5); // adjust to actual release date
//Node staleness thresholds (in days) for visual indicator
const int kAgingNodeThresholdDays = 60; // Threshold for stale node to begin fading -- "aging" node
const int kStaleNodeThresholdDays = 360; // Threshold node to be fully stale

// Pre-fetch area configuration
const double kPreFetchAreaExpansionMultiplier = 3.0; // Expand visible bounds by this factor for pre-fetching
const double kNodeRenderingBoundsExpansion = 1.3; // Expand visible bounds by this factor for node rendering to prevent edge blinking
const double kRouteProximityThresholdMeters = 500.0; // Distance threshold for determining if user is near route when resuming navigation
const double kResumeNavigationZoomLevel = 16.0; // Zoom level when resuming navigation

const int kPreFetchZoomLevel = 10; // Always pre-fetch at this zoom level for consistent area sizes
const int kMaxPreFetchSplitDepth = 3; // Maximum recursive splits when hitting Overpass node limit

// Data refresh configuration
const int kDataRefreshIntervalSeconds = 60; // Refresh cached data after this many seconds
Expand Down Expand Up @@ -176,6 +185,7 @@ const double kNodeIconDiameter = 17.0;
const double _kNodeRingThicknessBase = 2.6;
const double kNodeDotOpacity = 0.28; // Opacity for the grey dot interior
const Color kNodeRingColorReal = Color(0xFF3036F0); // Real nodes from OSM - blue
const Color kNodeRingColorStale = Color(0xFF6F4E37); // Real but stale OSM nodes - brown
const Color kNodeRingColorMock = Color(0xE044BB55); // Add node mock point - white
const Color kNodeRingColorPending = Color(0xD09C27B0); // Submitted/pending nodes - purple
const Color kNodeRingColorEditing = Color(0xD0FF9800); // Node being edited - orange
Expand All @@ -188,12 +198,11 @@ const double kDirectionButtonMinHeight = 32.0;

// Helper functions for pixel-ratio scaling
double getDirectionConeBorderWidth(BuildContext context) {
// return _kDirectionConeBorderWidthBase * MediaQuery.of(context).devicePixelRatio;
// return _kDirectionConeBorderWidthBase * MediaQuery.of(context).devicePixelRatio;
return _kDirectionConeBorderWidthBase;
}

double getNodeRingThickness(BuildContext context) {
// return _kNodeRingThicknessBase * MediaQuery.of(context).devicePixelRatio;
// return _kNodeRingThicknessBase * MediaQuery.of(context).devicePixelRatio;
return _kNodeRingThicknessBase;
}

8 changes: 8 additions & 0 deletions lib/localizations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"download": "Herunterladen",
"settings": "Einstellungen",
"edit": "Bearbeiten",
"verify": "Überprüfen",
"delete": "Löschen",
"cancel": "Abbrechen",
"ok": "OK",
Expand Down Expand Up @@ -75,6 +76,7 @@
"advancedSettingsSubtitle": "Leistungs-, Warnungs- und Kachelanbieter-Einstellungen",
"proximityAlerts": "Näherungswarnungen",
"keepScreenAwake": "Bildschirm Aktiv Lassen",
"dataFreshness": "Datenaktualität",
"networkStatusIndicator": "Netzwerkstatus-Anzeige",
"hideZoomControls": "Zoom-Steuerung Ausblenden",
"enableOfflineFeatures": "Offline-Funktionen Aktivieren",
Expand Down Expand Up @@ -107,6 +109,12 @@
"blockedTitle": "Benachrichtigungen sind blockiert",
"blockedMessage": "Benachrichtigungen für DeFlock sind deaktiviert. Aktiviere sie in den Systemeinstellungen, um Näherungswarnungen zu erhalten."
},
"staleness": {
"showIndicator": "Veraltete Knoten anzeigen",
"showIndicatorExplanation": "Knoten hervorheben, die nicht kürzlich überprüft wurden",
"threshold": "Als veraltet betrachten nach",
"daysCount": "{} Tage"
},
"node": {
"title": "Knoten #{}",
"tagSheetTitle": "Gerät-Tags",
Expand Down
8 changes: 8 additions & 0 deletions lib/localizations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"download": "Download",
"settings": "Settings",
"edit": "Edit",
"verify": "Verify",
"delete": "Delete",
"cancel": "Cancel",
"ok": "OK",
Expand Down Expand Up @@ -113,6 +114,7 @@
"proximityAlerts": "Proximity Alerts",
"networkStatusIndicator": "Network Status Indicator",
"keepScreenAwake": "Keep Screen Awake",
"dataFreshness": "Data Freshness",
"hideZoomControls": "Hide Zoom Controls",
"enableOfflineFeatures": "Enable Offline Features",
"enableOfflineFeaturesTitle": "Enable offline features",
Expand Down Expand Up @@ -144,6 +146,12 @@
"blockedTitle": "Notifications are blocked",
"blockedMessage": "Notifications are turned off for DeFlock. Enable them in your system settings to receive proximity alerts."
},
"staleness": {
"showIndicator": "Show stale node indicator",
"showIndicatorExplanation": "Highlight nodes that haven't been checked recently",
"threshold": "Consider stale after",
"daysCount": "{} days"
},
"node": {
"title": "Node #{}",
"tagSheetTitle": "Surveillance Device Tags",
Expand Down
8 changes: 8 additions & 0 deletions lib/localizations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"download": "Descargar",
"settings": "Configuración",
"edit": "Editar",
"verify": "Verificar",
"delete": "Eliminar",
"cancel": "Cancelar",
"ok": "Aceptar",
Expand Down Expand Up @@ -112,6 +113,7 @@
"advancedSettingsSubtitle": "Configuración de rendimiento, alertas y proveedores de teselas",
"proximityAlerts": "Alertas de Proximidad",
"keepScreenAwake": "Mantener la Pantalla Encendida",
"dataFreshness": "Actualidad de los datos",
"networkStatusIndicator": "Indicador de Estado de Red",
"hideZoomControls": "Ocultar Controles de Zoom",
"enableOfflineFeatures": "Activar Funciones sin Conexión",
Expand Down Expand Up @@ -144,6 +146,12 @@
"blockedTitle": "Las notificaciones están bloqueadas",
"blockedMessage": "Las notificaciones están desactivadas para DeFlock. Actívalas en los ajustes del sistema para recibir alertas de proximidad."
},
"staleness": {
"showIndicator": "Mostrar indicador de nodos obsoletos",
"showIndicatorExplanation": "Resaltar nodos que no se han verificado recientemente",
"threshold": "Considerar obsoleto después de",
"daysCount": "{} días"
},
"node": {
"title": "Nodo #{}",
"tagSheetTitle": "Etiquetas del Dispositivo",
Expand Down
8 changes: 8 additions & 0 deletions lib/localizations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"download": "Télécharger",
"settings": "Paramètres",
"edit": "Modifier",
"verify": "Vérifier",
"delete": "Supprimer",
"cancel": "Annuler",
"ok": "OK",
Expand Down Expand Up @@ -112,6 +113,7 @@
"advancedSettingsSubtitle": "Paramètres de performance, alertes et fournisseurs de tuiles",
"proximityAlerts": "Alertes de Proximité",
"keepScreenAwake": "Maintenir l'écran Allumé",
"dataFreshness": "Fraîcheur des données",
"networkStatusIndicator": "Indicateur de Statut Réseau",
"hideZoomControls": "Masquer les Contrôles de Zoom",
"enableOfflineFeatures": "Activer les Fonctionnalités Hors Ligne",
Expand Down Expand Up @@ -144,6 +146,12 @@
"blockedTitle": "Les notifications sont bloquées",
"blockedMessage": "Les notifications sont désactivées pour DeFlock. Activez-les dans les réglages du système pour recevoir les alertes de proximité."
},
"staleness": {
"showIndicator": "Afficher l'indicateur de nœuds obsolètes",
"showIndicatorExplanation": "Mettre en évidence les nœuds qui n'ont pas été vérifiés récemment",
"threshold": "Considérer comme obsolète après",
"daysCount": "{} jours"
},
"node": {
"title": "Nœud #{}",
"tagSheetTitle": "Balises du Dispositif",
Expand Down
8 changes: 8 additions & 0 deletions lib/localizations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"download": "Scarica",
"settings": "Impostazioni",
"edit": "Modifica",
"verify": "Verifica",
"delete": "Elimina",
"cancel": "Annulla",
"ok": "OK",
Expand Down Expand Up @@ -112,6 +113,7 @@
"advancedSettingsSubtitle": "Impostazioni di prestazioni, avvisi e fornitori di tessere",
"proximityAlerts": "Avvisi di Prossimità",
"keepScreenAwake": "Mantieni lo Schermo Attivo",
"dataFreshness": "Aggiornamento dei dati",
"networkStatusIndicator": "Indicatore di Stato di Rete",
"hideZoomControls": "Nascondi Controlli Zoom",
"enableOfflineFeatures": "Abilita Funzionalità Offline",
Expand Down Expand Up @@ -144,6 +146,12 @@
"blockedTitle": "Le notifiche sono bloccate",
"blockedMessage": "Le notifiche sono disattivate per DeFlock. Attivale nelle impostazioni di sistema per ricevere gli avvisi di prossimità."
},
"staleness": {
"showIndicator": "Mostra indicatore nodi obsoleti",
"showIndicatorExplanation": "Evidenzia i nodi non controllati di recente",
"threshold": "Considera obsoleto dopo",
"daysCount": "{} giorni"
},
"node": {
"title": "Nodo #{}",
"tagSheetTitle": "Tag Dispositivo di Sorveglianza",
Expand Down
8 changes: 8 additions & 0 deletions lib/localizations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"download": "Download",
"settings": "Instellingen",
"edit": "Bewerken",
"verify": "Verifiëren",
"delete": "Verwijderen",
"cancel": "Annuleren",
"ok": "OK",
Expand Down Expand Up @@ -112,6 +113,7 @@
"advancedSettingsSubtitle": "Prestaties, waarschuwingen en tile provider instellingen",
"proximityAlerts": "Nabijheids Waarschuwingen",
"keepScreenAwake": "Scherm Actief Houden",
"dataFreshness": "Gegevensversheid",
"networkStatusIndicator": "Netwerk Status Indicator",
"hideZoomControls": "Zoomknoppen Verbergen",
"enableOfflineFeatures": "Offline Functies Inschakelen",
Expand Down Expand Up @@ -144,6 +146,12 @@
"blockedTitle": "Meldingen zijn geblokkeerd",
"blockedMessage": "Meldingen zijn uitgeschakeld voor DeFlock. Schakel ze in via je systeeminstellingen om nabijheidswaarschuwingen te ontvangen."
},
"staleness": {
"showIndicator": "Verouderde knooppuntindicator tonen",
"showIndicatorExplanation": "Knooppunten markeren die niet recent zijn gecontroleerd",
"threshold": "Als verouderd beschouwen na",
"daysCount": "{} dagen"
},
"node": {
"title": "Node #{}",
"tagSheetTitle": "Surveillance Apparaat Tags",
Expand Down
8 changes: 8 additions & 0 deletions lib/localizations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"download": "Pobierz",
"settings": "Ustawienia",
"edit": "Edytuj",
"verify": "Zweryfikuj",
"delete": "Usuń",
"cancel": "Anuluj",
"ok": "OK",
Expand Down Expand Up @@ -112,6 +113,7 @@
"advancedSettingsSubtitle": "Wydajność, alerty i ustawienia dostawców kafelków",
"proximityAlerts": "Alerty Bliskości",
"keepScreenAwake": "Nie Wygaszaj Ekranu",
"dataFreshness": "Aktualność danych",
"networkStatusIndicator": "Wskaźnik Stanu Sieci",
"hideZoomControls": "Ukryj Kontrolki Zoomu",
"enableOfflineFeatures": "Włącz Funkcje Offline",
Expand Down Expand Up @@ -144,6 +146,12 @@
"blockedTitle": "Powiadomienia są zablokowane",
"blockedMessage": "Powiadomienia dla DeFlock są wyłączone. Włącz je w ustawieniach systemowych, aby otrzymywać alerty o bliskości."
},
"staleness": {
"showIndicator": "Pokaż wskaźnik nieaktualnych węzłów",
"showIndicatorExplanation": "Wyróżnij węzły, które nie były ostatnio sprawdzane",
"threshold": "Uznaj za nieaktualne po",
"daysCount": "{} dni"
},
"node": {
"title": "Węzeł #{}",
"tagSheetTitle": "Tagi Urządzenia Nadzoru",
Expand Down
8 changes: 8 additions & 0 deletions lib/localizations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"download": "Baixar",
"settings": "Configurações",
"edit": "Editar",
"verify": "Verificar",
"delete": "Excluir",
"cancel": "Cancelar",
"ok": "OK",
Expand Down Expand Up @@ -112,6 +113,7 @@
"advancedSettingsSubtitle": "Configurações de desempenho, alertas e provedores de mapas",
"proximityAlerts": "Alertas de Proximidade",
"keepScreenAwake": "Manter Ecrã Ativa",
"dataFreshness": "Atualidade dos dados",
"networkStatusIndicator": "Indicador de Status de Rede",
"hideZoomControls": "Ocultar Controlos de Zoom",
"enableOfflineFeatures": "Ativar Funcionalidades Offline",
Expand Down Expand Up @@ -144,6 +146,12 @@
"blockedTitle": "As notificações estão bloqueadas",
"blockedMessage": "As notificações estão desativadas para o DeFlock. Ative-as nas configurações do sistema para receber alertas de proximidade."
},
"staleness": {
"showIndicator": "Mostrar indicador de nós desatualizados",
"showIndicatorExplanation": "Destacar nós que não foram verificados recentemente",
"threshold": "Considerar desatualizado após",
"daysCount": "{} dias"
},
"node": {
"title": "Nó #{}",
"tagSheetTitle": "Tags do Dispositivo de Vigilância",
Expand Down
8 changes: 8 additions & 0 deletions lib/localizations/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"download": "İndir",
"settings": "Ayarlar",
"edit": "Düzenle",
"verify": "Doğrula",
"delete": "Sil",
"cancel": "İptal",
"ok": "Tamam",
Expand Down Expand Up @@ -112,6 +113,7 @@
"advancedSettingsSubtitle": "Performans, uyarılar ve döşeme sağlayıcı ayarları",
"proximityAlerts": "Yakınlık Uyarıları",
"keepScreenAwake": "Ekranı Açık Tut",
"dataFreshness": "Veri Tazeliği",
"networkStatusIndicator": "Ağ Durumu Göstergesi",
"hideZoomControls": "Yakınlaştırma Kontrollerini Gizle",
"enableOfflineFeatures": "Çevrimdışı Özellikleri Etkinleştir",
Expand Down Expand Up @@ -144,6 +146,12 @@
"blockedTitle": "Bildirimler engellendi",
"blockedMessage": "DeFlock için bildirimler kapalı. Yakınlık uyarıları almak için sistem ayarlarından etkinleştirin."
},
"staleness": {
"showIndicator": "Eski düğüm göstergesini göster",
"showIndicatorExplanation": "Son zamanlarda kontrol edilmemiş düğümleri vurgula",
"threshold": "Şu süreden sonra eski say",
"daysCount": "{} gün"
},
"node": {
"title": "Düğüm #{}",
"tagSheetTitle": "Gözetleme Cihazı Etiketleri",
Expand Down
8 changes: 8 additions & 0 deletions lib/localizations/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"download": "Завантажити",
"settings": "Налаштування",
"edit": "Редагувати",
"verify": "Перевірити",
"delete": "Видалити",
"cancel": "Скасувати",
"ok": "ОК",
Expand Down Expand Up @@ -112,6 +113,7 @@
"advancedSettingsSubtitle": "Продуктивність, сповіщення та налаштування постачальників плиток",
"proximityAlerts": "Сповіщення Про Близькість",
"keepScreenAwake": "Тримати екран активним",
"dataFreshness": "Актуальність даних",
"networkStatusIndicator": "Індикатор Стану Мережі",
"hideZoomControls": "Приховати Елементи Керування Масштабом",
"enableOfflineFeatures": "Увімкнути Офлайн-Функції",
Expand Down Expand Up @@ -144,6 +146,12 @@
"blockedTitle": "Сповіщення заблоковано",
"blockedMessage": "Сповіщення для DeFlock вимкнено. Увімкніть їх у налаштуваннях системи, щоб отримувати сповіщення про наближення."
},
"staleness": {
"showIndicator": "Показувати індикатор застарілих вузлів",
"showIndicatorExplanation": "Виділяти вузли, які давно не перевірялися",
"threshold": "Вважати застарілим після",
"daysCount": "{} днів"
},
"node": {
"title": "Вузол #{}",
"tagSheetTitle": "Теги Пристрою Спостереження",
Expand Down
8 changes: 8 additions & 0 deletions lib/localizations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"download": "下载",
"settings": "设置",
"edit": "编辑",
"verify": "验证",
"delete": "删除",
"cancel": "取消",
"ok": "确定",
Expand Down Expand Up @@ -112,6 +113,7 @@
"advancedSettingsSubtitle": "性能、警报和地图提供商设置",
"proximityAlerts": "邻近警报",
"keepScreenAwake": "保持屏幕常亮",
"dataFreshness": "数据新鲜度",
"networkStatusIndicator": "网络状态指示器",
"hideZoomControls": "隐藏缩放控件",
"enableOfflineFeatures": "启用离线功能",
Expand Down Expand Up @@ -144,6 +146,12 @@
"blockedTitle": "通知已被阻止",
"blockedMessage": "DeFlock 的通知已关闭。请在系统设置中启用,以接收邻近提醒。"
},
"staleness": {
"showIndicator": "显示过期节点指示器",
"showIndicatorExplanation": "高亮显示最近未检查的节点",
"threshold": "视为过期的天数",
"daysCount": "{} 天"
},
"node": {
"title": "节点 #{}",
"tagSheetTitle": "监控设备标签",
Expand Down
Loading