i have a question. why not using ConsumerWidget which is a stateless widget with ref inside the build method? you dont need to pass through constructor.
@doktormacak007 Жыл бұрын
Thats all fine but nobody is teaching riverpod a bit more in depth. Everyone knows how to fetch a list and handle it, it's documented and its very simple. Where I have difficulty with riverpod and I assume many others do as well is with more complex use cases. Let's say I have JWT authentication where I have to fetch that token and store it in local storage (easy peasy) but then for other times you want to log in with that jwt from storage how to combine async and sync states also depending on multiple providers in single provider gets confusing. Hope someone can address some more complex use cases soon its been few years since release of riverpod 2. Just to note I have been using code generating (state notifier & async state notifier)
@dbestech Жыл бұрын
It could be done. We know it. but we don't see much of the use cases of it. That's why we don't release it. In general we get the token from the server and save it in the local storage. You may read it back using async notifier provider it you need it. This simple use case also helps build a robust api.
@doktormacak007 Жыл бұрын
I'm not saying to build specific example I'm saying to go more in depth @@dbestech