mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-06-29 17:49:59 +02:00
refactor: use UserAgentClient for OSM API fetch, remove redundant comments
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Claude Code
parent
480f99b360
commit
191b5ccae0
@@ -290,7 +290,6 @@ class _HomeScreenState extends State<HomeScreen> 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<HomeScreen> 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);
|
||||
|
||||
@@ -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<OsmNode?> _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);
|
||||
|
||||
Reference in New Issue
Block a user