mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-02-12 16:52:51 +00:00
Fix lint warnings and cleanup unused code after RadioGroup migration
Remove unused imports, fields, variables, and dead code introduced during the RadioGroup widget migration and prior changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -813,7 +813,7 @@ class AppState extends ChangeNotifier {
|
|||||||
// ---------- Utility Methods ----------
|
// ---------- Utility Methods ----------
|
||||||
|
|
||||||
/// Generate a default changeset comment for a submission
|
/// Generate a default changeset comment for a submission
|
||||||
/// Handles special case of <Existing tags> profile by using "a" instead
|
/// Handles special case of `<Existing tags>` profile by using "a" instead
|
||||||
static String generateDefaultChangesetComment({
|
static String generateDefaultChangesetComment({
|
||||||
required NodeProfile? profile,
|
required NodeProfile? profile,
|
||||||
required UploadOperation operation,
|
required UploadOperation operation,
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ class NodeProfile {
|
|||||||
int get hashCode => id.hashCode;
|
int get hashCode => id.hashCode;
|
||||||
|
|
||||||
/// Create a temporary empty profile for editing existing nodes
|
/// Create a temporary empty profile for editing existing nodes
|
||||||
/// Used as the default "<Existing tags>" option when editing nodes
|
/// Used as the default `<Existing tags>` option when editing nodes
|
||||||
/// All existing tags will flow through as additionalExistingTags
|
/// All existing tags will flow through as additionalExistingTags
|
||||||
static NodeProfile createExistingTagsProfile(OsmNode node) {
|
static NodeProfile createExistingTagsProfile(OsmNode node) {
|
||||||
// Calculate FOV from existing direction ranges if applicable
|
// Calculate FOV from existing direction ranges if applicable
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:typed_data';
|
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:flutter_map/flutter_map.dart';
|
import 'package:flutter_map/flutter_map.dart';
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ class DistanceService {
|
|||||||
// Conversion constants
|
// Conversion constants
|
||||||
static const double _metersToFeet = 3.28084;
|
static const double _metersToFeet = 3.28084;
|
||||||
static const double _metersToMiles = 0.000621371;
|
static const double _metersToMiles = 0.000621371;
|
||||||
static const double _kmToMiles = 0.621371;
|
|
||||||
|
|
||||||
/// Format distance for display based on unit preference
|
/// Format distance for display based on unit preference
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import 'package:xml/xml.dart';
|
|||||||
import '../../models/node_profile.dart';
|
import '../../models/node_profile.dart';
|
||||||
import '../../models/osm_node.dart';
|
import '../../models/osm_node.dart';
|
||||||
import '../../app_state.dart';
|
import '../../app_state.dart';
|
||||||
import '../network_status.dart';
|
|
||||||
|
|
||||||
/// Fetches surveillance nodes from the direct OSM API using bbox query.
|
/// 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).
|
/// This is a fallback for when Overpass is not available (e.g., sandbox mode).
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import 'dart:typed_data';
|
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
|
||||||
|
|||||||
@@ -54,23 +54,6 @@ class Uploader {
|
|||||||
return UploadResult.failure(errorMessage: errorMsg);
|
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
|
// Use the user's changeset comment, with XML sanitization
|
||||||
final sanitizedComment = _sanitizeXmlText(p.changesetComment);
|
final sanitizedComment = _sanitizeXmlText(p.changesetComment);
|
||||||
final csXml = '''
|
final csXml = '''
|
||||||
|
|||||||
@@ -140,16 +140,6 @@ class SessionState extends ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _profileMatchesTags(NodeProfile profile, Map<String, String> 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
|
/// Calculate additional existing tags for a given profile change
|
||||||
Map<String, String> _calculateAdditionalExistingTags(NodeProfile? newProfile, OsmNode originalNode) {
|
Map<String, String> _calculateAdditionalExistingTags(NodeProfile? newProfile, OsmNode originalNode) {
|
||||||
final additionalTags = <String, String>{};
|
final additionalTags = <String, String>{};
|
||||||
@@ -479,7 +469,7 @@ class SessionState extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Generate a default changeset comment for a submission
|
/// Generate a default changeset comment for a submission
|
||||||
/// Handles special case of <Existing tags> profile by using "a" instead
|
/// Handles special case of `<Existing tags>` profile by using "a" instead
|
||||||
String _generateDefaultChangesetComment({
|
String _generateDefaultChangesetComment({
|
||||||
required NodeProfile? profile,
|
required NodeProfile? profile,
|
||||||
required UploadOperation operation,
|
required UploadOperation operation,
|
||||||
|
|||||||
@@ -4,15 +4,11 @@ import 'package:flutter_map_animations/flutter_map_animations.dart';
|
|||||||
import 'package:latlong2/latlong.dart';
|
import 'package:latlong2/latlong.dart';
|
||||||
import 'package:provider/provider.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/offline_area_service.dart';
|
||||||
import '../services/network_status.dart';
|
|
||||||
|
|
||||||
import '../models/osm_node.dart';
|
import '../models/osm_node.dart';
|
||||||
import '../models/node_profile.dart';
|
|
||||||
import '../models/suspected_location.dart';
|
import '../models/suspected_location.dart';
|
||||||
import '../models/tile_provider.dart';
|
|
||||||
import '../state/session_state.dart';
|
|
||||||
import 'debouncer.dart';
|
import 'debouncer.dart';
|
||||||
import 'node_provider_with_cache.dart';
|
import 'node_provider_with_cache.dart';
|
||||||
import 'map/map_overlays.dart';
|
import 'map/map_overlays.dart';
|
||||||
@@ -170,9 +166,7 @@ class MapViewState extends State<MapView> {
|
|||||||
} catch (_) {
|
} catch (_) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return mapBounds != null
|
return NodeProviderWithCache.instance.getCachedNodesForBounds(mapBounds);
|
||||||
? NodeProviderWithCache.instance.getCachedNodesForBounds(mapBounds)
|
|
||||||
: [];
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('[MapView] Could not get nearby nodes: $e');
|
debugPrint('[MapView] Could not get nearby nodes: $e');
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ void main() {
|
|||||||
data = json.decode(content) as Map<String, dynamic>;
|
data = json.decode(content) as Map<String, dynamic>;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
fail('$name is not valid JSON: $e');
|
fail('$name is not valid JSON: $e');
|
||||||
return; // unreachable, keeps analyzer happy
|
|
||||||
}
|
}
|
||||||
expect(
|
expect(
|
||||||
data['language'],
|
data['language'],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../../lib/services/network_status.dart';
|
import 'package:deflockapp/services/network_status.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('NetworkStatus', () {
|
group('NetworkStatus', () {
|
||||||
|
|||||||
Reference in New Issue
Block a user