mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-02-12 16:52:51 +00:00
Merge pull request #45 from dougborg/pr/fix-upstream-lint
Fix lint warnings after RadioGroup migration
This commit is contained in:
@@ -813,7 +813,7 @@ class AppState extends ChangeNotifier {
|
||||
// ---------- Utility Methods ----------
|
||||
|
||||
/// 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({
|
||||
required NodeProfile? profile,
|
||||
required UploadOperation operation,
|
||||
|
||||
@@ -266,7 +266,7 @@ class NodeProfile {
|
||||
int get hashCode => id.hashCode;
|
||||
|
||||
/// 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
|
||||
static NodeProfile createExistingTagsProfile(OsmNode node) {
|
||||
// Calculate FOV from existing direction ranges if applicable
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter_map/flutter_map.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
|
||||
///
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
|
||||
@@ -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 = '''
|
||||
|
||||
@@ -140,16 +140,6 @@ class SessionState extends ChangeNotifier {
|
||||
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
|
||||
Map<String, String> _calculateAdditionalExistingTags(NodeProfile? newProfile, OsmNode originalNode) {
|
||||
final additionalTags = <String, String>{};
|
||||
@@ -479,7 +469,7 @@ class SessionState extends ChangeNotifier {
|
||||
}
|
||||
|
||||
/// 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({
|
||||
required NodeProfile? profile,
|
||||
required UploadOperation operation,
|
||||
|
||||
@@ -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<MapView> {
|
||||
} 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 [];
|
||||
|
||||
@@ -62,7 +62,6 @@ void main() {
|
||||
data = json.decode(content) as Map<String, dynamic>;
|
||||
} catch (e) {
|
||||
fail('$name is not valid JSON: $e');
|
||||
return; // unreachable, keeps analyzer happy
|
||||
}
|
||||
expect(
|
||||
data['language'],
|
||||
|
||||
@@ -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', () {
|
||||
|
||||
Reference in New Issue
Block a user