track 1.1.3
track: ^1.1.3 copied to clipboard
Easily track streaks, counters, history, and records. Effortless persistent trackers with no manual timers or storage, just define and go.
1.1.3 #
- Fixed dependency issues
- Moved internal files to
lib/src/to improve encapsulation and API clarity - Updated README
1.1.2 #
Patch: Fixed Flutter Web crash for 64-bit encoded types #
Bumped prf dependency to ^2.4.2 to resolve a Flutter Web runtime crash related to 64-bit integer encoding (DateTime, List<DateTime>, List<Duration>).
No functional changes in this package.
1.1.1 #
- Fixed links and problems in the
README
1.1.0 #
New services added: #
-
๐ BestRecord โ track the best (max or min) performance or value over time, with a full history and fallback support. Example use cases: high scores, fastest times, highest streaks
-
๐ข BasicCounter โ a simple persistent counter with no expiration or alignment. Example use cases: total taps, visits, or actions
Enhancements: #
- ๐ฅ StreakTracker now integrates BestRecord
- Automatically tracks and saves the highest streak ever achieved
- Supports history length, fallback records, and customizable record mode (
maxormin)
Fixed: #
- Synchronized
clearValueOnly()in BaseCounterService
Now uses_lock.synchronized()to prevent race conditions, ensuring thread safety likeincrement()andreset().
1.0.0 #
โจ track initial release #
Persistent, plug-and-play tools for tracking streaks, counters, histories, and records across sessions, isolates, and app restarts โ no boilerplate, no manual timers, no storage code.
Features included:
- ๐ฅ StreakTracker โ track streaks that reset when a period is missed (e.g. daily habits, login streaks)
- ๐งพ HistoryTracker โ maintain a rolling list of recent items with max length and optional deduplication
- ๐ PeriodicCounter โ count events within aligned time periods (e.g. daily tasks, hourly goals)
- โณ RolloverCounter โ track counts over a sliding window that resets after inactivity (e.g. attempts per hour)
- ๐ ActivityCounter โ capture detailed activity stats over hours, days, months, and years
๐ (coming soon) BestRecord โ track best performances or highscores
Highlights:
- One-line setup (
StreakTracker,HistoryTracker,PeriodicCounter,RolloverCounter,ActivityCounter) - Automatic persistence across app restarts
- Async-safe, isolate-friendly behavior
- Built-in reset, summary, and analytics methods
- Optional caching for extra performance
Notes: Originally part of the prf package. Extracted into a standalone package for modularity, lighter dependencies, and focused use. Perfect for apps that need easy-to-integrate progress tracking without extra complexity.
0.0.7 #
- Added
RolloverCounter- a persistent counter designed to automatically reset after a specified duration from the last update. This is particularly useful for tracking rolling activity windows, such as "submissions per hour" or "attempts every 10 minutes".
0.0.6 #
- Added
PeriodicCounter- A persistent counter that automatically resets at the start of each aligned time period designed to track integer counters that reset periodically based on a specifiedTimePeriod.
0.0.5 #
- Added
ActivityCounter- A utility class for tracking user activity over time across various spans such as hour, day, month, and year. It provides persistent storage and retrieval of activity data, making it suitable for usage statistics, trend analysis, and generating long-term activity reports. - Added
.historyTrackerextension for building a persisted history tracker from any adapter
final history = adapter.historyTracker(
'my_history',
maxLength: 100,
deduplicate: true,
);
0.0.4 #
- Added
HistoryTracker- A persisted, FIFO history tracker
0.0.3 #
- Added tests for all core components to ensure reliability and correctness.
0.0.2 #
- Imported
BaseCounterService- An abstract class for tracking integer counters with expiration logic. It extends theBaseTrackerServiceto specifically handle integer counters. It provides methods to increment the counter, check if the counter is non-zero, and reset the counter value while maintaining the last update timestamp.
0.0.1 #
- Added
TimePeriod- Represents different time periods for tracking purposes. - Added
BaseTrackerService- An abstract base class for tracking values with expiration logic. - Added testing tools and utilities
Notes: Originally was part of the prf package. Extracted into a standalone package for modularity, lighter dependencies, and focused use. Ideal for apps needing easy-to-integrate time-based limits without extra logic.