DateTimePrinter class

Prints DateTime objects in custom ways.

For example, to print dates in the format YYYY-MM-DD call the constructor and configure the printer as such:

final printer = DateTimePrinter((builder) => builder
    ..year(width: 4)
    ..literal('-')
    ..month(width: 2)
    ..literal('-')
    ..day(width: 2));
Inheritance
Available Extensions

Constructors

DateTimePrinter(Callback1<DateTimePrinterBuilder> callback)
Constructor to build a DateTimePrinter.
factory

Properties

defaultToStringPrinter ObjectPrinter
Override to configure the empty ObjectPrinter.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
printers Iterable<Printer<DateTime>>
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toStringPrinter ObjectPrinter
Override and call super to add values to the ObjectPrinter.
no setterinherited

Methods

call(DateTime object) String
Prints the object.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
print(DateTime object) String
Returns the printed object.
inherited
printOn(DateTime object, StringBuffer buffer) → void
Prints the object into buffer.
inherited
toString() String
Standard toString implementation. Do not override, instead implement toStringPrinter to customize.
inherited

Operators

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

Static Methods

iso8691() DateTimePrinter
Returns an ISO-8601 full-precision extended format representation.