NotusAttribute<T> class

Style attribute applicable to a segment of a Notus document.

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

void makeItPretty(Notus document) {
  // Format 5 characters at position 0 as bold
  document.format(0, 5, NotusAttribute.bold);
  // Similarly for italic
  document.format(0, 5, NotusAttribute.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, NotusAttribute.h1);
}

List of supported attributes:

Implemented types
Implementers

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 NotusAttributeScope
Scope of this attribute.
final
unset NotusAttribute<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) NotusAttribute<T>
override

Operators

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

Static Properties

bq NotusAttribute<String>
Alias for NotusAttribute.block.quote.
no setter
code NotusAttribute<String>
Alias for NotusAttribute.block.code.
no setter
h1 NotusAttribute<int>
Alias for NotusAttribute.heading.level1.
no setter
h2 NotusAttribute<int>
Alias for NotusAttribute.heading.level2.
no setter
h3 NotusAttribute<int>
Alias for NotusAttribute.heading.level3.
no setter
ol NotusAttribute<String>
Alias for NotusAttribute.block.numberList.
no setter
ul NotusAttribute<String>
Alias for NotusAttribute.block.bulletList.
no setter

Constants

block → const BlockAttributeBuilder
Block attribute
bold → const _BoldAttribute
Bold style attribute.
embed → const EmbedAttributeBuilder
Embed style attribute.
heading → const HeadingAttributeBuilder
Heading style attribute.
italic → const _ItalicAttribute
Italic style attribute.
Link style attribute.