DON'T use Provider.value to create your object.ĭON'T create your object from variables that can change over time.value constructor to create values is undesired. May otherwise have undesired side effects. value constructor if you want to create an object, or you To expose a newly created object, use the default constructor of a provider.ĭo not use the. Providers allow you to not only expose a value, but also create, listen, and dispose of it. Usage Exposing a value Exposing a new object instance To migrate, you can instead use Provider combined with ValueListenableBuilder: ValueListenableBuilder( To migrate, what used to be: FutureProvider( InitialData for both FutureProvider and StreamProvider is now required. flutter_bloc and Mobx, which uses a provider in their architecture.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |