@@ -1004,10 +1004,7 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
10041004 final dart_ast.NamedType ? namedType =
10051005 getFirstChildOfType< dart_ast.NamedType > (parameter);
10061006 if (namedType != null ) {
1007- // TODO(stuartmorgan): Replace `name` when adopting the next version of
1008- // analyzer.
1009- // ignore: deprecated_member_use
1010- final String argTypeBaseName = namedType.name.name;
1007+ final String argTypeBaseName = _getNamedTypeQualifiedName (namedType);
10111008 final bool isNullable = namedType.question != null ;
10121009 final List <TypeDeclaration > argTypeArguments =
10131010 typeAnnotationsToTypeArguments (namedType.typeArguments);
@@ -1089,10 +1086,7 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
10891086 Method (
10901087 name: node.name.lexeme,
10911088 returnType: TypeDeclaration (
1092- // TODO(stuartmorgan): Replace `name` when adopting the next
1093- // version of analyzer.
1094- // ignore: deprecated_member_use
1095- baseName: returnType.name.name,
1089+ baseName: _getNamedTypeQualifiedName (returnType),
10961090 typeArguments:
10971091 typeAnnotationsToTypeArguments (returnType.typeArguments),
10981092 isNullable: returnType.question != null ),
@@ -1141,10 +1135,7 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
11411135 for (final Object x in typeArguments.childEntities) {
11421136 if (x is dart_ast.NamedType ) {
11431137 result.add (TypeDeclaration (
1144- // TODO(stuartmorgan): Replace `name` when adopting the next
1145- // version of analyzer.
1146- // ignore: deprecated_member_use
1147- baseName: x.name.name,
1138+ baseName: _getNamedTypeQualifiedName (x),
11481139 isNullable: x.question != null ,
11491140 typeArguments: typeAnnotationsToTypeArguments (x.typeArguments)));
11501141 }
@@ -1174,10 +1165,7 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
11741165 final dart_ast.TypeArgumentList ? typeArguments = type.typeArguments;
11751166 _currentClass! .fields.add (NamedType (
11761167 type: TypeDeclaration (
1177- // TODO(stuartmorgan): Replace `name` when adopting the next
1178- // version of analyzer.
1179- // ignore: deprecated_member_use
1180- baseName: type.name.name,
1168+ baseName: _getNamedTypeQualifiedName (type),
11811169 isNullable: type.question != null ,
11821170 typeArguments: typeAnnotationsToTypeArguments (typeArguments),
11831171 ),
@@ -1223,6 +1211,14 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
12231211 node.visitChildren (this );
12241212 return null ;
12251213 }
1214+
1215+ static String _getNamedTypeQualifiedName (dart_ast.NamedType node) {
1216+ final dart_ast.ImportPrefixReference ? importPrefix = node.importPrefix;
1217+ if (importPrefix != null ) {
1218+ return '${importPrefix .name .lexeme }.${node .name2 .lexeme }' ;
1219+ }
1220+ return node.name2.lexeme;
1221+ }
12261222}
12271223
12281224int ? _calculateLineNumberNullable (String contents, int ? offset) {
0 commit comments