CodeBlock class final

A fenced code block with optional language hint.

CodeBlock represents preformatted code. It is produced from paragraphs with the "Code" style, monospace font runs, or custom style mappings.

Markdown Output

Renders as a fenced code block:

```dart
void main() => print('Hello');
```

See also:

Inheritance
Annotations
  • @immutable

Constructors

CodeBlock({required String text, String? language, NodeMeta? meta})
Creates a code block with the given text and optional language.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
language String?
Optional language identifier for syntax highlighting (e.g., "dart", "python").
final
meta NodeMeta?
Debug metadata (source location, attributes).
finalinherited
props List<Object?>
Semantic properties used for equality and hashing.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
The code content (whitespace and newlines preserved).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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