diff --git a/lib/models/documents/attribute.dart b/lib/models/documents/attribute.dart index f3e8715c..4fae59b0 100644 --- a/lib/models/documents/attribute.dart +++ b/lib/models/documents/attribute.dart @@ -17,10 +17,10 @@ class Attribute { Attribute.underline.key: Attribute.underline, Attribute.strikeThrough.key: Attribute.strikeThrough, Attribute.link.key: Attribute.link, - Attribute.headerAttribute.key: Attribute.headerAttribute, - Attribute.listAttribute.key: Attribute.listAttribute, - Attribute.codeBlockAttribute.key: Attribute.codeBlockAttribute, - Attribute.blockQuoteAttribute.key: Attribute.blockQuoteAttribute, + Attribute.header.key: Attribute.header, + Attribute.list.key: Attribute.list, + Attribute.codeBlock.key: Attribute.codeBlock, + Attribute.blockQuote.key: Attribute.blockQuote, }; static BoldAttribute bold = BoldAttribute(); @@ -33,13 +33,23 @@ class Attribute { static LinkAttribute link = LinkAttribute(); - static HeaderAttribute headerAttribute = HeaderAttribute(1); + static HeaderAttribute header = HeaderAttribute(1); - static ListAttribute listAttribute = ListAttribute('ordered'); + static ListAttribute list = ListAttribute('ordered'); - static CodeBlockAttribute codeBlockAttribute = CodeBlockAttribute(); + static CodeBlockAttribute codeBlock = CodeBlockAttribute(); - static BlockQuoteAttribute blockQuoteAttribute = BlockQuoteAttribute(); + static BlockQuoteAttribute blockQuote = BlockQuoteAttribute(); + + static Attribute get h1 => header.level1; + + static Attribute get h2 => header.level2; + + static Attribute get h3 => header.level3; + + static Attribute get ul => list.bullet; + + static Attribute get ol => list.ordered; bool get isInline => scope == AttributeScope.INLINE; diff --git a/lib/models/documents/style.dart b/lib/models/documents/style.dart index 490f6107..6843ed50 100644 --- a/lib/models/documents/style.dart +++ b/lib/models/documents/style.dart @@ -14,7 +14,7 @@ class Style { } Map result = attributes.map((String key, dynamic value) { - var attr = Attribute.fromKeyValue(key, value); + Attribute attr = Attribute.fromKeyValue(key, value); return MapEntry(key, attr); }); return Style.attr(result);