ParchmentAttribute<T> class

Style attribute applicable to a segment of a Parchment document.

All supported attributes are available via static fields on this class. Here is an example of applying styles to a document:

void makeItPretty(Parchment document) {
  // Format 5 characters at position 0 as bold
  document.format(0, 5, ParchmentAttribute.bold);
  // Similarly for italic
  document.format(0, 5, ParchmentAttribute.italic);
  // Format first line as a heading (h1)
  // Note that there is no need to specify character range of the whole
  // line. Simply set index position to anywhere within the line and
  // length to 0.
  document.format(0, 0, ParchmentAttribute.h1);
}

List of supported attributes:

Implemented types

Properties

hashCode int
The hash code for this object.
no setteroverride
isInline bool
Returns true if this is an inline-scoped attribute.
no setter
isUnset bool
Returns true if this attribute is an unset attribute.
no setter
key String
Unique key of this attribute.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scope ParchmentAttributeScope
Scope of this attribute.
final
unset ParchmentAttribute<T>
Returns special "unset" version of this attribute.
no setteroverride
value → T?
Value of this attribute.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override
withValue(T? value) ParchmentAttribute<T>
override

Operators

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

Static Properties

bq ParchmentAttribute<String>
Alias for ParchmentAttribute.block.quote.
no setter
center ParchmentAttribute<String>
Alias for ParchmentAttribute.alignment.center
no setter
cl ParchmentAttribute<String>
Alias for ParchmentAttribute.block.checkList.
no setter
code ParchmentAttribute<String>
Alias for ParchmentAttribute.block.code.
no setter
h1 ParchmentAttribute<int>
Alias for ParchmentAttribute.heading.level1.
no setter
h2 ParchmentAttribute<int>
Alias for ParchmentAttribute.heading.level2.
no setter
h3 ParchmentAttribute<int>
Alias for ParchmentAttribute.heading.level3.
no setter
h4 ParchmentAttribute<int>
Alias for ParchmentAttribute.heading.level4.
no setter
h5 ParchmentAttribute<int>
Alias for ParchmentAttribute.heading.level5.
no setter
h6 ParchmentAttribute<int>
Alias for ParchmentAttribute.heading.level5.
no setter
justify ParchmentAttribute<String>
Alias for ParchmentAttribute.alignment.justify
no setter
left ParchmentAttribute<String>
Alias for ParchmentAttribute.alignment.unset
no setter
ol ParchmentAttribute<String>
Alias for ParchmentAttribute.block.numberList.
no setter
Alias for ParchmentAttribute.alignment.right
no setter
rtl ParchmentAttribute<String>
Alias for ParchmentAttribute.direction.rtl.
no setter
ul ParchmentAttribute<String>
Alias for ParchmentAttribute.block.bulletList.
no setter

Constants

alignment → const AlignmentAttributeBuilder
Alignment attribute
backgroundColor → const BackgroundColorAttributeBuilder
Background color attribute.
block → const BlockAttributeBuilder
Block attribute
bold → const _BoldAttribute
Bold style attribute.
checked → const _CheckedAttribute
Applies checked style to a line of text in checklist block.
direction → const DirectionAttributeBuilder
Direction attribute
foregroundColor → const ForegroundColorAttributeBuilder
Foreground color attribute.
heading → const HeadingAttributeBuilder
Heading style attribute.
indent → const IndentAttributeBuilder
Indent attribute
inlineCode → const _InlineCodeAttribute
Inline code style attribute.
italic → const _ItalicAttribute
Italic style attribute.
Link style attribute.
strikethrough → const _StrikethroughAttribute
Strikethrough style attribute.
underline → const _UnderlineAttribute
Underline style attribute.