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(pw.Context context) {
  super.paint(context);

  final style = pw.Theme.of(context).defaultTextStyle.merge(textStyle);

  final field = PdfTextField(
    rect: context.localToGlobal(box!),
    fieldName: name,
    border: border,
    flags: flags ?? const <PdfAnnotFlags>{PdfAnnotFlags.print},
    date: date,
    color: color,
    backgroundColor: backgroundColor,
    highlighting: highlighting,
    maxLength: maxLength,
    alternateName: alternateName,
    mappingName: mappingName,
    fieldFlags: fieldFlags,
    value: value,
    defaultValue: defaultValue,
    font: style.font!.getFont(context),
    fontSize: style.fontSize!,
    textColor: style.color!,
  );

  if (value != null) {
    drawAppearance(
      context,
      field,
      getAppearanceMatrix(context),
      BanglaAwareText(value!, style: style),
      tag: const PdfName('/Tx'),
    );
  }

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