# isAbstractAndNoFactory method

bool isAbstractAndNoFactory()

Returns `true` if this definition is non-instantiable.

A non-instantiable definition is one that cannot be instantiated directly, such as a pod definition without a factory method or definition with an abstract class.

### Example

    if (podDef.isAbstractAndNoFactory()) {
      print("Pod is non-instantiable.");
    }

## Implementation

    bool isAbstractAndNoFactory() {
      final hasFactoryConstructor = type.getConstructors().any((c) => c.isFactory());
      final hasFactoryMethod = factoryMethod.methodName.isNotEmpty || factoryMethod.podName.isNotEmpty;

      // Non-instantiable if abstract and no factory constructor and no factory method
      if (type.isAbstract() && !hasFactoryConstructor && !hasFactoryMethod) {
        return true;
      }

      return false;
    }