@@ -5,6 +5,7 @@ import 'package:flutter_html/html_parser.dart';
55import 'package:flutter_html/src/anchor.dart' ;
66import 'package:flutter_html/src/html_elements.dart' ;
77import 'package:flutter_html/src/styled_element.dart' ;
8+ import 'package:flutter_html/src/utils.dart' ;
89import 'package:flutter_html/style.dart' ;
910import 'package:flutter_layout_grid/flutter_layout_grid.dart' ;
1011import 'package:html/dom.dart' as dom;
@@ -33,8 +34,8 @@ class TableLayoutElement extends LayoutElement {
3334 Widget toWidget (RenderContext context) {
3435 return Container (
3536 key: AnchorKey .of (context.parser.key, this ),
36- margin : style.margin ,
37- padding : style.padding ,
37+ padding : style.padding ? .nonNegative ,
38+ margin : style.margin ? .nonNegative ,
3839 alignment: style.alignment,
3940 decoration: BoxDecoration (
4041 color: style.backgroundColor,
@@ -122,7 +123,7 @@ class TableLayoutElement extends LayoutElement {
122123 cells.add (GridPlacement (
123124 child: Container (
124125 width: double .infinity,
125- padding: child.style.padding ?? row.style.padding,
126+ padding: child.style.padding? .nonNegative ?? row.style.padding? .nonNegative ,
126127 decoration: BoxDecoration (
127128 color: child.style.backgroundColor ?? row.style.backgroundColor,
128129 border: child.style.border ?? row.style.border,
0 commit comments