PdfDateTimeField class Null safety

Represents date and time automated field.

//Create a new pdf document
PdfDocument document = PdfDocument();
//Add the pages to the document
for (int i = 1; i <= 5; i++) {
  document.pages.add().graphics.drawString(
      'page$i', PdfStandardFont(PdfFontFamily.timesRoman, 11),
      bounds: Rect.fromLTWH(250, 0, 615, 100));
}
//Create the footer with specific bounds
PdfPageTemplateElement footer =
    PdfPageTemplateElement(const Rect.fromLTWH(0, 0, 515, 50));
//Create the composite field
PdfCompositeField compositeField = PdfCompositeField(
    font: PdfStandardFont(PdfFontFamily.timesRoman, 19),
    brush: PdfSolidBrush(PdfColor(0, 0, 0)),
    text: 'Time:{0}');
//Create the date and time field
PdfDateTimeField dateTimeField = PdfDateTimeField(
    font: PdfStandardFont(PdfFontFamily.timesRoman, 19),
    brush: PdfSolidBrush(PdfColor(0, 0, 0)));
//Add date&time field to composite fields
compositeField.fields.add(dateTimeField);
//Set bounds to composite field.
compositeField.bounds = footer.bounds;
//Add the composite field in footer
compositeField.draw(footer.graphics,
    Offset(290, 50 - PdfStandardFont(PdfFontFamily.timesRoman, 19).height));
//Add the footer at the bottom of the document
document.template.bottom = footer;
//Save the document.
List<int> bytes = document.save();
//Dispose the document.
document.dispose();
Inheritance

Constructors

PdfDateTimeField({PdfFont? font, PdfBrush? brush, Rect? bounds})
Initializes a new instance of the PdfDateTimeField class. [...]

Properties

bounds Rect
Gets or sets the bounds of the field. [...]
read / write, inherited
brush PdfBrush
Gets or sets the brush of the field. [...]
read / write, inherited
date DateTime
Get the current date and set the required date. [...]
read / write
dateFormatString String
Gets or sets the date format string. [...]
read / write
font PdfFont
Gets or sets the font of the field. [...]
read / write, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
locale String
Gets or sets the locale for date and time culture. [...]
read / write
pen PdfPen?
Gets or sets the pen of the field. [...]
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stringFormat PdfStringFormat?
Gets or sets the stringFormat of the field. [...]
read / write, inherited

Methods

draw(PdfGraphics graphics, [Offset? location]) → void
Draws an element on the Graphics. Graphics context where the element should be printed. location has contains X co-ordinate of the element, Y co-ordinate of the element. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited