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. [...]
read-only, override
isInline bool
Returns true if this is an inline-scoped attribute.
read-only
isUnset bool
Returns true if this attribute is an unset attribute.
read-only
key String
Unique key of this attribute.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scope NotusAttributeScope
Scope of this attribute.
final
unset NotusAttribute<T>
Returns special "unset" version of this attribute. [...]
read-only, override
value → T
Value of this attribute. [...]
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toJson() Map<String, dynamic>
toString() String
Returns 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.
read-only
code NotusAttribute<String>
Alias for NotusAttribute.block.code.
read-only
h1 NotusAttribute<int>
Alias for NotusAttribute.heading.level1.
read-only
h2 NotusAttribute<int>
Alias for NotusAttribute.heading.level2.
read-only
h3 NotusAttribute<int>
Alias for NotusAttribute.heading.level3.
read-only
ol NotusAttribute<String>
Alias for NotusAttribute.block.numberList.
read-only
ul NotusAttribute<String>
Alias for NotusAttribute.block.bulletList.
read-only

Constants

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