PdfTemplate class

Represents a full PDF template including metadata and a list of elements.

Annotations
  • @freezed

Constructors

PdfTemplate({required String id, required String name, @Default.new(LayoutType.paged) LayoutType layoutType, @Default.new(210.0) double customWidth, @Default.new(297.0) double customHeight, @Default.new(16.0) double pageMargins, @Default.new(12.0) double baseFontSize, @Default.new([]) List<PdfElement> elements})
Creates a new PdfTemplate.
const
factory
PdfTemplate.fromJson(Map<String, dynamic> json)
Factory for creating a PdfTemplate from a JSON map.
factory

Properties

baseFontSize → double
Default font size for text elements in the template.
no setterinherited
copyWith → $PdfTemplateCopyWith<PdfTemplate>
Create a copy of PdfTemplate with the given fields replaced by the non-null parameter values.
no setterinherited
customHeight → double
Custom height in millimeters (used when layoutType is LayoutType.custom).
no setterinherited
customWidth → double
Custom width in millimeters (used when layoutType is LayoutType.custom).
no setterinherited
elements → List<PdfElement>
List of ordered elements that make up the document body.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
id → String
Unique identifier for the template.
no setterinherited
layoutType → LayoutType
Page layout type (e.g., A4, A5, Roll).
no setterinherited
name → String
Human-readable name of the template.
no setterinherited
pageMargins → double
Page margins in points.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this PdfTemplate to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited