flutter_streak 1.0.1 copy "flutter_streak: ^1.0.1" to clipboard
flutter_streak: ^1.0.1 copied to clipboard

The flutter_streak Dart package provides a simple and flexible way to track user streaks in Flutter apps. It manages streak counts, contribution tracking, and daily progress while persisting data thro [...]

flutter_streak #

A simple and flexible Flutter package for tracking daily streaks.
Useful for habit trackers, learning apps, fitness challenges, or any app that requires consecutive daily actions.

Features #

  • πŸ”₯ Track daily streaks with automatic reset if a day is skipped.
  • πŸ‘₯ Support for single-user or multi-contributor streaks.
  • πŸ“¦ Custom persistence via StreakDelegate (local, database, or cloud).
  • πŸ“Š Store and retrieve streak count, date, contributors, and history.
  • ⏱️ Real-time updates through streams.

Getting started #

Add the dependency in your pubspec.yaml:

dependencies:
  flutter_streak: ^0.0.1

Then run:

flutter pub get

Usage #

Here’s a minimal example:

import 'package:flutter_streak/flutter_streak.dart';

class MyDelegate extends StreakDelegate {
  Map<String, dynamic>? _store;

  @override
  Future<Map?> get() async => _store;

  @override
  Stream<Map?> listen() async* {
    yield _store;
  }

  @override
  Future<void> set(Map<String, dynamic> props) async {
    _store = props;
  }
}

void main() async {
  await Streak.init(delegate: MyDelegate());

  // Increase streak
  await Streak.update();

  print('Current streak: ${Streak.i.value.count}');
}
3
likes
140
points
20
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

The flutter_streak Dart package provides a simple and flexible way to track user streaks in Flutter apps. It manages streak counts, contribution tracking, and daily progress while persisting data through a delegate system.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on flutter_streak