How to use a provider inside of another provider in flutter?

Posted by Rohit Kumar | Updated on

If you want to use a provider inside of another provider in flutter?In the main.dart file I now use ChangeNotifierProxyProvider instead of ChangeNotifierProvider for the dependig provider:

Now the Messages provider will be rebuilt when the login state changes and gets passed the Auth Provider:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers