Skip to content

Commit ee9d075

Browse files
committed
Table widget refactor totalWidth to remove null checking and empty
1 parent 1a6272e commit ee9d075

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pdf/lib/src/widgets/table.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ class Table extends Widget with SpanningWidget {
371371
return;
372372
}
373373

374-
final maxWidth = _widths.reduce((double? a, double? b) => a! + b!);
374+
final maxWidth = _widths.fold(0.0, (sum, element) => sum + element);
375375

376376
// Compute column widths using flex and estimated width
377377
if (constraints.hasBoundedWidth) {
@@ -399,7 +399,7 @@ class Table extends Widget with SpanningWidget {
399399
}
400400
}
401401

402-
final totalWidth = _widths.reduce((double? a, double? b) => a! + b!);
402+
final totalWidth = _widths.fold(0.0, (sum, element) => sum + element);
403403

404404
// Compute final widths
405405
var totalHeight = 0.0;

0 commit comments

Comments
 (0)