timer_widget 1.0.1
timer_widget: ^1.0.1 copied to clipboard
All-in-one Flutter timer widget with countdown, cooldown, debounce, and async loader. Perfect for OTP resend buttons, rate limiting, form submission, API loading with retry. Zero dependencies - inte [...]
Changelog #
All notable changes to this project will be documented in this file.
1.0.0 - 2024-12-20 #
- 🕣 stop wacth features added
[1.0.0] - 2024-12-20 #
🎉 Major Release - Complete Rewrite #
✨ New Features
-
Global Static Controller 🎮
- Control ANY timer from ANYWHERE using
TimerWidgetController.start("id") - No need to pass controller around!
- Just give widget an
idparameter
- Control ANY timer from ANYWHERE using
-
Four Timer Types - Select behavior with
timerType:TimerType.countdown- Simple countdown timerTimerType.cooldown- OTP resend / cooldown buttonTimerType.debounce- Prevent rapid clicksTimerType.asyncLoader- Async loading with retry
-
Global Control Methods
TimerWidgetController.start("id"); TimerWidgetController.stop("id"); TimerWidgetController.pause("id"); TimerWidgetController.resume("id"); TimerWidgetController.execute("id"); // For async TimerWidgetController.retry("id"); TimerWidgetController.reset("id"); -
Bulk Control
TimerWidgetController.startAll(); TimerWidgetController.stopAll(); TimerWidgetController.pauseAll(); TimerWidgetController.resetAll(); -
State Getters
TimerWidgetController.isCounting("id"); TimerWidgetController.isPaused("id"); TimerWidgetController.remainingSeconds("id"); TimerWidgetController.isLoading("id"); TimerWidgetController.isSuccess("id"); TimerWidgetController.isError("id"); TimerWidgetController.getData("id"); TimerWidgetController.getError("id"); -
Async Loader Support
- Execute async operations (API calls)
- Auto-retry on failure with configurable
retryCount retryDelaybetween attemptsonSuccessandonErrorcallbacks
-
State Object
TimerWidgetStatewith all informationremainingSeconds,isCounting,isPausedisLoading,isSuccess,isError,data,error
💥 Breaking Changes
- Removed
controllerparameter - useidinstead! - Removed
providerdependency - zero external dependencies now! - Builder signature:
(context, state)with fullTimerWidgetState
📦 Other
- Updated to support Flutter 3.10+ and Dart 3.0+
- Added comprehensive example app with 5 tabs
- Added SEO topics for pub.flutter-io.cn ranking
0.0.4 Previous Version #
- Basic countdown timer functionality
- Required provider dependency
- Basic controller support (passed via parameter)
0.0.3 [0.0.1] #
- Initial releases with basic features
