Flutter Personal Habit Tracker
Build a Flutter app for building daily habits, such as reading, drinking water or exercising. You add habits, tick them off each day, and see your current streak, the number of days in a row you've done each one, plus your best streak ever. Everything is saved on the phone with shared_preferences, so no account is needed. Small animations make ticking a habit off satisfying. It's a great first Flutter project: you'll learn widgets and lists, stateful widgets, saving data on the device, working with dates, and a bit of animation.
- Estimate
- ~8h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
Flutter · shared_preferences
Project roadmap
- 01
Build the habit list
~1.5hCreate a project with flutter create. Define a Habit class (id, name, created date, and a set of the dates it was completed, stored as YYYY-MM-DD text). Show the habits in a ListView, with a floating button that opens a dialog to add a habit (the name can't be empty or a duplicate) and swipe to delete with a confirmation. Done when: habits can be added and deleted.
- 02
Tick off today
~1hGive each habit a checkbox for today. Ticking it adds today's date to the habit's completed dates; unticking removes it. Use today's local date, not the time, so the checkbox resets the next morning. Show how many habits are done today at the top, for example 2 of 5 done. Done when: ticking habits updates the counter, and the ticks reset on a new day.
- 03
Save to the device
~1.5hAdd shared_preferences, convert the habits to JSON with toJson and fromJson methods, and save the list whenever it changes. Load it when the app starts, showing a loading indicator until then. If the saved data can't be read, start empty and show a message instead of crashing. Done when: habits and ticks are still there after closing and reopening the app.
- 04
Calculate streaks
~1.5hWrite functions that calculate the current streak (consecutive days ending today, or ending yesterday when today isn't ticked yet, so the streak doesn't look broken in the morning) and the best streak ever. Show both on each habit, with a flame icon. Show a simple 7-day row of dots for the last week. Done when: the streaks match the ticked days, including across the end of a month.
- 05
Add polish
~1hAnimate the tick (for example with AnimatedScale or AnimatedContainer), show a friendly empty state when there are no habits, and show a short message when a streak reaches 7, 30 or 100 days. Done when: the app feels responsive, and the empty state appears when all habits are deleted.
- 06
Test it
~1.5hWrite unit tests for the streak calculations (no ticks, only today, a gap, across months, and not ticked today but yesterday) and for JSON saving and loading, plus a widget test that adds a habit and ticks it. Done when: flutter test passes.
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack