logDebug method

Future<void> logDebug(
  1. String feature,
  2. String log
)
override

Implementation

Future<void> logDebug(String feature, String log) async {
  final prefs = await SharedPreferences.getInstance();
  final logDebug = LogObject(feature: feature, log: log);

  // Get existing logs
  List<String> logsJson = prefs.getStringList('logs') ?? [];

  // Add new log as JSON string
  logsJson.add(jsonEncode(logDebug.toJson()));

  // Save back to SharedPreferences
  await prefs.setStringList('logs', logsJson);
}