datetime_loop 1.6.0
datetime_loop: ^1.6.0 copied to clipboard
A Flutter package that provides a widget to listen to the system's datetime and trigger a rebuild based on the specified time unit.
1.6.0 - 2025-10-31 #
-
Added
getNowparameter toDateTimeLoopBuilderandDateTimeLoopControllerfor testing and mocking system time. -
Introduced unit testing to the package:
test/date_time_loop_controller_test.dart: Tests controller stream emissions for allTimeUnitvalues (milliseconds, seconds, minutes, hours, days) with bothtriggerOnStarttrue and false.test/date_time_loop_builder_test.dart: Tests widget rebuild behavior with differentTimeUnitandtriggerOnStateChangeconfigurations.
-
Removed internal caching logic (
_lastPushedWidgetand_lastPushedDateTime) inDateTimeLoopBuilderthat was preventing builder from being called when stream emitted the same datetime value. -
Fixed
triggerOnStateChangebehavior to properly trigger rebuilds on every stream emission. -
Updated
README.mdfile. -
Updated
example/main.dartfile.
1.5.0 - 2025-10-24 #
- Added
pause()andresume()methods toDateTimeLoopControllerfor pausing and resuming datetime updates, useful for resource management (e.g., when the app is backgrounded). - Added optional
controllerparameter toDateTimeLoopBuilderto allow external controller management, enabling advanced features like pause/resume. - Added example demonstrating pause/resume functionality in
example/lib/pause_resume_example.dart. - Updated
README.md.
1.4.0 - 2025-10-24 #
- Refactored
DateTimeLoopControllerto useTimerfor periodic updates instead of awhileloop withFuture.delayed, improving reliability and resource management. - Moved initial
DateTimeemission (whentriggerOnStartistrue) toFuture.microtaskto allow listeners to subscribe first. - Added
disposemethod inDateTimeLoopBuilderto properly cancel the timer and close the stream controller, preventing potential memory leaks.
1.3.1 - 2025-04-17 #
- Fixed
triggerOnStateChangeinDateTimeLoopBuilderto trigger immediate builds on init and parent rebuilds (Flutter issue #64916). - Updated example app’s Android code for Flutter > 3.27 compatibility.
- Updated
README.
1.3.0 - 2025-03-06 #
1.2.1 - 2024-11-09 #
1.2.0 - 2024-04-02 #
- New Feature: Added
millisecondstoTimeUnit. - update example
1.1.1 - 2024-04-02 #
- add example pubspec.lock to gitignore
1.1.0 - 2024-03-10 #
Changes:
- New Feature: Added
triggerOnStateChangeparameter toDateTimeLoopBuilder.
1.0.1 #
- remove unused code
- add example
1.0.0 #
- initial release