mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-09-28 12:02:02 +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
co-authored by
Claude Opus 4.6
parent
480f99b360
commit
191b5ccae0
@@ -290,7 +290,6 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _handleNodeDeepLink(OsmNode node) {
|
void _handleNodeDeepLink(OsmNode node) {
|
||||||
// Fly to node at zoom 16
|
|
||||||
try {
|
try {
|
||||||
_mapController.animateTo(
|
_mapController.animateTo(
|
||||||
dest: node.coord,
|
dest: node.coord,
|
||||||
@@ -302,7 +301,6 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
|||||||
debugPrint('[HomeScreen] Could not animate to deep link node: $e');
|
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), () {
|
Future.delayed(const Duration(milliseconds: 700), () {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
openNodeTagSheet(node);
|
openNodeTagSheet(node);
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import 'dart:async';
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:app_links/app_links.dart';
|
import 'package:app_links/app_links.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:http/http.dart' as http;
|
|
||||||
import 'package:latlong2/latlong.dart';
|
import 'package:latlong2/latlong.dart';
|
||||||
|
|
||||||
import '../models/node_profile.dart';
|
import '../models/node_profile.dart';
|
||||||
import '../models/operator_profile.dart';
|
import '../models/operator_profile.dart';
|
||||||
import '../models/osm_node.dart';
|
import '../models/osm_node.dart';
|
||||||
|
import 'http_client.dart';
|
||||||
import 'profile_import_service.dart';
|
import 'profile_import_service.dart';
|
||||||
import 'operator_profile_import_service.dart';
|
import 'operator_profile_import_service.dart';
|
||||||
import '../screens/profile_editor.dart';
|
import '../screens/profile_editor.dart';
|
||||||
@@ -107,7 +107,8 @@ class DeepLinkService {
|
|||||||
Future<OsmNode?> _fetchNodeById(int nodeId) async {
|
Future<OsmNode?> _fetchNodeById(int nodeId) async {
|
||||||
try {
|
try {
|
||||||
final url = Uri.parse('https://api.openstreetmap.org/api/0.6/node/$nodeId.json');
|
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;
|
if (response.statusCode != 200) return null;
|
||||||
|
|
||||||
final json = jsonDecode(response.body);
|
final json = jsonDecode(response.body);
|
||||||
|
|||||||
Reference in New Issue
Block a user