time_ago_provider 0.1.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new70

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 (Now). (e.g. "7 minutes ago" ).

Usage #

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

import 'package:time_ago_provider/time_ago_provider.dart';

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

  //With Language
  int mySecondTimeStamp = DateTime.now().millisecondsSinceEpoch;
  String germanTimeAgo = TimeAgo.getTimeAgo(timeStamp: mySecondTimeStamp, language: Language.GERMAN); //Default Language ENGLISH
  print("Gepostet $germanTimeAgo");
}

Methods #

FunctionParameterDescriptionReturn
getTimeAgoint timeStampReturns an interval String of the time that passed between the given time stamp to the present (Now)String timeAgo

Supported Languages #

  • [x] ENGLISH
  • [x] ARABIC
  • [x] GERMAN
  • [x] SPANISH
  • [x] CHINESE
  • [x] RUSSIAN
  • [x] PORTUGUESE
  • [x] JAPANESE
  • [x] HINDI
  • [x] FRENCH

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.0.1 #

  • Initial version.

0.1.0 #

  • Stable version.

0.1.1 #

  • Code improved.

example/time_ago_provider_example.dart

import 'package:time_ago_provider/time_ago_provider.dart';

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

  //With Language
  int mySecondTimeStamp = DateTime.now().millisecondsSinceEpoch;
  String germanTimeAgo = TimeAgo.getTimeAgo(timeStamp: mySecondTimeStamp, language: Language.GERMAN); //Default Language ENGLISH
  print("Gepostet $germanTimeAgo");
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  time_ago_provider: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:time_ago_provider/time_ago_provider.dart';
  
Version Uploaded Documentation Archive
0.1.1 Apr 17, 2019 Go to the documentation of time_ago_provider 0.1.1 Download time_ago_provider 0.1.1 archive
0.1.0 Apr 16, 2019 Go to the documentation of time_ago_provider 0.1.0 Download time_ago_provider 0.1.0 archive
0.0.1 Apr 15, 2019 Go to the documentation of time_ago_provider 0.0.1 Download time_ago_provider 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
39
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Apr 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:time_ago_provider/time_ago_provider.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
Dev dependencies
pedantic ^1.0.0
test ^1.0.0