isType function Null safety

bool isType(
  1. DartType ty,
  2. String name,
  3. String packageUri,
  4. ImportModel imports
)

Implementation

bool isType(DartType ty, String name, String packageUri, ImportModel imports) {
  final tyLib = ty.element!.librarySource?.uri;
  return ty.element!.name == name && tyLib.toString() == packageUri;
}