getAllLines function

List<String> getAllLines(
  1. String path, {
  2. bool ignoreDjDirectory = false,
})

Implementation

List<String> getAllLines(
  String path, {
  bool ignoreDjDirectory = false,
}) {
  var allLines = <String>[];

  var directory = Directory(path);

  directory.listSync(recursive: false).forEach((f) {
    print(f.path);
    if (f is File) {
      allLines += f.readAsLinesSync();
    } else if (f is Directory) {
      if (!(ignoreDjDirectory && f.path.endsWith('\\$DJS_DIRECTORY_NAME'))) {
        print('Goging down in ${f.path}');
        allLines += getAllLines(f.absolute.path);
      }
    }
  });

  return allLines;
}