perf: nettoyage code mort, sécurisation clé, et remplacement des prints

This commit is contained in:
ElPoyo
2026-05-26 13:40:33 +02:00
parent 0bbc77ffc8
commit a59deb19a9
7 changed files with 31 additions and 141 deletions
+5 -5
View File
@@ -40,7 +40,7 @@ class AlertProvider extends ChangeNotifier {
return AlertModel.fromMap(data as Map<String, dynamic>, data['id'] as String);
}).toList();
} catch (e) {
print('Error loading alerts: $e');
if (kDebugMode) debugPrint('Error loading alerts: $e');
_alerts = [];
} finally {
_isLoading = false;
@@ -67,7 +67,7 @@ class AlertProvider extends ChangeNotifier {
notifyListeners();
}
} catch (e) {
print('Error marking alert as read: $e');
if (kDebugMode) debugPrint('Error marking alert as read: $e');
rethrow;
}
}
@@ -81,7 +81,7 @@ class AlertProvider extends ChangeNotifier {
_alerts.removeWhere((a) => a.id == alertId);
notifyListeners();
} catch (e) {
print('Error deleting alert: $e');
if (kDebugMode) debugPrint('Error deleting alert: $e');
rethrow;
}
}
@@ -95,7 +95,7 @@ class AlertProvider extends ChangeNotifier {
await markAsRead(alertId);
}
} catch (e) {
print('Error marking all alerts as read: $e');
if (kDebugMode) debugPrint('Error marking all alerts as read: $e');
rethrow;
}
}
@@ -109,7 +109,7 @@ class AlertProvider extends ChangeNotifier {
await deleteAlert(alertId);
}
} catch (e) {
print('Error deleting read alerts: $e');
if (kDebugMode) debugPrint('Error deleting read alerts: $e');
rethrow;
}
}