TypeDefinition constructor

TypeDefinition(
  1. String? name, {
  2. String? subtype,
  3. bool? isAmbiguous,
  4. Node? astNode,
})

Implementation

TypeDefinition(this.name, {this.subtype, this.isAmbiguous, Node? astNode}) {
  if (subtype == null) {
    _isPrimitive = isPrimitiveType(name);
    if (name == 'int' && isASTLiteralDouble(astNode)) {
      name = 'double';
    }
  } else {
    _isPrimitive = isPrimitiveType('$name<$subtype>');
  }
  isAmbiguous ??= false;
  if (PubspecUtils.nullSafeSupport && name != 'dynamic') {
    if (subtype == null) {
      name = '$name?';
    } else {
      name = '$name';
    }
  }
}