Awesome!! You're very welcome. Thanks for leaving a comment. Happy that I could help. Lots of devs use it for the wrong reasons expecting different results when it's not meant for that.
Hi Dane, I'm just curious, why did you create RemoteConfigService() as a self contained singleton? You are after all always using it as singleton via GetIt and always getting the same instance from the locator anyway, so is it really required? Could you not do something like this in the locator.dart file for it instead: locator.registerSingletonAsync(() async => RemoteConfigService.initialise()); ? Just noticed, you need GetIt >4 for that "registerSingletonAsync" feature and this codebase was on version 3. Also I have not actually tested upgrading your project to GetIt v4 and trying the above suggestion, so might be that it does not work for your use case. Might work though, if it does it would make the locator.dart file a bit cleaner and definitely reduce the complexity (self contained singleton with async instance initializer) of the RemoteConfigService. That is if it works of course 😬 I have to admit though that I have not built along my own version of series, so I'm not up to speed on all the details. I'v just enjoyed watching it and following along casually. I should probably go through the entire series in detail before asking silly questions... 😀
Hi Mike! No silly questions, it's very valid. You can definitely do it like that. I think that should work fine. I was in a bit of a rush with this video so I fell back onto old implementation patterns :) I've tried to use the async registration but before but it failed due to not checking ready or something like that. So I'd rather not add more code to check if the instance is ready before using. I am busy with an architecture review so I'll be upgrading everything and making use of the newer versions and features.
Even the official Firebase Flutter documents doesn’t demonstrate it clearly but you do. I really thought this is a basic version of Real-time Database but after implementing it to my project in a few minutes, I understood it isn’t. I could still use it with a cache expiration duration like 1 minute or so.
Thank you, I appreciate that. And ye, you are right. They don't document things clearly. If you do cache expiration of a minute then you might get throttled by them. If you need realtime functionality look at things like flagsmith or launch darkly
@@FilledStacks you know, you don’t have to write the alternative options down but you still do. I admire your professional ethics and kind personality. Thanks.
@@FilledStacks awesome!, I'm going to try, what I'm looking for is applying DDD, and for the Presentation part I can also handle it with Mvvm I also think it's possible but without exposing the model, managing it with Stream and Events that Bloc provides
@@AndresJimenezS Sounds like a good idea. Way too complicated for me but if the application type requires it then it should be a great solution. Goodluck!
Hi , I have been using your architecture in my flutter apps recently and i really got used to it because its practical and easy to use. But i have one question, is it ok to inject a service inside another service and use or its a bad practice and i should only inject services in viewModels? Thank you and keep up the good work :)
Yes, services going into other services is perfectly fine. That's how you build up more complete functionality services. For instance I use the shared preferences service, Authentication service and DatabaseService to provide a single function from my OrdersService. It's expected and promoted behaviour.
@@FilledStacks Thank you for your reply :) So basically I was thinking of implementing a repository as a service, and I thought it would be logical to inject in it the remote database service (Firestore) and the local one (mysqli for example). Does this sound like a correct way to implement a repository (which its single purpose is to reduce remote requests) using this architecture? :)
@@FilledStacks omg thank you. so i created another firestore collection named report with document id of users, post, and 'photoCollection' each has 'userId' for reference. i was able to get each collection by manually creating a stream to filter and get the document id of ex. post's and then i was able to get information's of the post by its document id by creating a futurebuilder. in the report page i created 3 stream with nested future to get the data from each document id. i think there's a better way to do it lol
@@FilledStacksi want to get data from documents id that i stored in one collection. ex. collection album has userId, postId, albumId this are document id from another collection.
@@kemids2842 If you have the document id you can simply call get on the collection with a direct reference. collection.document(id).get() . I'm probably not understanding, and also comments is not a place where you'll get any meaningful code debugged. If your code is working you'll have to stick to it for now :)
It might be if you're not familiar with the SOLID principles or code separation. But the tutorial was so short I haven't seen an easier / faster / clean implementation of remote config. Or at least I didn't see one while doing my research for this video.
thats one great explanation
Thank you arnab! I'm happy to hear that it made sense.
Really good explanation, especially on what remote config is and is not for - helped me a lot. Cheers
Awesome!! You're very welcome. Thanks for leaving a comment. Happy that I could help. Lots of devs use it for the wrong reasons expecting different results when it's not meant for that.
Great video and tip as well :)
What do you use in local? Like dotenv and maybe sync?
Thank you. I haven't used dotenv for Flutter. Also haven't thought of using remote config for environment config. But that's a good idea too.
Hi Dane, I'm just curious, why did you create RemoteConfigService() as a self contained singleton? You are after all always using it as singleton via GetIt and always getting the same instance from the locator anyway, so is it really required? Could you not do something like this in the locator.dart file for it instead: locator.registerSingletonAsync(() async => RemoteConfigService.initialise()); ?
Just noticed, you need GetIt >4 for that "registerSingletonAsync" feature and this codebase was on version 3. Also I have not actually tested upgrading your project to GetIt v4 and trying the above suggestion, so might be that it does not work for your use case. Might work though, if it does it would make the locator.dart file a bit cleaner and definitely reduce the complexity (self contained singleton with async instance initializer) of the RemoteConfigService. That is if it works of course 😬
I have to admit though that I have not built along my own version of series, so I'm not up to speed on all the details. I'v just enjoyed watching it and following along casually. I should probably go through the entire series in detail before asking silly questions... 😀
Hi Mike! No silly questions, it's very valid. You can definitely do it like that. I think that should work fine. I was in a bit of a rush with this video so I fell back onto old implementation patterns :) I've tried to use the async registration but before but it failed due to not checking ready or something like that. So I'd rather not add more code to check if the instance is ready before using.
I am busy with an architecture review so I'll be upgrading everything and making use of the newer versions and features.
Love your videos... Thank you!
Thank you! and you're very welcome. I love making them
Even the official Firebase Flutter documents doesn’t demonstrate it clearly but you do. I really thought this is a basic version of Real-time Database but after implementing it to my project in a few minutes, I understood it isn’t. I could still use it with a cache expiration duration like 1 minute or so.
Thank you, I appreciate that. And ye, you are right. They don't document things clearly. If you do cache expiration of a minute then you might get throttled by them. If you need realtime functionality look at things like flagsmith or launch darkly
@@FilledStacks you know, you don’t have to write the alternative options down but you still do. I admire your professional ethics and kind personality. Thanks.
@@rikyriky966 You are very welcome. I'm here to help grow our community. Spreading helpful information is apart of that. Thanks for your kind words.
the BaseModel class architecture is compatible with a Bloc arch instead of changeNotifier ? thanks for your amazing videos
You're very welcome and yet it is. I don't know if you'd want to mix bloc and Mvvm but you can definitely try
@@FilledStacks awesome!, I'm going to try, what I'm looking for is applying DDD, and for the Presentation part I can also handle it with Mvvm I also think it's possible but without exposing the model, managing it with Stream and Events that Bloc provides
@@AndresJimenezS Sounds like a good idea. Way too complicated for me but if the application type requires it then it should be a great solution. Goodluck!
hey sir I just wanted to have a review if we can use firebase remote config with email_auth package
Hey, why do you think they need to be used together?
hi its very helpful, just one question how to display user info from firebase
(like name and email) in his profile ?
Awesome. The same way I show in my startup logic and user profiles video. Get the user data from firestore and then use it where you want to.
can u please tell me how to test or mock in unit test?
yes, you can watch my latest how to unit test video.
Nice explanation
Thank you!
Thanks a lot ❤️
You're very welcome. Thanks for watching.
Hi , I have been using your architecture in my flutter apps recently and i really got used to it because its practical and easy to use.
But i have one question, is it ok to inject a service inside another service and use or its a bad practice and i should only inject services in viewModels?
Thank you and keep up the good work :)
Yes, services going into other services is perfectly fine. That's how you build up more complete functionality services. For instance I use the shared preferences service, Authentication service and DatabaseService to provide a single function from my OrdersService. It's expected and promoted behaviour.
@@FilledStacks Thank you for your reply :)
So basically I was thinking of implementing a repository as a service, and I thought it would be logical to inject in it the remote database service (Firestore) and the local one (mysqli for example).
Does this sound like a correct way to implement a repository (which its single purpose is to reduce remote requests) using this architecture? :)
@@khalilamor7771 Yes that sounds good. I use multiple repositories in my database which I interact with through my database service
So this could be considered an implementation of Feature Flags, no?
Yes, This is a tool you can use to build feature toggles into the app.
Great content as always.
Thank you Alexander :)
Thanks you for knowledge sir🖤
You're very welcome! Thanks for watching
always love your tutorials. can you give me tips how can i do complex queries
Thank you. It all depends on the query. Give an example and I'll see if I know how to query for it.
@@FilledStacks omg thank you. so i created another firestore collection named report with document id of users, post, and 'photoCollection' each has 'userId' for reference. i was able to get each collection by manually creating a stream to filter and get the document id of ex. post's and then i was able to get information's of the post by its document id by creating a futurebuilder. in the report page i created 3 stream with nested future to get the data from each document id. i think there's a better way to do it lol
@@kemids2842 You implementation sounds very complex. What do you want to achieve? What's the data you're looking for?
@@FilledStacksi want to get data from documents id that i stored in one collection. ex. collection album has userId, postId, albumId this are document id from another collection.
@@kemids2842 If you have the document id you can simply call get on the collection with a direct reference. collection.document(id).get() . I'm probably not understanding, and also comments is not a place where you'll get any meaningful code debugged. If your code is working you'll have to stick to it for now :)
please make .where queries
I might do that. I was planning on doing queries but it's very specific to implementations so I'll have to think of a scenario to use it in.
So complicated
It might be if you're not familiar with the SOLID principles or code separation. But the tutorial was so short I haven't seen an easier / faster / clean implementation of remote config. Or at least I didn't see one while doing my research for this video.
Hi :D
Hi hi hi :D
First?
1 minute too late :) Pavan was first
Lol well done Pavan