Flutter Puzzle Hack Updates

Jackie Moraa
2 min readApr 29, 2022

If you read my previous post, then you’re aware that I participated and successfully submitted my project for the Flutter Puzzle Hack. My main aim for taking part in the challenge was to simply push myself to practice more.

There were over 5,500 devs with different experience levels from over 120 countries who participated in this puzzle challenge. That’s a lot of puzzles! A huge round of applause to everyone who took part in this. View the winners and all the other submissions in this gallery.

As I’d mentioned, my application was very basic. But I managed to get myself a certificate of participation which came in the mail last week. So I was pretty pleased about that. A small feat, yes — but we celebrate those around here. Here’s to many more…

Another quick update — Call me a Lannister because I always pay my debts 😂
From the previous post, you’d recall that I had a technical debt to pay. I discovered that my app had a bug. The music, if toggled on, would still continue playing even if the app was no longer in the foreground.

The below code snippet is an implementation of how I went about to solve the issue at hand. So using the didChangeAppLifecycleState method, I’ve been able to check on the app state and know when the system puts the app in the background or returns it to the foreground.

Therefore, based on whether the music was playing before, I the _assetsAudioPlayer is opened, paused or stopped. However, I noticed that the pause() is not really ‘pausing’. By this I mean, the song is not resuming from the timestamp where it was halted when the app state changed rather, whenever the state is resumed the audio keeps starting from the beginning. Yet, another thing I might need to look into later.

I have updated the code on my repo. If you can, have a look and share some insights where possible.

Thank you for reading ❤

--

--