perf: nettoyage code mort, sécurisation clé, et remplacement des prints
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user