PdfElement.image constructor

const PdfElement.image({
  1. String? visibleIfKey,
  2. String? imageSource,
  3. String? dataKey,
  4. @Default.new(100.0) double width,
  5. @Default.new(100.0) double height,
  6. @Default.new(PdfTextAlignment.center) PdfTextAlignment alignment,
})

An image element that can load from a URL, local path, asset, or Base64.

Implementation

const factory PdfElement.image({
  /// Optional key to control visibility.
  String? visibleIfKey,

  /// The image source (e.g., "http://...", "path/to/file", "data:image/...").
  String? imageSource,

  /// Optional key to fetch the image source dynamically from data.
  String? dataKey,

  /// Width of the image in points.
  @Default(100.0) double width,

  /// Height of the image in points.
  @Default(100.0) double height,

  /// Alignment of the image within its container.
  @Default(PdfTextAlignment.center) PdfTextAlignment alignment,
}) = PdfImageElement;