DocxHeader class

Header content for a document section.

Simple

DocxHeader.text('My Document')

Styled

DocxHeader.styled('Title', color: DocxColor.blue, fontSize: 14)

Rich Content

DocxHeader(children: [
  DocxParagraph(children: [
    DocxText.bold('Company Name'),
    DocxText(' - Confidential'),
  ]),
])
Inheritance

Constructors

DocxHeader({required List<DocxBlock> children, String? id})
const
DocxHeader.styled(String text, {DocxColor? color, double? fontSize, String? fontFamily, bool bold = false, DocxAlign align = DocxAlign.center})
Styled text header.
factory
DocxHeader.text(String text, {DocxAlign align = DocxAlign.center})
Simple text header.
factory

Properties

children List<DocxBlock>
final
hashCode int
The hash code for this object.
no setterinherited
id String?
Unique identifier for this node (for debugging/tracking).
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

accept(DocxVisitor visitor) → void
Accepts a visitor for traversing the AST.
override
buildXml(XmlBuilder builder) → void
Converts this node to its XML representation.
override
copyWith({List<DocxBlock>? children}) DocxHeader
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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