paint method

  1. @override
void paint(
  1. Context context
)
override

Draw itself and its children, according to the calculated box.offset

Implementation

@override
void paint(Context context) {
  super.paint(context);
  final _textStyle = Theme.of(context).defaultTextStyle.merge(textStyle);
  final pdfRect = context.localToGlobal(box!);

  final bf = PdfChoiceField(
    textColor: _textStyle.color!,
    fieldName: name,
    value: value,
    font: _textStyle.font!.getFont(context),
    fontSize: _textStyle.fontSize!,
    items: items,
    rect: pdfRect,
  );

  if (value != null) {
    final mat = getAppearanceMatrix(context);

    drawAppearance(
      context,
      bf,
      mat,
      Text(value!, style: _textStyle),
      tag: const PdfName('/Tx'),
    );
  }

  PdfAnnot(context.page, bf);
}