@@ -253,57 +253,40 @@ class HtmlParser extends StatelessWidget {
253
253
),
254
254
);
255
255
} else if (tree.style? .display == Display .LIST_ITEM ) {
256
- List <Widget > children;
257
- if (tree.style? .listStylePosition == ListStylePosition .OUTSIDE ) {
258
- children = [
259
- PositionedDirectional (
260
- width: 30 , //TODO derive this from list padding.
261
- start: 0 ,
262
- child: Text ('${newContext .style .markerContent }\t ' ,
263
- textAlign: TextAlign .right,
264
- style: newContext.style.generateTextStyle ()),
265
- ),
266
- Padding (
267
- padding:
268
- EdgeInsets .only (left: 30 ), //TODO derive this from list padding.
269
- child: StyledText (
270
- textSpan: TextSpan (
271
- children: tree.children
272
- ? .map ((tree) => parseTree (newContext, tree))
273
- ? .toList () ??
274
- [],
275
- style: newContext.style.generateTextStyle (),
276
- ),
277
- style: newContext.style,
278
- ),
279
- )
280
- ];
281
- } else if (tree.style? .listStylePosition == ListStylePosition .INSIDE ) {
282
- children = [
283
- Padding (
284
- padding:
285
- EdgeInsets .only (left: 30 ), //TODO derive this from list padding.
286
- child: StyledText (
287
- textSpan: TextSpan (
288
- text: '${newContext .style .markerContent }\t ' ,
289
- children: tree.children
290
- ? .map ((tree) => parseTree (newContext, tree))
291
- ? .toList () ??
292
- [],
293
- style: newContext.style.generateTextStyle (),
294
- ),
295
- style: newContext.style,
296
- ),
297
- )
298
- ];
299
- }
300
256
return WidgetSpan (
301
257
child: ContainerSpan (
302
258
newContext: newContext,
303
259
style: tree.style,
304
260
shrinkWrap: context.parser.shrinkWrap,
305
261
child: Stack (
306
- children: children,
262
+ children: [
263
+ if (tree.style? .listStylePosition == ListStylePosition .OUTSIDE || tree.style? .listStylePosition == null )
264
+ PositionedDirectional (
265
+ width: 30 , //TODO derive this from list padding.
266
+ start: 0 ,
267
+ child: Text ('${newContext .style .markerContent }\t ' ,
268
+ textAlign: TextAlign .right,
269
+ style: newContext.style.generateTextStyle ()),
270
+ ),
271
+ Padding (
272
+ padding: EdgeInsets .only (
273
+ left: 30 ), //TODO derive this from list padding.
274
+ child: StyledText (
275
+ textSpan: TextSpan (
276
+ text: (tree.style? .listStylePosition ==
277
+ ListStylePosition .INSIDE )
278
+ ? '${newContext .style .markerContent }\t '
279
+ : null ,
280
+ children: tree.children
281
+ ? .map ((tree) => parseTree (newContext, tree))
282
+ ? .toList () ??
283
+ [],
284
+ style: newContext.style.generateTextStyle (),
285
+ ),
286
+ style: newContext.style,
287
+ ),
288
+ )
289
+ ],
307
290
),
308
291
),
309
292
);
0 commit comments