ArtifactNode class

AST node representing an AI-generated artifact

Artifacts are standalone pieces of content (code, documents, etc.) that can be displayed, copied, or downloaded separately.

Supports the Claude-style artifact syntax:

<artifact identifier="unique-id" type="code" language="python" title="Hello World">
print("Hello, World!")
</artifact>
Inheritance

Constructors

ArtifactNode({required String identifier, required ArtifactType artifactType, required String content, String? title, String? language, String? customType})
Creates a new artifact node
const

Properties

artifactType ArtifactType
The type of artifact
final
content String
The artifact content
final
customType String?
Custom type name when artifactType is ArtifactType.custom
final
hashCode int
The hash code for this object.
no setterinherited
identifier String
Unique identifier for this artifact
final
language String?
Programming language for code artifacts
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
Optional title for display
final
type String
The type identifier for this node
no setteroverride

Methods

copyWith({String? identifier, ArtifactType? artifactType, String? customType, String? content, String? title, String? language}) ArtifactNode
Creates a copy of this node
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this node to a JSON representation
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited