I am new to bloc concept. I am trying to get a good understanding on blocprovider and repositoryprovider or the difference between the two. I have been reading blogs but nothing gives a good concrete difference between the two with any examples. Can someone help?
2
Answers
For
Blocs
you should useBlocProvider
because they call theclose
method automatically when disposing.For all other classes you can use
RepositoryProvider
orProvider
from theprovider
package directly. The difference betweenRepositoryProvider
andProvider
is purely semantic. It is intended that you use aRepositoryProvider
for a repository, butProvider
does exactly the same thing.You can find examples in the bloc documentation
in addition look here discussion in bloc github issues.