How to use Provider in Flutter
HTML-код
- Опубликовано: 9 фев 2025
- In this tutorial, you will learn how to use Provider in Flutter. You can also check out the following link to read from a written tutorial: medium.com/lev...
Migration Provider v3 to v4: • Flutter Provider Migra...
Code: git.io/Je4ZP
🔥 My Website: thinkdiff.net
This was a very good tutorial. I was having pretty difficulty understanding the concepts. This made them clear. Thank you.
Glad it was helpful!
Most clear explanation so far ; )
Thank you for watching. I wish you all the best.
Very helpful explanation, I have seen 2-3 tutorials before this, but could not understand. This one is great. Thanks, Btw please use dark theme :)
Thank you, I will
Best Provider tut, Thank You ;)
also at me like to listen classic music until I am programming, thanks for this video🙏
Thank you, very helpful
Thank you so much
please make us some project base app java/kotlin :)
your tutorial is almost well :)
Thank You, I noted.
@@mahmud-ahsan Thank you sir, we are waiting for your important Tutorial.
thank you, are you Bengali ?
yes
how to avoid unnecessary rebuilds? example:
Widget A.
Widget B.
Widget C.
Here when I update a state in Widget A with provider, the Widgets B and C rebuilds too.
So how to avoid unnecessary rebuilds in B and C ?
If your widget B and Widget C don't have any changes, those will not rebuild though the root widget A rebuild. It's followed how React works. They have internal algorithm that checks the minor changes before rendering that part.
@@mahmud-ahsan thank you, but I checked out it rebuilds Widget C even there is not changes and Widget B and C is child Widget A, when A changes the B and C also get rebuilds even C is not necessary to rebuild.
Is this making your app slow ? or did you notice any performance issue ?
@@mahmud-ahsan this is really a good way to share state between widgets, but problem is after updating one state all sub widgets get rebuilds even some widget dont have to rebuilds because the update is not related to the widget, but becuase of being sub widgets it gets rebuild. and this actually affect on app performance.
Here in tutorial that is not a problem becuase there is less widgets, but think for a big application with more than 20 sub widgets difinitly affect on application performance.
I understood your situation now. In React, there is a method reactjs.org/docs/react-component.html#shouldcomponentupdate by which we can tell the system that whether the component need to rebuild or not. I didn't see this type of method in Flutter, if you know please let me know. So in this case, I may need to architect the widget tree in such a way that, unnecessary builds may not happen or less happen.
Thank you So much