timeAgo method

String timeAgo({
  1. String locale = 'ru',
  2. bool short = false,
  3. Duration? fromDateTime,
})

Implementation

String timeAgo({String locale = 'ru', bool short = false, Duration? fromDateTime}) {
  return timeago.format(
    toDateTime(),
    locale: short ? '${locale}_short' : locale,
    clock: fromDateTime != null ? fromDateTime.toDateTime() : const Duration().toDateTime(),
  );
}