track 1.1.3 copy "track: ^1.1.3" to clipboard
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 (max or min)

Fixed: #

  • Synchronized clearValueOnly() in BaseCounterService
    Now uses _lock.synchronized() to prevent race conditions, ensuring thread safety like increment() and reset().

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 specified TimePeriod.

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 .historyTracker extension 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 the BaseTrackerService to 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.

16
likes
160
points
45
downloads

Publisher

verified publisherjozz.biz

Weekly Downloads

Easily track streaks, counters, history, and records. Effortless persistent trackers with no manual timers or storage, just define and go.

Repository (GitHub)
View/report issues

Topics

#streaks #counters #history #persistence #records

Documentation

API reference

License

MIT (license)

Dependencies

equatable, flutter, prf, synchronized

More

Packages that depend on track