otp_count_down_plus 2.2.0 copy "otp_count_down_plus: ^2.2.0" to clipboard
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 onSaveState and onClearState callbacks to automatically persist and purge countdown target timestamps (millisecondsSinceEpoch).
  • Timer Recovery (restoreOTPTimer): Introduced OTPCountDown.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 isDisposed getter and stream state checking to safely handle calls to pause(), resume(), restart(), or updates after disposal without throwing exceptions.
  • Original Author Credit: Explicitly credited Hitesh Garg (otp_count_down) in README.md.
  • Example Application Showcase: Enhanced example/lib/main.dart to 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_down to otp_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 (countDownStream and remainingTimeStream).
  • Added Timer Controls (pause(), resume(), and restart()).
  • 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 (onTick callback) returning remaining milliseconds.
  • Added Milestone Callbacks (milestones map) 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.

1.0.0 initial release. #

0
likes
160
points
50
downloads

Documentation

API reference

Publisher

verified publisherrizkyghofur.my.id

Weekly Downloads

A fork of otp_count_down package. A new dart package for easy implementation of OTP Count Down.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on otp_count_down_plus