Showing
1 changed file
with
6 additions
and
0 deletions
@@ -234,6 +234,8 @@ class FractionColumnWidth extends TableColumnWidth { | @@ -234,6 +234,8 @@ class FractionColumnWidth extends TableColumnWidth { | ||
234 | } | 234 | } |
235 | 235 | ||
236 | typedef OnCellFormat = String Function(int index, dynamic data); | 236 | typedef OnCellFormat = String Function(int index, dynamic data); |
237 | +typedef OnCellDecoration = BoxDecoration Function( | ||
238 | + int index, dynamic data, int rowNum); | ||
237 | 239 | ||
238 | /// A widget that uses the table layout algorithm for its children. | 240 | /// A widget that uses the table layout algorithm for its children. |
239 | class Table extends Widget implements SpanningWidget { | 241 | class Table extends Widget implements SpanningWidget { |
@@ -256,6 +258,7 @@ class Table extends Widget implements SpanningWidget { | @@ -256,6 +258,7 @@ class Table extends Widget implements SpanningWidget { | ||
256 | TextStyle? cellStyle, | 258 | TextStyle? cellStyle, |
257 | TextStyle? oddCellStyle, | 259 | TextStyle? oddCellStyle, |
258 | OnCellFormat? cellFormat, | 260 | OnCellFormat? cellFormat, |
261 | + OnCellDecoration? cellDecoration, | ||
259 | int headerCount = 1, | 262 | int headerCount = 1, |
260 | List<dynamic>? headers, | 263 | List<dynamic>? headers, |
261 | EdgeInsets? headerPadding, | 264 | EdgeInsets? headerPadding, |
@@ -356,6 +359,9 @@ class Table extends Widget implements SpanningWidget { | @@ -356,6 +359,9 @@ class Table extends Widget implements SpanningWidget { | ||
356 | alignment: align, | 359 | alignment: align, |
357 | padding: cellPadding, | 360 | padding: cellPadding, |
358 | constraints: BoxConstraints(minHeight: cellHeight), | 361 | constraints: BoxConstraints(minHeight: cellHeight), |
362 | + decoration: cellDecoration == null | ||
363 | + ? null | ||
364 | + : cellDecoration(tableRow.length, cell, rowNum), | ||
359 | child: Text( | 365 | child: Text( |
360 | cellFormat == null | 366 | cellFormat == null |
361 | ? cell.toString() | 367 | ? cell.toString() |
-
Please register or login to post a comment