getClassFromFile method
Implementation
ClassDeclaration? getClassFromFile(String className, Uri fileUri) {
try {
return _getFileAstRoot(fileUri).declarations
.whereType<ClassDeclaration>()
.firstWhere((c) => c.namePart.typeName.toString() == className);
} catch (e) {
if (e is StateError ||
e is TypeError ||
e is ArgumentError ||
e is UnsupportedError) {
return null;
}
rethrow;
}
}