mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-08-14 15:10:36 +02:00
Replace print() with debugPrint() across codebase
Fixes avoid_print lint warnings by using debugPrint which respects release mode and avoids console overflow on mobile platforms. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
3dada20ec2
commit
4fddd8e807
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:oauth2_client/oauth2_client.dart';
|
||||
import 'package:oauth2_client/oauth2_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
@@ -98,7 +99,7 @@ class AuthService {
|
||||
_displayName = await _fetchUsername(token.accessToken!);
|
||||
return _displayName;
|
||||
} catch (e) {
|
||||
print('AuthService: OAuth login failed: $e');
|
||||
debugPrint('AuthService: OAuth login failed: $e');
|
||||
log('OAuth login failed: $e');
|
||||
rethrow;
|
||||
}
|
||||
@@ -126,7 +127,7 @@ class AuthService {
|
||||
_displayName = await _fetchUsername(accessToken);
|
||||
return _displayName;
|
||||
} catch (e) {
|
||||
print('AuthService: Error restoring login with stored token: $e');
|
||||
debugPrint('AuthService: Error restoring login with stored token: $e');
|
||||
log('Error restoring login with stored token: $e');
|
||||
// Token might be expired or invalid, clear it
|
||||
await logout();
|
||||
@@ -192,7 +193,7 @@ class AuthService {
|
||||
final displayName = userData['user']?['display_name'];
|
||||
return displayName;
|
||||
} catch (e) {
|
||||
print('AuthService: Error fetching username: $e');
|
||||
debugPrint('AuthService: Error fetching username: $e');
|
||||
log('Error fetching username: $e');
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import '../models/osm_node.dart';
|
||||
import 'package:flutter_map/flutter_map.dart' show LatLngBounds;
|
||||
@@ -85,7 +86,7 @@ class NodeCache {
|
||||
/// Remove a node by ID from the cache (used for successful deletions)
|
||||
void removeNodeById(int nodeId) {
|
||||
if (_nodes.remove(nodeId) != null) {
|
||||
print('[NodeCache] Removed node $nodeId from cache (successful deletion)');
|
||||
debugPrint('[NodeCache] Removed node $nodeId from cache (successful deletion)');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,19 +112,19 @@ class NodeCache {
|
||||
}
|
||||
|
||||
if (nodesToRemove.isNotEmpty) {
|
||||
print('[NodeCache] Removed ${nodesToRemove.length} temp nodes at coordinate ${coord.latitude}, ${coord.longitude}');
|
||||
debugPrint('[NodeCache] Removed ${nodesToRemove.length} temp nodes at coordinate ${coord.latitude}, ${coord.longitude}');
|
||||
}
|
||||
}
|
||||
|
||||
/// Remove a specific temporary node by its ID (for queue item-specific cleanup)
|
||||
void removeTempNodeById(int tempNodeId) {
|
||||
if (tempNodeId >= 0) {
|
||||
print('[NodeCache] Warning: Attempted to remove non-temp node ID $tempNodeId');
|
||||
debugPrint('[NodeCache] Warning: Attempted to remove non-temp node ID $tempNodeId');
|
||||
return;
|
||||
}
|
||||
|
||||
if (_nodes.remove(tempNodeId) != null) {
|
||||
print('[NodeCache] Removed specific temp node $tempNodeId from cache');
|
||||
debugPrint('[NodeCache] Removed specific temp node $tempNodeId from cache');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user