We have finally reached the last part of our series. In Part 4, we implemented the tracking logic and notifications. Now, we will discuss how to present this data to the user in a meaningful way and add the final "premium" polish to the application. In the industry, we often say that functionality is important, but user experience (UX) is what actually sells the app.
1. Data Visualization using fl_chart
Instead of showing raw numbers, it is much better to show charts. We are using the fl_chart package for this. For our Habit Tracker, we implemented a Weekly Trend chart to show activity compared to the previous week.
// presentation/widgets/stats_charts.dart
BarChart(
BarChartData(
barGroups: [
BarChartGroupData(
x: 0,
barRods: [
BarChartRodData(
toY: stats.lastWeekCompletions.toDouble(),
color: Colors.grey.withOpacity(0.3),
width: 22,
),
],
),
BarChartGroupData(
x: 1,
barRods: [
BarChartRodData(
toY: stats.currentWeekCompletions.toDouble(),
color: Theme.of(context).colorScheme.primary,
width: 22,
gradient: LinearGradient(
colors: [primary, primary.withOpacity(0.7)],
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
),
),
],
),
],
// ... titles and border configuration
),
)
By using gradients and subtle shadows, we make the charts look modern and professional.
2. Consistency Map (Heatmap)
The Heatmap is one of the most liked features of any productivity app. Borrowing the concept from GitHub's contribution graph, we show the user's progress for the last 90 days. This is basically a grid of colors where the intensity represents the completion rate of that day. It gives the user a solid sense of their overall consistency.
3. Adding UI Polish
To give the app a premium feel, we have focused on a few key areas:
Shimmer Loading: Instead of showing a blank screen, we use the shimmer package to show skeleton loaders. This makes the app feel faster.
Micro-interactions: We have used subtle animations for button presses and page transitions. In Flutter, AnimatedContainer and Hero widgets are very useful for this.
Design System: Strictly following Material 3 design tokens ensures that our typography, spacing, and colors are consistent across all features.
4. Release Preparation
Before publishing, it is very important to:
Configure App Icons: Use flutter_launcher_icons to generate icons for all resolutions.
Native Splash Screen: Ensure a smooth transition from the OS to your app with flutter_native_splash.
ProGuard/R8: If you are building for Android, ensure that your code is obfuscated to protect your logic.
Series Conclusion
We have come a long way! We started with a basic idea and built a full-featured, scalable, and production-ready Habit Tracker. We covered:
Clean Architecture & BLoC state management.
Supabase for Backend & Authentication.
Local Notifications for user retention.
Data Visualization for better insights.
I hope you have learned something valuable from this series that you can use in your own professional projects.
Source Code
The complete source code for this project is available on GitHub. I encourage you to check the repository, explore the implementation, and try adding your own features.
Github Repo: https://github.com/socialmad/habit_tracking
If you found this series useful, please consider giving a star to the repository and following me for more Flutter-related technical content. Happy coding!