readFile function

Future<List<String>> readFile(
  1. String path,
  2. String filename
)

Read log file and return logs in List<String>

Implementation

Future<List<String>> readFile(String path, String filename) async {
  bool exists = await ckFileExists(path, filename);
  if (exists) {
    File file = _getFile(path, filename);
    String rawLog = await file.readAsString();

    List<String> logs = rawLog.split("\n");
    return logs;
  }
  return null;
}