parseFileByPath function

CompilationUnit? parseFileByPath(
  1. String filePath
)

Implementation

CompilationUnit? parseFileByPath(String filePath) {
  final file = File(filePath);
  if (!file.existsSync()) return null;
  final content = file.readAsStringSync();
  return parseString(content: content, throwIfDiagnostics: false).unit;
}