Closed mohanasundaramn closed 3 years ago
You misused family
What happens is, your UI is listening to fetchOutStandings('')
but you refreshed fetchOutStandings(controller.text)
(which is most likely different from ''
)
What you likely want to do instead is:
Widget build(context) {
final searchFilter = useState('');
final outStandings = useProvider(fetchOutStandings(searchFilter.value));
...
IconButton(
icon: Icon(Icons.search),
onPressed: () {
searchFilter.value = controller.text;
},
),
}
@rrousselGit Thank you so much. now I understood the reason why it is not working. Your packages are really very much helpful I am using freeezed, riverpod, hooks. it makes my life easier. Thank you so much for your wonderful contribution to the community.
@rrousselGit I am using FutureProvider to fetch data from the network and using context.refresh(provider) to re-fetch data from the network when I do context.refresh(provider) network call made successfully and I am getting a response from the server but UI, not re-rendering. I am new riverpod I couldn't figure what is wrong.