getSimpleLogs method

Future<List<SimpleOverlayLog>> getSimpleLogs()

Reads all simple logs from persistent storage.

The logs are read from a file named simple_logs.jsonl within the application support directory. The logs are read in JSON Lines format.

The logs are read asynchronously in a separate isolate to avoid blocking the main isolate.

The logs are returned as a list of SimpleOverlayLog objects.

Implementation

Future<List<SimpleOverlayLog>> getSimpleLogs() async {
  final dir = await getApplicationSupportDirectory();
  final rawLogs = await Isolate.run(
      () => SimpleOverlayIsolateLogWriter.readLogs(dir.path, 'simple'));
  return rawLogs.map((e) => SimpleOverlayLog.fromJson(e)).toList();
}