Great video Robert, they are looking very slick and professional these days! Great topics to cover and just the right level of difficulty/complexity, thank you!
@@RobertBrunhage It shows too and I thought this was not as easy as it looked. Which is why I really appreciate content like this and what makes it high such value and useful. Everything is thoroughly planned, tested and thought through and distilled into a few minutes of pure gold! 💙
Do you have any recommendations to structure your codes? I have seen the videos on clean code architecture, but it's rather complex and bloated (due to blocs). Is there any simpler codes architecture that you personally used for build apps on flutter (not 1 screen type of app, at least few screens login, register, main page, etc).
Thanks for the valuable, very explicit information's and for the effort making it! I would like to see more riverpod tutorials, such as other provider type use cases similar to this video. Thank you!
Great content as usual! :) I did note though, when you're creating your movieServiceProvider, you're calling read() from inside the body of a Provider. I believe you want to use watch() instead. If you scroll down on the documentation of Riverpod (riverpod.dev/docs/concepts/combining_providers ), I noticed it says "Don't call read inside the body of a Provider"
This was really helpful thank you! I did have a question, I would like to see how to pass in a Cancel Token via the provider to the api method call. I'd like to be able to issue a cancel request if the user hits the back button while a rest call is in process to cleanly exit the call. Thanks again.
Great tut as usual Robert. Just wondering if you could elaborate on your comment at 4:49 re: creation of a Flutter app for web, and hiding the api-key as "middle person" / CORS?
You can create a api with firebase functions that you call from you Flutter app instead. That way it will work in web aswell! And the api will contain the api key etc
Nice video, one question, what if you want to display a loader indicator over your gridview (let say if your gridview is more complex than that and has a background image for example). After you use the 'when' method you only have some options: error, loading, data. Another question, when your widget transition from 'loading' to 'data' , con you use a custom transition? Like a fade animation or any custom transition.
There is a term called "New is glue", that means that if you instantiate a object you will be dependent on that specific one, this makes it hard if we want to unit test, as we can't decide what the _dio.get calls will do in this class. When we unit test with the approach shown in the video you can instantiate the MovieService class but instead send a MockDio in to it and tell it what it will return when you call _dio.get... This way we are not depandant on an internet connection during tests and also makes it a lot easier to test in general as we can test what we actually want to test (which is not our internet connection). Hope this makes a bit of sense, these concepts can be hard to grasp!
As per the riverpod documentation you should never use ref.read() inside a Provider. It's a bad practice. You are doing it inside the movieServiceProvider.
hi, thanks for making such a great video, i'm still learning flutter & dart and i can barely understand any of what you are typing, can you suggest me what font are you using in vscode, it looks so friendly and gets you motivation of some kind of sorts, also useful extensions you use. thanks 😊
Great tutorial but a small doubt accroding to riverpod documentation it is a bad idea to read another provider inside the body of Provider. Check Combining providers doc you will find a red area where it is mentioned.
Hi can you make a video of stream provider with riverpod and firestore. for calling data on login and use it every were without call it again and again.
And one more doubt can we use the data recived from futureprovider outside build method. I don't want the state to be rebuild just want to make an api call and fetch the data. How to implement that in riverpod.Thank you
First of all thank you you bring it ! You mentioned in passing MitM attack on API. Asked Daddy G but no good response or poor search query by me. What is your solution? Thanks
Thanks! When you have the api key in the code and make the http request, it's easy to find out what api key you are using. This is especially true in web as you can just open the network tab and see the outgoing request (with the api key). One approach is to have your own API which you authenticate to, and that api makes the requests with that specific API key.
I see that within both the movieServiceProvider and moviesFutureProvider you have called ref.read. I see lots of code snippets calling ref.read within a provider even though the riverpod documentation(riverpod.dev/docs/concepts/combining_providers/) explicitly says it is bad practice to do this. Did you know about this, and has it been changed? I am confused about whether it really is a bad practice or not. Great video!
It should be ref.watch, if you want you can make a PR to the repo. It was a bit different before as they combined the Provider and Computed to one. But yes the right approach is ref.watch!
@@RobertBrunhage Something akin to a chat app would be fab. I know this is possible with Firebase, but we already have a perfectly good DB. I have something kinda working, but would love to know how to do it 'properly' :)
At 6:25 you use ref.read to get the movieService, however Remi stipulates (riverpod.dev/docs/concepts/combining_providers) that "DON'T CALL READ INSIDE THE BODY OF A PROVIDER". Am I missing something here, or is there a scenario where it is acceptable?
I love Flutter hooks and use it, in my own projects but I think it's easier to teach concepts one at a time. I think hooks needs its own video first :)
He came up with a great way to teach for sure, and to me is one of the best ways of teaching. Of course I have talked to him as well as he has made videos on how he makes videos. Did you not find it enjoyable or do you know something that can be improved? Still trying to make the style my own :)
i am missing something here getting any error on final results = List.from(response.data['results']); Type ‘String’ is not a subtype of type ‘int’ of ‘index’ here is the code Future getDefaults() async { final response = await _dio.get("5f279ddaf5d27e001612e29b.mockapi.io/Default"); print(response.data); final results = List.from(response.data['results']); List defaults = results .map((defaultData) => Default.fromMap(defaultData)) .toList(growable: false); return defaults; }
@@RobertBrunhage You Say Some Advanced Stuff So I Do Not Understand it. But You Can Explain Every Thing You See It Advanced For Beginner. Thank You For Your Attention And Time
It's a good video but I think your latest 6 videos thumbnails are way too similar to Fireships. Feels abit like you what people to accidentally press your video, believing they're pressing a Fireship video to gain views of his success.
That is not my goal and my thumbnails are something I am working on all the time. I have sessions one Twitter where I ask feedback on this so very open to how I can improve them! If you have feedback on how they can be changed I am always open for feedback on it! :)
Design, API, State Management, Exception handling, Dart argument, Dio ... in 11 mn !!! What you did is amazing, keep up
Exactly. When I saw the initial video, I thought this is gonna a fast coding video, but no, he actually did explain all of it. Amazing
Man, your content is high quality! Keep it up!
Thanks Luis!
Great video Robert, they are looking very slick and professional these days! Great topics to cover and just the right level of difficulty/complexity, thank you!
Really enjoying this format, keep it up!
Thanks Nash, will do!
Wow, this outstanding and a very useful example. One of your best videos so far! Plus you make it seem so simple! 💙👍
Thanks Mike!
Simplicity is the hardest, this took 3 days of code refining and testing to get to that point!
@@RobertBrunhage It shows too and I thought this was not as easy as it looked. Which is why I really appreciate content like this and what makes it high such value and useful. Everything is thoroughly planned, tested and thought through and distilled into a few minutes of pure gold! 💙
Best value for time !
Just Wow! Thank you very much for the clear explanation.
Haven't watched yet but thanks for this.
Hope you like it!
We are Checking it out!
GREAT ONE!!
Should make a more Industry standard robust Tutorial (multi videos) one!!
Thanks!
That will be the course I am working on robertbrunhage.com
Awesome....sweet and short tutorial
Do you have any recommendations to structure your codes? I have seen the videos on clean code architecture, but it's rather complex and bloated (due to blocs). Is there any simpler codes architecture that you personally used for build apps on flutter (not 1 screen type of app, at least few screens login, register, main page, etc).
What is the name of the vscode extension for serializing ?
ua-cam.com/video/gFLcYjFqC5c/v-deo.html
So clean and easy Implementation in DIO 👌. By the way : you used: „toList(growable: false);“ what‘s the growable for 🤔?
It means the list will be fixed, I think this had an excellent explaination!
docs.w3cub.com/dart~2/dart-core/list-class/
Thanks for the Link Robert 😊
Nice Video.Explained Well.👍
Thank you, happy you liked it!
@@RobertBrunhage Keep posting amazing videos 👍
Superb! Thx 👌
What is the VS Code extension at 3:48 to generate JSON serialization?
Thanks for the valuable, very explicit information's and for the effort making it! I would like to see more riverpod tutorials, such as other provider type use cases similar to this video. Thank you!
Neat ! Thank you for this tutorial .
Great content as usual! :)
I did note though, when you're creating your movieServiceProvider, you're calling read() from inside the body of a Provider.
I believe you want to use watch() instead.
If you scroll down on the documentation of Riverpod (riverpod.dev/docs/concepts/combining_providers ), I noticed it says "Don't call read inside the body of a Provider"
Nice that you saw that! If you want, you can create a PR on the repo!
This was really helpful thank you! I did have a question, I would like to see how to pass in a Cancel Token via the provider to the api method call. I'd like to be able to issue a cancel request if the user hits the back button while a rest call is in process to cleanly exit the call. Thanks again.
Great tut as usual Robert. Just wondering if you could elaborate on your comment at 4:49 re: creation of a Flutter app for web, and hiding the api-key as "middle person" / CORS?
You can create a api with firebase functions that you call from you Flutter app instead. That way it will work in web aswell!
And the api will contain the api key etc
Can anyone recommend a tutorial for creating a middle man api to not expose the api key on the web?
ua-cam.com/video/gFLcYjFqC5c/v-deo.html
Nice video, one question, what if you want to display a loader indicator over your gridview (let say if your gridview is more complex than that and has a background image for example).
After you use the 'when' method you only have some options: error, loading, data.
Another question, when your widget transition from 'loading' to 'data' , con you use a custom transition? Like a fade animation or any custom transition.
03:11 Why we need to create final Dio _dio; in movie_service.dart?
Can't we send the request without creating a field? What's the difference?
There is a term called "New is glue", that means that if you instantiate a object you will be dependent on that specific one, this makes it hard if we want to unit test, as we can't decide what the _dio.get calls will do in this class.
When we unit test with the approach shown in the video you can instantiate the MovieService class but instead send a MockDio in to it and tell it what it will return when you call _dio.get...
This way we are not depandant on an internet connection during tests and also makes it a lot easier to test in general as we can test what we actually want to test (which is not our internet connection).
Hope this makes a bit of sense, these concepts can be hard to grasp!
@@RobertBrunhage : Thanks for the reply. :)
ho!!! man to the point no bushtits gold quality content.
Good One
Thanks!
As per the riverpod documentation you should never use ref.read() inside a Provider. It's a bad practice. You are doing it inside the movieServiceProvider.
hi, thanks for making such a great video, i'm still learning flutter & dart and i can barely understand any of what you are typing, can you suggest me what font are you using in vscode, it looks so friendly and gets you motivation of some kind of sorts, also useful extensions you use.
thanks 😊
Thanks!
We all start somewhere, you will understand more as you practice!
The font I am using in JetBrains Mono
How did u run the app? Exception has occurred.
DioError (DioError [DioErrorType.RESPONSE]: Http status error [401])
These types of videos are great. I want to create these types of videos as well what do you use to make these?
Great tutorial but a small doubt accroding to riverpod documentation it is a bad idea to read another provider inside the body of Provider. Check Combining providers doc you will find a red area where it is mentioned.
Hi can you make a video of stream provider with riverpod and firestore. for calling data on login and use it every were without call it again and again.
NIce Job!
Thanks!
thanks for this great content. could you make I video to how use getX and riverpod together in the same project?
And one more doubt can we use the data recived from futureprovider outside build method. I don't want the state to be rebuild just want to make an api call and fetch the data. How to implement that in riverpod.Thank you
First of all thank you you bring it ! You mentioned in passing MitM attack on API. Asked Daddy G but no good response or poor search query by me. What is your solution? Thanks
Thanks!
When you have the api key in the code and make the http request, it's easy to find out what api key you are using. This is especially true in web as you can just open the network tab and see the outgoing request (with the api key).
One approach is to have your own API which you authenticate to, and that api makes the requests with that specific API key.
What's the provider snippet extension that you use...seems hella useful
I see that within both the movieServiceProvider and moviesFutureProvider you have called ref.read. I see lots of code snippets calling ref.read within a provider even though the riverpod documentation(riverpod.dev/docs/concepts/combining_providers/) explicitly says it is bad practice to do this. Did you know about this, and has it been changed? I am confused about whether it really is a bad practice or not. Great video!
It should be ref.watch, if you want you can make a PR to the repo. It was a bit different before as they combined the Provider and Computed to one.
But yes the right approach is ref.watch!
Do you cover websockets in any of your Flutter videos pls?
Have not done that, but will write it up!
@@RobertBrunhage Something akin to a chat app would be fab. I know this is possible with Firebase, but we already have a perfectly good DB. I have something kinda working, but would love to know how to do it 'properly' :)
How to make multiple future calls to show json data from api to home page in flutter ? Can you make a video on this ?
U fucking serious omg thank u sooo much ur follower from twitter :D
At 6:25 you use ref.read to get the movieService, however Remi stipulates (riverpod.dev/docs/concepts/combining_providers) that "DON'T CALL READ INSIDE THE BODY OF A PROVIDER". Am I missing something here, or is there a scenario where it is acceptable?
Nope you are not missing anything, the change is up on GitHub and is using .watch! :)
Hi please do new totrial on riverpod hooks freezed thanks
When i run flutter debug it is stuck at connecting to vm service at ws://127.0.01 what do i do
Don't you like Flutter hooks (hooks_riverpod) or too much effort for such a small project with only one screen?
I love Flutter hooks and use it, in my own projects but I think it's easier to teach concepts one at a time.
I think hooks needs its own video first :)
Don't teach your dad😂
what font do you use in IDE?
I use JetBrains Mono!
Plz 🙂 Automatic captions on videos-on-demand
Does flutter uses any IDE for the development
what is this font
how to get datasets
Name if vscode font?
JetBrains Mono!
Bro can you make tutorial for the music player aap
ua-cam.com/video/gFLcYjFqC5c/v-deo.html
plz use hive to save data in this app
Do you want a tutorial on Hive?
@@RobertBrunhage plz use hive to save todo on riverpod example todo app
ua-cam.com/video/gFLcYjFqC5c/v-deo.html
which fonts are used in vs code???
ua-cam.com/video/gFLcYjFqC5c/v-deo.html
Your video edit looks a lot like Fireship.io youtube channel
A lot of inspiration from him, he came up with a great way to teach!
Yeah.
For me, Robert's video is in perfect pace. 😁
dude how much of fireship.io vibe did you copy?
He came up with a great way to teach for sure, and to me is one of the best ways of teaching. Of course I have talked to him as well as he has made videos on how he makes videos. Did you not find it enjoyable or do you know something that can be improved?
Still trying to make the style my own :)
ua-cam.com/video/gFLcYjFqC5c/v-deo.html
i am missing something here
getting any error on final results = List.from(response.data['results']);
Type ‘String’ is not a subtype of type ‘int’ of ‘index’
here is the code
Future getDefaults() async {
final response =
await _dio.get("5f279ddaf5d27e001612e29b.mockapi.io/Default");
print(response.data);
final results = List.from(response.data['results']);
List defaults = results
.map((defaultData) => Default.fromMap(defaultData))
.toList(growable: false);
return defaults;
}
ua-cam.com/video/gFLcYjFqC5c/v-deo.html
Shop with full functionality please like from woo
Did not understand anything 😢
That is not good. Anything special you don't understand that could be improved in the video?
@@RobertBrunhage You Say Some Advanced Stuff So I Do Not Understand it.
But You Can Explain Every Thing You See It Advanced For Beginner.
Thank You For Your Attention And Time
It's a good video but I think your latest 6 videos thumbnails are way too similar to Fireships. Feels abit like you what people to accidentally press your video, believing they're pressing a Fireship video to gain views of his success.
That is not my goal and my thumbnails are something I am working on all the time. I have sessions one Twitter where I ask feedback on this so very open to how I can improve them!
If you have feedback on how they can be changed I am always open for feedback on it! :)
@@RobertBrunhage I don't have any feedback, but it's good to see you trying to improve, it's a great channel otherwise with good tutorials!
@@AXYGaming Thanks, doing my best!