toPdfTableColumnWidth method

TableColumnWidth toPdfTableColumnWidth()

Converts the TableColumnWidth to a pw.TableColumnWidth.

Implementation

pw.TableColumnWidth toPdfTableColumnWidth() {
  switch (runtimeType) {
    case IntrinsicColumnWidth:
      return pw.IntrinsicColumnWidth(flex: flex([]));
    case FixedColumnWidth:
      return pw.FixedColumnWidth((this as FixedColumnWidth).value);
    case FlexColumnWidth:
      return pw.FlexColumnWidth((this as FlexColumnWidth).value);
    case FractionColumnWidth:
      return pw.FractionColumnWidth((this as FractionColumnWidth).value);
    default:
      debugPrint(
          'Unsupported TableColumnWidth: $this; defaulting to IntrinsicColumnWidth');
      return const pw.IntrinsicColumnWidth();
  }
}