Habit Tracker

Loading preview

Starting the Flutter app

A Flutter habit tracker with tappable week rows, computed streaks, week navigation and undoable habit removal.

Get the source

Add it to your project

Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.

First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.

Each _Habit stores completed days as a set of date-only values, so a toggle is one set operation and streaks are computed instead of stored. streak walks backwards from today, or from yesterday when today is still open, so an unfinished day does not reset the count. Dates go through _addDays, which uses calendar arithmetic to avoid daylight saving drift. Weeks start on Monday, future days are disabled, and navigation stops at the current week. To persist habits, serialize done as ISO dates. Weekly or custom schedules would need a per-habit list of active weekdays that streak skips over.