I have condition where I'm using Riverpod to load my state with StateNotifier with implement similar method with ResoCoder's code.
In profile card upper, API loaded when state is done calling http. How I can access the value from Profile Card Lower?
If I'm using ChangeNotifier I can easily notifyListener and grab the provider. How about this case using StateNotifier with listen its state?
EDIT: my current solution is move my provider to parent. then using asyncValue to pass response to my 2 widget child(Lower & Upper) as stateless widget. I don't think my solution is efficient because it will rebuild both part. Still need advice for the best approach.
https://stackoverflow.com/questions/65797360/how-to-access-statenotifier-state-in-different-widget-child January 20, 2021 at 02:27AM
没有评论:
发表评论