FlutterJsonBuilder constructor Null safety

FlutterJsonBuilder(
  1. String srcDir,
  2. String distDir
)

Implementation

FlutterJsonBuilder(this.srcDir, this.distDir) {
  if (srcDir.endsWith("/")) srcDir = srcDir.substring(0, srcDir.length - 1);
  if (distDir.endsWith("/"))
    distDir = distDir.substring(0, distDir.length - 1);

  var src = Directory(srcDir);
  fileList = src
      .listSync(recursive: true)
      .where((element) => element is File)
      .toList();

  if (!Directory(distDir).existsSync()) {
    Directory(distDir).createSync(recursive: true);
  }
}