convert static method

Widget convert(
  1. Widget widget,
  2. ColorScheme colors, {
  3. Map<String, Uint8List>? imageCache,
})

Converts supported Flutter widgets (like TImage, TChip) to their PDF equivalents.

Implementation

static pw.Widget convert(fm.Widget widget, fm.ColorScheme colors, {Map<String, Uint8List>? imageCache}) {
  if (widget is TImage) {
    return _convertTImage(colors, widget, imageCache: imageCache);
  } else if (widget is TChip) {
    return _convertTChip(colors, widget);
  }

  // Fallback for unknown widgets
  return pw.SizedBox();
}