i have problem when using family and object with FamilyAsyncNotifier #3388
Replies: 2 comments 1 reply
-
Same for me do you fix it you |
Beta Was this translation helpful? Give feedback.
-
You must not create a new instance of ArticlesInfo in your build method: build is called on every change of state, in this case it builds at least twice, once when the fetchListOfArticles is AsyncLoading and another time when it is AsyncData. In the second build call you create a new instance of ArticlesInfo that you pass as parameter to the family provider. Since these 2 instances are different (and since you probably did not override == and hashCode), a new provider is created, which triggers a new loading cycle. So either override == and hashCode in ArticlesInfo or create only one instance in your widget from withVideos, location, and listOfIds (probably more what you want). |
Beta Was this translation helpful? Give feedback.
-
thats my code :
#on provider file
#on Widget
the expected behavior to build initial value
whats actually happens is trigger infinite loop of building first inital values
Beta Was this translation helpful? Give feedback.
All reactions