What is the benefit of using riverpod her to get a global reference to HiveRepository? Can't you just create a global final variable with an instance of the HiveRepsitory? It seems like over kill to get effectively a singleton and I've never seen the reason explained. You're not changing the hiveRepository so there is nothing to watch. I keep seeing examples like this so there must be a reason?
Good question, in this case using a global instance would work about the same. In a future video about resetting the game data Riverpod makes it easier (IMO) to show the changes to the user. But again that could be done without Riverpod and listening to hive's changes directly. While this example isn't using Riverpod in a way that's necessarily better, I like to use it for instances like this vs creating a global singleton - because I know later if I want to add more complex Future/Stream providers or notifiers I can. Some might call this over engineering - but the video is an example of one aspect of the app, and other areas of the app will be using Riverpod, so my thinking is to just use it everywhere.
Yes it appears that way. If I were building this now, I would use shared_preferences instead of Hive - if the data being stored is all simple key/values. For more complex local storage I'd probably use sqflite
Bro how you are pushing yourself to upskill and uploading RUclips regularly irrespective of views and likes. I used to watch your videos in lockdown and I have developed one Android app. I left that project 2 years ago, i tried to work on it in between but I am not getting that push. I forgot most of the skills.
I made this video awhile back trying to explain how to stay motivated maybe it'll help. ruclips.net/video/qkekZNjgiZ4/видео.htmlsi=YFWwG2mXCH_-tHgG But also, it's fine to try other things than just programming apps 😎
These tutorials are so useful, you're saving my life
This just made my week, thank you, you're my personal hero
Glad I could help!
Thanks for the video! What addon are you using that shows you the error inline?
It's called Error Lens this is my full VS code setup ruclips.net/video/rSI3-zxJZVc/видео.html
What is the benefit of using riverpod her to get a global reference to HiveRepository? Can't you just create a global final variable with an instance of the HiveRepsitory? It seems like over kill to get effectively a singleton and I've never seen the reason explained. You're not changing the hiveRepository so there is nothing to watch. I keep seeing examples like this so there must be a reason?
Good question, in this case using a global instance would work about the same. In a future video about resetting the game data Riverpod makes it easier (IMO) to show the changes to the user. But again that could be done without Riverpod and listening to hive's changes directly.
While this example isn't using Riverpod in a way that's necessarily better, I like to use it for instances like this vs creating a global singleton - because I know later if I want to add more complex Future/Stream providers or notifiers I can.
Some might call this over engineering - but the video is an example of one aspect of the app, and other areas of the app will be using Riverpod, so my thinking is to just use it everywhere.
@@1ManStartup I’ve used their async notifier to solve a local list problem backed by an API. That was worth it. Would work will with Hive too.
I love your channel but I think that Hive is no longer updated.
Yes it appears that way. If I were building this now, I would use shared_preferences instead of Hive - if the data being stored is all simple key/values.
For more complex local storage I'd probably use sqflite
@@1ManStartup Thank you for answer. You are the best!
Bro how you are pushing yourself to upskill and uploading RUclips regularly irrespective of views and likes. I used to watch your videos in lockdown and I have developed one Android app.
I left that project 2 years ago, i tried to work on it in between but I am not getting that push. I forgot most of the skills.
I made this video awhile back trying to explain how to stay motivated maybe it'll help. ruclips.net/video/qkekZNjgiZ4/видео.htmlsi=YFWwG2mXCH_-tHgG
But also, it's fine to try other things than just programming apps 😎