which is more expensive Provider vs setstate?

103

Provider state management offer Consumer. That Consumer has a build function itself. So you can use consumer in which widget you want to rebuild. You don't need to rebuild the whole widget tree. Consumer will listen your provider method and it will rebuild a specific widget where you want to change. Thanks

Share:
103
Deepak Lohmod
Author by

Deepak Lohmod

I love developing flutter apps. I am aiming to serve back to dev community via answering queries on StackOverflow and public projects on GitHub. Need any help? You can find me at:- https://www.linkedin.com/in/deepaklohmod/

Updated on January 02, 2023

Comments

  • Deepak Lohmod
    Deepak Lohmod over 1 year

    Is it a good practice to use provider in place of setstate talking for MVVM architecture and in general also? Does provider rebuilds the whole app widget tree like if i trigger it in second page than will 1st page also be rebuilt, if so then how can we use it more effectevly?