build method

  1. @override
PdfAnnot build(
  1. Context context,
  2. PdfRect? box
)
override

Implementation

@override
PdfAnnot build(Context context, PdfRect? box) {
  final _textStyle = Theme.of(context).defaultTextStyle.merge(textStyle);

  return PdfAnnot(
    context.page,
    PdfTextField(
      rect: context.localToGlobal(box!),
      fieldName: name,
      border: border,
      flags: flags,
      date: date,
      author: author,
      subject: subject,
      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!,
    ),
    objser: replaces?.ser,
    objgen: replaces?.gen ?? 0,
  );
}