PdfElement.text constructor

const PdfElement.text({
  1. String? visibleIfKey,
  2. String? text,
  3. String? dataKey,
  4. @Default.new(PdfTextAlignment.left) PdfTextAlignment alignment,
})

A text element that can display static text or dynamic data from a key.

Implementation

const factory PdfElement.text({
  /// Optional key to control visibility based on the provided data.
  String? visibleIfKey,

  /// Static text to display.
  String? text,

  /// Key to fetch dynamic text from the provided data map.
  String? dataKey,

  /// How the text should be aligned.
  @Default(PdfTextAlignment.left) PdfTextAlignment alignment,
}) = PdfTextElement;