time_ago_provider 1.0.2 copy "time_ago_provider: ^1.0.2" to clipboard
time_ago_provider: ^1.0.2 copied to clipboard

outdated

A Library that takes a time stamp value and returns an interval String of the time that passed between the given time stamp to the present. E.g.("7 minutes ago" ).

time_ago_provider #

A Library that takes a time stamp value and returns an interval String of the time that passed between the given time stamp to the present. E.g.("7 minutes ago" ).

Usage #

Easy Lazy! Feed it timestamp, produces you time ago.

import 'package:time_ago_provider/time_ago_provider.dart';

void main()
{
  //Normal Usage
  //- Get the current time stamp
  int timeStamp = DateTime.now().millisecondsSinceEpoch;
  //- getTimeAgo(int timeStamp) returns a String " X minutes/hours/days/months/years ago ...
  String timeAgo = TimeAgo.getTimeAgo(timeStamp);
  print("Posted $timeAgo"); // Posted just now

  //With Language DEFAULT = English
  int germanTimeStamp = DateTime.now().millisecondsSinceEpoch;
  String germanTimeAgo = TimeAgo.getTimeAgo(germanTimeStamp, language: Language.GERMAN);
  print("Gepostet $germanTimeAgo");
}

Methods #

Function Parameter Description Return
getTimeAgo int timeStamp Returns an interval String of the time that passed between the given time stamp to the present String timeAgo

Supported Languages #

  • ✅ ENGLISH
  • ✅ ARABIC
  • ✅ GERMAN
  • ✅ SPANISH
  • ✅ CHINESE
  • ✅ RUSSIAN
  • ✅ PORTUGUESE
  • ✅ JAPANESE
  • ✅ HINDI
  • ✅ FRENCH

Installing #

Package

Features and bugs #

If you face any problems feel free to open an issue at the [issue tracker][tracker]. If you feel the library is missing a feature, please raise a ticket on Github. Pull request are also welcome. [tracker]: https://github.com/BaderEddineOuaich/time_ago_provider/issues

33
likes
0
points
356
downloads

Publisher

unverified uploader

Weekly Downloads

A Library that takes a time stamp value and returns an interval String of the time that passed between the given time stamp to the present. E.g.("7 minutes ago" ).

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on time_ago_provider