toIso8601DateString method
Returns an ISO-8601 full-precision extended format representation.
The format is yyyy-MM-dd,
where:
yyyyis a, possibly negative, four digit representation of the year, if the year is in the range -9999 to 9999, otherwise it is a signed six digit representation of the year.MMis the month in the range 01 to 12,ddis the day of the month in the range 01 to 31
Implementation
String toIso8601DateString() => toIso8601String().split("T").first;