Fix analyzer compatibility

This commit is contained in:
Ming Ming 2024-05-21 23:38:47 +08:00
parent e18ffce8a3
commit 65b66d306f
2 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ class DriftTableSortGenerator extends GeneratorForAnnotation<DriftTableSort> {
final driftTableSort =
DriftTableSort(annotation.read("dbClass").stringValue);
final clazz = element;
if (!clazz.allSupertypes.any((t) => t.element2.name == "Table")) {
if (!clazz.allSupertypes.any((t) => t.element.name == "Table")) {
print("Not a drift table");
return null;
}
@ -63,7 +63,7 @@ extension ${sortEnumName}IterableExtension on Iterable<$sortEnumName> {
return false;
}
// it's a very rough way but well...
if (field.type.element2?.name?.endsWith("Column") ?? false) {
if (field.type.element?.name?.endsWith("Column") ?? false) {
return true;
}
return false;

View file

@ -29,7 +29,7 @@ extension _\$${clazz.name}NpLog on ${clazz.name} {
} else if (element is ExtensionElement) {
final extension = element;
return """
extension _\$${extension.name}NpLog on ${extension.extendedType.element2!.name} {
extension _\$${extension.name}NpLog on ${extension.extendedType.element!.name} {
// ignore: unused_element
Logger get _log => log;