flutter_time_utils 1.1.4
flutter_time_utils: ^1.1.4 copied to clipboard
A lightweight Flutter package providing Duration extensions (5.seconds, 2.hours), DateTime helpers (isToday, format, timeAgo), a zero-dependency date formatter, relative time strings, and compact dura [...]
Changelog #
1.1.4 #
- Fix: Resolved an issue where the
CountdownTimer'sstreamcould accidentally emitDuration.zerotwice upon completion.
1.1.3 #
- Feature: Added
CountdownTimerclass and.timer()extension toDuration. - Includes full lifecycle control (
start,pause,resume,cancel), state access (remaining,isRunning,isCompleted), callbacks (onTick,onDone), a broadcaststream, and formatted strings (remainingFormatted).
1.1.2 #
- Feature: Added
<Duration>.countdownStream(), a robust generator mapping any duration to a tickingStream<int>.
1.1.1 #
- Feature: Added top-level
timeAgo(date)function identical to the populartimeagopackage. - Documentation: Updated
README.mdto showcase the new concise getter API (timeAgo,fromNow).
1.1.0 #
- Upgraded
timeAgointo a production-level utility (TimeAgoFormatter,TimeAgoStrings). DateTime.timeAgo()now acceptsshortandnumericparameters.- Added short format:
date.timeAgo(short: true)→"5m","2h","3d". - Added
Duration.ago,Duration.fromNow,Duration.agoShort,Duration.fromNowShortgetters. TimeAgoStringsclass provides localization-ready static string overrides.- Future date support:
futureDate.timeAgo()→"in 2 hours".
1.0.0 #
- Initial release.
Durationextensions:int.seconds,int.minutes,int.hours,int.days,Duration.sleep().DateTimeextensions:format(),isToday,isYesterday,isTomorrow,startOfDay,endOfDay,timeAgo().- Lightweight date formatter with no
intldependency. timeAgo()utility supporting seconds, minutes, hours, days, and weeks.formatDuration()utility for human-readable duration strings.