Habit tracker in Flutter
Track daily habits with streaks and a calendar heat map, on Android and iOS from one codebase.
Beginnerâą 10â14 hoursđĒ 7 stepsFlutterDartLocal storage
What you'll learn
- âFlutter widgets and layout
- âState management with Provider or Riverpod
- âSaving data locally
What you'll build
- âAdd habits with an icon and colour
- âTick today's habits
- âCurrent and best streak
- âMonthly heat map
Step-by-step guide
- 1
Create
flutter create habits; run on an emulator or your phone.
- 2
Model
class Habit { String id; String name; int color; Set<String> doneDays; } where days are "2026-11-28" strings.
- 3
State
A ChangeNotifier HabitStore with add, toggleToday, delete; provide it with Provider at the root.
- 4
Storage
Save the list as JSON with shared_preferences (or use a local database like Hive/Isar for more data).
- 5
Streaks
Count back from today while the day is in doneDays; best streak = longest run in the sorted list.
- 6
Heat map
A GridView of the month's days, colour opacity by done/not done.
- 7
Reminders
Daily local notification with flutter_local_notifications.
đ Make it stand out
- +Weekly goals (3 times a week)
- +Charts
- +Cloud sync with login