toAgo method
Implementation
String toAgo() {
if (inDays >= 1) {
return '${inDays} day(s) ago';
} else if (inHours >= 1) {
return '${inHours} hour(s) ago';
} else if (inMinutes >= 1) {
return '${inMinutes} minute(s) ago';
} else if (inSeconds >= 1) {
return '${inSeconds} second(s) ago';
} else if (inMilliseconds >= 1) {
return '${inMilliseconds} millisecond(s) ago';
} else if (inMicroseconds >= 1) {
return '${inMicroseconds} microsecond(s) ago';
} else {
return "just now";
}
}