toPdfWidget method

Future<TextSpan> toPdfWidget(
  1. ExportInstance instance
)

Converts the TextSpan to a pw.TextSpan.

Implementation

Future<pw.TextSpan> toPdfWidget(ExportInstance instance) async => pw.TextSpan(
    text: text,
    style: await style?.toPdfTextStyle(instance.delegate.fontData),
    children: await Future.wait(children?.map(
      (InlineSpan e) async => await (e as TextSpan).toPdfWidget(instance)
    ) ?? []),
);