simple_durations 2.1.1
simple_durations: ^2.1.1 copied to clipboard
Extensions on int to easily create Durations directly from ints. Can be used for units as small as planck time all the way up to galactic years and beyond.
This package was inspired by the extensions in the flutter_animate package.
Main durations are implemented along with several more eccentric units of time.
Support #
If you find this package useful, consider supporting the project:
Features #
- Shorthand ways to create Durations
- All the main units are covered
- Durations smaller than microseconds use a new class
PlanckDuration
Getting started #
import 'package:simple_durations/simple_durations.dart';
Usage #
// returns Duration
final microseconds = 15.us;
final longForm = 15.microseconds;
final milliseconds = 10.ms;
final days = 3.d;
final longFormDays = 3.days;
// returns PlanckDuration
final yoctoseconds = 21.yoctoseconds;
final rontoseconds = 500.rontoseconds;
Complete list of units #
- microseconds
- milliseconds
- seconds
- minutes
- hours
- days
- weeks
- month February
- month leap year February
- month thirty days
- month thirty-one days
- year
- leap year
- planck
- quectoseconds
- rontoseconds
- yoctoseconds
- jiffy physics
- jiffy electronics
- zeptoseconds
- attoseconds
- atomic time
- femtoseconds
- svedbergs
- picoseconds
- nanoseconds
- shakes
- centiseconds
- deciseconds
- decaseconds
- hectoseconds
- moments
- kiloseconds
- megaseconds
- gigaseconds
- teraseconds
- petaseconds
- exaseconds
- zettaseconds
- yottaseconds
- ronnaseconds
- quettaseconds
- millidays
- centidays
- decidays
- decadays
- fortnights
- quarantines
- hectodays
- lunar years
- tropical year
- Gregorian year
- sidereal year
- semester
- olympiad
- lustrum
- decade
- indiction
- jubilee
- century
- millenia
- age
- megaannum
- galactic year
- eon
- kalpa
- decimal seconds
- decimal minutes
- decimal hours
- decimal days
- conan the barbarians
Additional information #
To contribute or file issues: https://github.com/johnbmangold/simple_durations