format property
String
get
format
Formats this duration using the most appropriate representation:
DD:HH:mm:ssif duration is at least 1 dayHH:mm:ssif duration is at least 1 hourmm:ssotherwise
Example:
Duration(seconds: 45).format; // "00:45"
Implementation
String get format {
if (inDays > 0) {
return formatDDHHMMSS;
} else if (inHours > 0) {
return formatHHMMSS;
} else {
return formatMMSS;
}
}