Skip to content

Commit

Permalink
fix: Apply margins to <table> properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Sub6Resources committed Sep 17, 2022
1 parent 9dc7f08 commit 7581ea7
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions packages/flutter_html_table/lib/flutter_html_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,12 @@ import 'package:flutter_html/flutter_html.dart';
/// The CustomRender function that will render the <table> HTML tag
CustomRender tableRender() =>
CustomRender.widget(widget: (context, buildChildren) {
return Container(
return CssBoxWidget(
key: context.key,
//TODO(Sub6Resources): This needs to be computed with Units!!
margin: EdgeInsets.only(
left: context.style.margin?.left?.value.abs() ?? 0,
right: context.style.margin?.right?.value.abs() ?? 0,
bottom: context.style.margin?.bottom?.value.abs() ?? 0,
top: context.style.margin?.bottom?.value.abs() ?? 0,
),
padding: context.style.padding?.nonNegative,
alignment: context.style.alignment,
decoration: BoxDecoration(
color: context.style.backgroundColor,
border: context.style.border,
),
width: context.style.width?.value, //TODO calculate actual value
height: context.style.height?.value, //TODO calculate actual value
style: context.style,
child: LayoutBuilder(
builder: (_, constraints) => _layoutCells(context, constraints)),
builder: (_, constraints) => _layoutCells(context, constraints),
),
);
});

Expand Down

0 comments on commit 7581ea7

Please sign in to comment.