When calling RESTful API's it is quite common to see empty arrays returned instead of null.
What is the best solution to handle this in Riverpod with AsyncValue?
Currently there is .whenOrNulland .when with data, error and loading. What I am missing is a empty function. As often developers forget to implement this state.
When calling RESTful API's it is quite common to see empty arrays returned instead of null. What is the best solution to handle this in Riverpod with AsyncValue? Currently there is
.whenOrNull
and.when
with data, error and loading. What I am missing is aempty
function. As often developers forget to implement this state.Describe the solution you'd like:
This is what i am doing currently: