hasConstructor method
If this class possesses a factory such as fromRest
Implementation
@protected
bool hasConstructor(DartType type) {
final classElement = type.element as ClassElement;
return classElement.getNamedConstructor(constructorName) != null;
}