otp_count_down_plus 2.2.0
otp_count_down_plus: ^2.2.0 copied to clipboard
A fork of otp_count_down package. A new dart package for easy implementation of OTP Count Down.
2.2.0 Auto Persistence & State Recovery #
- Auto Persistence Support: Added
onSaveStateandonClearStatecallbacks to automatically persist and purge countdown target timestamps (millisecondsSinceEpoch). - Timer Recovery (
restoreOTPTimer): IntroducedOTPCountDown.restoreOTPTimer()factory constructor to seamlessly resume countdowns after app restart or force close. - Auto-Purge Expired State: Automatically clears invalid or expired saved states upon initialization.
- Unit Tests: Added automated unit tests for state recovery and persistence callbacks.
2.1.0 Target Timestamp Precision, HH:mm:ss Support, and Safety Improvements #
- Drift-Free Precision: Transformed remaining time calculations to rely on absolute target timestamps (
targetEndTime), preventing timer drift from Flutter event loop delays. - Hours Support (
HH:mm:ss): Default time formatter now automatically formats remaining time with hours when total remaining duration is >= 1 hour (e.g.01:05:30). - Resource Safety & Disposal Guard: Added
isDisposedgetter and stream state checking to safely handle calls topause(),resume(),restart(), or updates after disposal without throwing exceptions. - Original Author Credit: Explicitly credited Hitesh Garg (
otp_count_down) inREADME.md. - Example Application Showcase: Enhanced
example/lib/main.dartto demonstrate 1+ hour countdown timer toggle, status checks (isDisposed), and interactive controls. - Unit Test Coverage: Comprehensive suite with 100% test coverage for new precision logic, formatting, and disposal safety.
2.0.0 Upgrade to Dart 3, Null Safety, and Feature Enhancements #
- Forked from
otp_count_downtootp_count_down_plus. - Upgraded SDK constraints to support Dart 3 (
sdk: ">=2.17.0 <4.0.0"). - Migrated to sound null safety.
- Added Stream support (
countDownStreamandremainingTimeStream). - Added Timer Controls (
pause(),resume(), andrestart()). - Added Custom Formatter (
formatter) and Custom Interval (interval). - Added Background Time Sync via absolute system time &
WidgetsBindingObserver. - Added Cooldown Backoff support (
restartWithBackoff()) with custom or linear strategies. - Added Persistence Hook (
onTickcallback) returning remaining milliseconds. - Added Milestone Callbacks (
milestonesmap) to trigger events at specific durations. - Added immediate timer invocation to improve UI/UX responsiveness.
- Upgraded the example app to modern Android V2 embedding and iOS configuration.
- Added comprehensive unit tests.
1.0.6 initial release. #
- FIXED minor bugs
- Added Licence
1.0.5 initial release. #
- Added README
1.0.4 initial release. #
- Added example
1.0.3 initial release. #
- Added onFinish callback
1.0.2 initial release. #
- Improved stability
1.0.1 initial release. #
- Added option for cancelling timer.