@@ -154,84 +154,20 @@ CustomRender blockElementRender({Style? style, List<InlineSpan>? children}) =>
154
154
});
155
155
156
156
CustomRender listElementRender (
157
- {Style ? style, Widget ? child, List <InlineSpan >? children}) =>
158
- CustomRender .inlineSpan (
159
- inlineSpan: (context, buildChildren) => WidgetSpan (
160
- child: CssBoxWidget (
157
+ {Style ? style, Widget ? child, List <InlineSpan >? children}) {
158
+ return CustomRender .inlineSpan (
159
+ inlineSpan: (context, buildChildren) {
160
+ return WidgetSpan (
161
+ child: CssBoxWidget .withInlineSpanChildren (
161
162
key: context.key,
162
- style: style ?? context.tree. style,
163
+ style: style ?? context.style,
163
164
shrinkWrap: context.parser.shrinkWrap,
164
- child: Row (
165
- crossAxisAlignment: CrossAxisAlignment .start,
166
- mainAxisSize: MainAxisSize .min,
167
- textDirection: style? .direction ?? context.tree.style.direction,
168
- children: [
169
- (style? .listStylePosition ??
170
- context.tree.style.listStylePosition) ==
171
- ListStylePosition .outside
172
- ? Padding (
173
- padding: style? .padding? .nonNegative ??
174
- context.tree.style.padding? .nonNegative ??
175
- EdgeInsets .only (
176
- left: (style? .direction ??
177
- context.tree.style.direction) !=
178
- TextDirection .rtl
179
- ? 10.0
180
- : 0.0 ,
181
- right: (style? .direction ??
182
- context.tree.style.direction) ==
183
- TextDirection .rtl
184
- ? 10.0
185
- : 0.0 ),
186
- child:
187
- style? .markerContent ?? context.style.markerContent)
188
- : const SizedBox (height: 0 , width: 0 ),
189
- const Text ("\u 0020" ,
190
- textAlign: TextAlign .right,
191
- style: TextStyle (fontWeight: FontWeight .w400)),
192
- Expanded (
193
- child: Padding (
194
- padding: (style? .listStylePosition ??
195
- context.tree.style.listStylePosition) ==
196
- ListStylePosition .inside
197
- ? EdgeInsets .only (
198
- left: (style? .direction ??
199
- context.tree.style.direction) !=
200
- TextDirection .rtl
201
- ? 10.0
202
- : 0.0 ,
203
- right: (style? .direction ??
204
- context.tree.style.direction) ==
205
- TextDirection .rtl
206
- ? 10.0
207
- : 0.0 )
208
- : EdgeInsets .zero,
209
- child: CssBoxWidget .withInlineSpanChildren (
210
- children: _getListElementChildren (
211
- style? .listStylePosition ??
212
- context.tree.style.listStylePosition,
213
- buildChildren)
214
- ..insertAll (
215
- 0 ,
216
- context.tree.style.listStylePosition ==
217
- ListStylePosition .inside
218
- ? [
219
- WidgetSpan (
220
- alignment: PlaceholderAlignment .middle,
221
- child: style? .markerContent ??
222
- context.style.markerContent ??
223
- const SizedBox (height: 0 , width: 0 ))
224
- ]
225
- : []),
226
- style: style ?? context.style,
227
- ),
228
- ),
229
- ),
230
- ],
231
- ),
165
+ children: buildChildren (),
232
166
),
233
- ),
234
- );
167
+ );
168
+ },
169
+ );
170
+ }
235
171
236
172
CustomRender replacedElementRender (
237
173
{PlaceholderAlignment ? alignment,
@@ -517,20 +453,6 @@ Map<CustomRenderMatcher, CustomRender> generateDefaultRenders() {
517
453
};
518
454
}
519
455
520
- List <InlineSpan > _getListElementChildren (
521
- ListStylePosition ? position, Function () buildChildren) {
522
- List <InlineSpan > children = buildChildren.call ();
523
- if (position == ListStylePosition .inside) {
524
- const tabSpan = WidgetSpan (
525
- child: Text ("\t " ,
526
- textAlign: TextAlign .right,
527
- style: TextStyle (fontWeight: FontWeight .w400)),
528
- );
529
- children.insert (0 , tabSpan);
530
- }
531
- return children;
532
- }
533
-
534
456
InlineSpan _getInteractableChildren (RenderContext context,
535
457
InteractableElement tree, InlineSpan childSpan, TextStyle childStyle) {
536
458
if (childSpan is TextSpan ) {
0 commit comments