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 tf = PdfTextField(
    rect: context.localToGlobal(box!),
    fieldName: name,
    border: border,
    flags: flags ?? const {PdfAnnotFlags.print},
    date: date,
    color: color,
    backgroundColor: backgroundColor,
    highlighting: highlighting,
    maxLength: maxLength,
    alternateName: alternateName,
    mappingName: mappingName,
    fieldFlags: fieldFlags,
    value: value,
    defaultValue: defaultValue,
    font: _textStyle.font!.getFont(context),
    fontSize: _textStyle.fontSize!,
    textColor: _textStyle.color!,
  );

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

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

  PdfAnnot(
    context.page,
    tf,
    objser: replaces?.ser,
    objgen: replaces?.gen ?? 0,
  );
}