File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,23 @@ import 'package:flutter_html/flutter_html.dart';
5
5
import 'package:list_counter/list_counter.dart' ;
6
6
7
7
class ListProcessing {
8
+ static final dash = CounterStyle .define (
9
+ name: 'dash' ,
10
+ system: System .cyclic,
11
+ symbols: ['—' ],
12
+ suffix: ' ' ,
13
+ );
14
+
15
+ static final none = CounterStyle .define (
16
+ name: 'none' ,
17
+ system: System .cyclic,
18
+ symbols: ['' ],
19
+ suffix: '' ,
20
+ );
21
+
8
22
static StyledElement processLists (StyledElement tree) {
23
+ CounterStyleRegistry .register (none);
24
+ CounterStyleRegistry .register (dash);
9
25
tree = _preprocessListMarkers (tree);
10
26
tree = _processListCounters (tree);
11
27
tree = _processListMarkers (tree);
@@ -96,6 +112,9 @@ class ListProcessing {
96
112
/// [_processListMarkers] finally applies the marker content to the tree
97
113
/// as a [Marker] on the [Style] object.
98
114
static StyledElement _processListMarkers (StyledElement tree) {
115
+ if (tree.name == 'ul' && tree.style.listStyleType? .counterStyle == 'none' ){
116
+ tree.style.padding = null ;
117
+ }
99
118
if (tree.style.display == Display .listItem) {
100
119
final listStyleType = tree.style.listStyleType ?? ListStyleType .decimal;
101
120
final counterStyle = CounterStyleRegistry .lookup (
Original file line number Diff line number Diff line change @@ -612,6 +612,7 @@ enum ListStyleType {
612
612
cjkEarthlyBranch ('cjk-earthly-branch' ),
613
613
cjkHeavenlyStem ('cjk-heavenly-stem' ),
614
614
cjkIdeographic ('cjk-ideographic' ),
615
+ dash ('dash' ),
615
616
decimal ('decimal' ),
616
617
decimalLeadingZero ('decimal-leading-zero' ),
617
618
devanagari ('devanagari' ),
You can’t perform that action at this time.
0 commit comments