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:
- NotusAttribute.bold
- NotusAttribute.italic
- NotusAttribute.underline
- NotusAttribute.strikethrough
- NotusAttribute.link
- NotusAttribute.fontSize
- NotusAttribute.fontFamily
- NotusAttribute.color
- NotusAttribute.backgroundColor
- NotusAttribute.heading
- NotusAttribute.checked
- NotusAttribute.indent
- NotusAttribute.alignment
- NotusAttribute.block
- 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 → 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 -
center
→ NotusAttribute<
String> -
Alias for
NotusAttribute.alignment.center
.no setter -
cl
→ NotusAttribute<
String> -
Alias for
NotusAttribute.block.checkList
.no setter -
code
→ NotusAttribute<
String> -
Alias for
NotusAttribute.block.code
.no setter -
end
→ NotusAttribute<
String> -
Alias for
NotusAttribute.alignment.end
.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 -
justify
→ NotusAttribute<
String> -
Alias for
NotusAttribute.alignment.justify
.no setter -
ol
→ NotusAttribute<
String> -
Alias for
NotusAttribute.block.numberList
.no setter -
ul
→ NotusAttribute<
String> -
Alias for
NotusAttribute.block.bulletList
.no setter
Constants
- alignment → const AlignmentAttributeBuilder
- Alignment style attribute.
- backgroundColor → const BackgroundColorAttributeBuilder
- Background color style attribute.
- block → const BlockAttributeBuilder
- Block attribute
- bold → const _BoldAttribute
- Bold style attribute.
- checked → const _CheckedAttribute
- Checked style attribute.
- color → const ColorAttributeBuilder
- Color style attribute.
- fontFamily → const FontFamilyAttributeBuilder
- Font family attribute.
- fontSize → const FontSizeAttributeBuilder
- Font size attribute.
- heading → const HeadingAttributeBuilder
- Heading style attribute.
- indent → const IndentAttributeBuilder
- Indent style attribute.
- italic → const _ItalicAttribute
- Italic style attribute.
- link → const LinkAttributeBuilder
- Link style attribute.
- strikethrough → const _StrikethroughAttribute
- Strikethrough style attribute.
- underline → const _UnderlineAttribute
- Underline style attribute.