From 191b5ccae048c9dfaec2d183840120342cb1e89b Mon Sep 17 00:00:00 2001 From: flockhopperdev Date: Mon, 1 Jun 2026 17:17:08 -0600 Subject: [PATCH] refactor: use UserAgentClient for OSM API fetch, remove redundant comments Co-Authored-By: Claude Opus 4.6 --- lib/screens/home_screen.dart | 2 -- lib/services/deep_link_service.dart | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index f97c0e2..c84eeab 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -290,7 +290,6 @@ class _HomeScreenState extends State with TickerProviderStateMixin { } void _handleNodeDeepLink(OsmNode node) { - // Fly to node at zoom 16 try { _mapController.animateTo( dest: node.coord, @@ -302,7 +301,6 @@ class _HomeScreenState extends State with TickerProviderStateMixin { debugPrint('[HomeScreen] Could not animate to deep link node: $e'); } - // Open the node details sheet after map animation settles Future.delayed(const Duration(milliseconds: 700), () { if (mounted) { openNodeTagSheet(node); diff --git a/lib/services/deep_link_service.dart b/lib/services/deep_link_service.dart index 30166f6..cdc7012 100644 --- a/lib/services/deep_link_service.dart +++ b/lib/services/deep_link_service.dart @@ -2,12 +2,12 @@ import 'dart:async'; import 'dart:convert'; import 'package:app_links/app_links.dart'; import 'package:flutter/material.dart'; -import 'package:http/http.dart' as http; import 'package:latlong2/latlong.dart'; import '../models/node_profile.dart'; import '../models/operator_profile.dart'; import '../models/osm_node.dart'; +import 'http_client.dart'; import 'profile_import_service.dart'; import 'operator_profile_import_service.dart'; import '../screens/profile_editor.dart'; @@ -107,7 +107,8 @@ class DeepLinkService { Future _fetchNodeById(int nodeId) async { try { final url = Uri.parse('https://api.openstreetmap.org/api/0.6/node/$nodeId.json'); - final response = await http.get(url); + final client = UserAgentClient(); + final response = await client.get(url); if (response.statusCode != 200) return null; final json = jsonDecode(response.body);