@@ -456,7 +456,7 @@ class HtmlParser extends StatelessWidget {
456456 return WidgetSpan (
457457 alignment: tree.alignment,
458458 baseline: TextBaseline .alphabetic,
459- child: tree.toWidget (context )! ,
459+ child: tree.toWidget (newContext )! ,
460460 );
461461 }
462462 } else if (tree is InteractableElement ) {
@@ -848,7 +848,12 @@ class HtmlParser extends StatelessWidget {
848848 if (tree.children.isEmpty) {
849849 // Handle case (4) from above.
850850 if ((tree.style.height ?? 0 ) == 0 ) {
851- tree.style.margin = Margins .all (0 );
851+ tree.style.margin = tree.style.margin? .copyWith (
852+ left: Margin (value: 0 , type: tree.style.margin! .left? .type ?? MarginType .VALUE ),
853+ right: Margin (value: 0 , type: tree.style.margin! .right? .type ?? MarginType .VALUE ),
854+ top: Margin (value: 0 , type: tree.style.margin! .top? .type ?? MarginType .VALUE ),
855+ bottom: Margin (value: 0 , type: tree.style.margin! .bottom? .type ?? MarginType .VALUE ),
856+ ) ?? Margins .all (0 );
852857 }
853858 return tree;
854859 }
@@ -1058,9 +1063,9 @@ class ContainerSpan extends StatelessWidget {
10581063 ),
10591064 );
10601065 if (style.margin? .isAutoHorizontal ?? false ) {
1061- return Row (
1062- mainAxisAlignment : style.margin? .alignment ?? MainAxisAlignment .start ,
1063- children : [ Flexible ( child: container)],
1066+ return Align (
1067+ alignment : style.margin! .alignment,
1068+ child: container
10641069 );
10651070 }
10661071 return container;
0 commit comments