1
- import 'dart:collection' ;
2
-
3
1
import 'package:quiver/core.dart' ;
4
2
5
3
enum AttributeScope {
@@ -16,7 +14,7 @@ class Attribute<T> {
16
14
final AttributeScope scope;
17
15
final T value;
18
16
19
- static final Map <String , Attribute > _registry = LinkedHashMap . of ( {
17
+ static final Map <String , Attribute > _registry = {
20
18
Attribute .bold.key: Attribute .bold,
21
19
Attribute .italic.key: Attribute .italic,
22
20
Attribute .underline.key: Attribute .underline,
@@ -28,16 +26,16 @@ class Attribute<T> {
28
26
Attribute .background.key: Attribute .background,
29
27
Attribute .placeholder.key: Attribute .placeholder,
30
28
Attribute .header.key: Attribute .header,
29
+ Attribute .indent.key: Attribute .indent,
31
30
Attribute .align.key: Attribute .align,
32
31
Attribute .list.key: Attribute .list,
33
32
Attribute .codeBlock.key: Attribute .codeBlock,
34
33
Attribute .blockQuote.key: Attribute .blockQuote,
35
- Attribute .indent.key: Attribute .indent,
36
34
Attribute .width.key: Attribute .width,
37
35
Attribute .height.key: Attribute .height,
38
36
Attribute .style.key: Attribute .style,
39
37
Attribute .token.key: Attribute .token,
40
- }) ;
38
+ };
41
39
42
40
static final BoldAttribute bold = BoldAttribute ();
43
41
@@ -90,22 +88,22 @@ class Attribute<T> {
90
88
Attribute .placeholder.key,
91
89
};
92
90
93
- static final Set <String > blockKeys = LinkedHashSet . of ( {
91
+ static final Set <String > blockKeys = {
94
92
Attribute .header.key,
93
+ Attribute .indent.key,
95
94
Attribute .align.key,
96
95
Attribute .list.key,
97
96
Attribute .codeBlock.key,
98
97
Attribute .blockQuote.key,
99
- Attribute .indent.key,
100
- });
98
+ };
101
99
102
- static final Set <String > blockKeysExceptHeader = LinkedHashSet . of ( {
100
+ static final Set <String > blockKeysExceptHeader = {
103
101
Attribute .list.key,
102
+ Attribute .indent.key,
104
103
Attribute .align.key,
105
104
Attribute .codeBlock.key,
106
105
Attribute .blockQuote.key,
107
- Attribute .indent.key,
108
- });
106
+ };
109
107
110
108
static Attribute <int ?> get h1 => HeaderAttribute (level: 1 );
111
109
@@ -174,18 +172,6 @@ class Attribute<T> {
174
172
return attribute;
175
173
}
176
174
177
- static int getRegistryOrder (Attribute attribute) {
178
- var order = 0 ;
179
- for (final attr in _registry.values) {
180
- if (attr.key == attribute.key) {
181
- break ;
182
- }
183
- order++ ;
184
- }
185
-
186
- return order;
187
- }
188
-
189
175
static Attribute clone (Attribute origin, dynamic value) {
190
176
return Attribute (origin.key, origin.scope, value);
191
177
}
0 commit comments