diff --git a/lib/app_state.dart b/lib/app_state.dart index d90c69a..71a70c5 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -813,7 +813,7 @@ class AppState extends ChangeNotifier { // ---------- Utility Methods ---------- /// Generate a default changeset comment for a submission - /// Handles special case of profile by using "a" instead + /// Handles special case of `` profile by using "a" instead static String generateDefaultChangesetComment({ required NodeProfile? profile, required UploadOperation operation, diff --git a/lib/models/node_profile.dart b/lib/models/node_profile.dart index 61aaad6..cdf996a 100644 --- a/lib/models/node_profile.dart +++ b/lib/models/node_profile.dart @@ -266,7 +266,7 @@ class NodeProfile { int get hashCode => id.hashCode; /// Create a temporary empty profile for editing existing nodes - /// Used as the default "" option when editing nodes + /// Used as the default `` option when editing nodes /// All existing tags will flow through as additionalExistingTags static NodeProfile createExistingTagsProfile(OsmNode node) { // Calculate FOV from existing direction ranges if applicable diff --git a/lib/services/deflock_tile_provider.dart b/lib/services/deflock_tile_provider.dart index f5b9533..a9f4aa8 100644 --- a/lib/services/deflock_tile_provider.dart +++ b/lib/services/deflock_tile_provider.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:typed_data'; import 'dart:ui'; import 'package:flutter_map/flutter_map.dart'; diff --git a/lib/services/distance_service.dart b/lib/services/distance_service.dart index 898fe57..d997974 100644 --- a/lib/services/distance_service.dart +++ b/lib/services/distance_service.dart @@ -8,7 +8,6 @@ class DistanceService { // Conversion constants static const double _metersToFeet = 3.28084; static const double _metersToMiles = 0.000621371; - static const double _kmToMiles = 0.621371; /// Format distance for display based on unit preference /// diff --git a/lib/services/map_data_submodules/nodes_from_osm_api.dart b/lib/services/map_data_submodules/nodes_from_osm_api.dart index 8d7e676..723c16b 100644 --- a/lib/services/map_data_submodules/nodes_from_osm_api.dart +++ b/lib/services/map_data_submodules/nodes_from_osm_api.dart @@ -7,7 +7,6 @@ import 'package:xml/xml.dart'; import '../../models/node_profile.dart'; import '../../models/osm_node.dart'; import '../../app_state.dart'; -import '../network_status.dart'; /// Fetches surveillance nodes from the direct OSM API using bbox query. /// This is a fallback for when Overpass is not available (e.g., sandbox mode). diff --git a/lib/services/tile_preview_service.dart b/lib/services/tile_preview_service.dart index d04abb3..3f88606 100644 --- a/lib/services/tile_preview_service.dart +++ b/lib/services/tile_preview_service.dart @@ -1,5 +1,3 @@ -import 'dart:typed_data'; - import 'package:flutter/foundation.dart'; import 'package:http/http.dart' as http; diff --git a/lib/services/uploader.dart b/lib/services/uploader.dart index 8c675ae..636a795 100644 --- a/lib/services/uploader.dart +++ b/lib/services/uploader.dart @@ -54,23 +54,6 @@ class Uploader { return UploadResult.failure(errorMessage: errorMsg); } - // Generate changeset XML - String action; - switch (p.operation) { - case UploadOperation.create: - action = 'Add'; - break; - case UploadOperation.modify: - action = 'Update'; - break; - case UploadOperation.delete: - action = 'Delete'; - break; - case UploadOperation.extract: - action = 'Extract'; - break; - } - // Use the user's changeset comment, with XML sanitization final sanitizedComment = _sanitizeXmlText(p.changesetComment); final csXml = ''' diff --git a/lib/state/session_state.dart b/lib/state/session_state.dart index 0fe2469..b48019f 100644 --- a/lib/state/session_state.dart +++ b/lib/state/session_state.dart @@ -140,16 +140,6 @@ class SessionState extends ChangeNotifier { notifyListeners(); } - bool _profileMatchesTags(NodeProfile profile, Map tags) { - // Simple matching: check if all profile tags are present in node tags - for (final entry in profile.tags.entries) { - if (tags[entry.key] != entry.value) { - return false; - } - } - return true; - } - /// Calculate additional existing tags for a given profile change Map _calculateAdditionalExistingTags(NodeProfile? newProfile, OsmNode originalNode) { final additionalTags = {}; @@ -479,7 +469,7 @@ class SessionState extends ChangeNotifier { } /// Generate a default changeset comment for a submission - /// Handles special case of profile by using "a" instead + /// Handles special case of `` profile by using "a" instead String _generateDefaultChangesetComment({ required NodeProfile? profile, required UploadOperation operation, diff --git a/lib/widgets/map_view.dart b/lib/widgets/map_view.dart index 808e249..0dcd8f9 100644 --- a/lib/widgets/map_view.dart +++ b/lib/widgets/map_view.dart @@ -4,15 +4,11 @@ import 'package:flutter_map_animations/flutter_map_animations.dart'; import 'package:latlong2/latlong.dart'; import 'package:provider/provider.dart'; -import '../app_state.dart' show AppState, FollowMeMode, UploadMode; +import '../app_state.dart' show AppState, FollowMeMode; import '../services/offline_area_service.dart'; -import '../services/network_status.dart'; import '../models/osm_node.dart'; -import '../models/node_profile.dart'; import '../models/suspected_location.dart'; -import '../models/tile_provider.dart'; -import '../state/session_state.dart'; import 'debouncer.dart'; import 'node_provider_with_cache.dart'; import 'map/map_overlays.dart'; @@ -170,9 +166,7 @@ class MapViewState extends State { } catch (_) { return []; } - return mapBounds != null - ? NodeProviderWithCache.instance.getCachedNodesForBounds(mapBounds) - : []; + return NodeProviderWithCache.instance.getCachedNodesForBounds(mapBounds); } catch (e) { debugPrint('[MapView] Could not get nearby nodes: $e'); return []; diff --git a/test/services/localization_service_test.dart b/test/services/localization_service_test.dart index 2f8d44e..060a8dc 100644 --- a/test/services/localization_service_test.dart +++ b/test/services/localization_service_test.dart @@ -62,7 +62,6 @@ void main() { data = json.decode(content) as Map; } catch (e) { fail('$name is not valid JSON: $e'); - return; // unreachable, keeps analyzer happy } expect( data['language'], diff --git a/test/services/network_status_test.dart b/test/services/network_status_test.dart index c6f20a1..41a7d54 100644 --- a/test/services/network_status_test.dart +++ b/test/services/network_status_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import '../../lib/services/network_status.dart'; +import 'package:deflockapp/services/network_status.dart'; void main() { group('NetworkStatus', () {