getClassFromFile method
Implementation
ClassDeclaration? getClassFromFile(String className, Uri fileUri) {
try {
return _getFileAstRoot(fileUri)
.declarations
.whereType<ClassDeclaration>()
.firstWhere((c) => c.name.value() == className);
} catch (e) {
if (e is StateError || e is TypeError) {
print(e);
return null;
}
throw e;
}
}