Hello Hive 👋
I just realized it's been 11 days since I last posted in this series. Maybe I should do it more often. It would be more digestible than giving you a big article full of new features that I can only show you on the surface.
I'm not sure yet, so let me know what you think.
As a reminder, my goal is to publish an app on the PlayStore by the end of 2024.
Today, I want to share with you the progress made since my last article.
Data Storage Management (SharedPreferences) 💻
In developing my Flutter app, one of the first crucial technical decisions was the choice of local data storage on the user's phone.
In fact, I tried to understand how the real HabitKit app's data is stored, and I believe it's locally. So, the information is not stored on servers.
Determined to do the same, I researched the different options available. I didn't search for long because the first Google link I clicked on was about SharedPreferences.
From what I've read, it's ideal for persistently storing small amounts of data, which perfectly suits my needs since my app doesn't require storing large amounts of information.
Moreover, I'm taking note of this solution for my future apps because it offers many advantages:
- It allows the app to operate autonomously, without depending on an internet connection. This means users can access the app, create new habits, and track their progress even when they're offline.
- Also, this approach respects users' data privacy and security more, as it remains stored on their own device. So, the user is the only one responsible for their data.
However, I had some setup issues. I have a good experience with external databases. Therefore, the transition to a local storage logic confronted me with a learning curve I didn't particularly expect.
With a database, the structure and data management are more explicit and organized. I can thus have a clear vision of how information is stored and interconnected.
On the contrary, even if SharedPreferences is effective for simple needs, the manipulation and persistence of data are really different. In itself, it took me 30 minutes to allow my app to store data correctly, but I couldn't exactly describe the storage process. Sometimes, there are things logical for others but not at all for me. SharedPreferences is one of them.
Dynamic Display of Habits 📱
After overcoming the challenges of local storage, the next step was to set up a display system to present the habits recorded by users.
The heart of this feature relies on designing custom cards for each habit:
- Each card displays the logo chosen by the user.
- The habit's title.
- A short description.
- The card's color must take the color selected by the user at the time of creating their habit.
Having a foundation in Flutter, I didn't have much trouble integrating this.
The real challenge occurred when integrating a horizontal calendar within each card. The idea was to visualize the last 365 days to allow users to follow their consistency and progress in maintaining their habits. Unlike a classic vertical calendar, where days align from top to bottom and left to right, my goal was to create a calendar where each column represents a week, with days arranged vertically from Monday to Sunday.
This step reminded me of how, in development, challenges can arise where we least expect them. But I think that's the same for everything.
After several attempts and adjustments (more than 2 days), I succeeded :
The last column, all the way to the right, represents the current week, with a color system to indicate the days when the habit was respected.
A key interactive element added to each card is a "check" button, which allows users to mark a habit as completed for the day. The act of checking off a habit triggers a visual update of the grid.
For example, today is Tuesday. So, if I click on the button to validate my habit, it should color the second box on the far right:
Annnnnnnnd.... :
So I can already start tracking down some of my habits!
Persistent Bugs 🪲
Although I've made progress, a problem remains: the weekly data storage crashes when moving to a new week.
This bug represents my next objective. I'm relatively confident. From the moment I managed to create the calendar, I feel like nothing can touch me.
So, I will take advantage of this extra confidence to move forward.
Next Steps 🚶
With data storage being resolved, my attention now turns to enriching the app with new features.
The next steps include two main objectives: the ability to delete a habit and the implementation of a function to modify already created habits.
1. Deleting a Habit ❌
Whether a habit is no longer relevant, achieved, or simply because the user wants to focus on other goals, it's important to be able to easily remove a habit from the list.
Once my bug is resolved, this will be the next feature to add. It shouldn't be difficult...
...But difficulties are where we least expect them, so I remain on my guard.
2. Modifying a Habit ✏️
The next feature will be to offer the ability to modify an existing habit. Users may want to adjust the title, description, frequency of reminders, or even the color and icon associated with a
habit.
By "user" I mainly mean myself, my friends, and my family.
Goal Reminder 🎯
My goal to publish an app on the PlayStore by the end of 2024 remains unchanged. The app in development is not intended for publication due to its nature as a copy. ^^
Nonetheless, the skills, knowledge, and experience gained through this project are invaluable and will contribute, I hope, to the success of future original projects intended for publication.
The article's presentation photo is generated by AI and edited with Canva.
All photos are screenshots taken from my smartphone and represent my application.
The English translation is done with DeepL.
Congratulations @genesisledger! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
Your next target is to reach 5000 upvotes.
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Check out our last posts:
Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!
Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).
You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.
I really like how you are showing people the low level decisions that are involved with making an application. You might like the Software Engineering community where we are trying to create a place for professional IT workers to ask for or give advice about tech-related skills and careers.
https://hive.blog/trending/hive-186568 #sbi-skip
Hey, thanks for the suggestion, I'll take a closer look next time. Is this a new community?
I try to make my articles simple to understand so that they remain accessible. My goal isn't really to explain to people how to code an application. Programming is an art, and everyone has their own way of programming. No, my aim is above all to show that with a little good will, even if you only think about it for a few hours a month, you can achieve great things if you are regular in your tasks.
Yes, I just started it. I look forward to your contributions!