replaceAllRefresh method
Replace all acts like clearRefresh + addAllRefresh, the only difference is replaceAllRefresh does not trigger rendering of empty component when the added content is not empty.
For convenience, you can also put in empty list (but not null). Giving empty list will act like clearRefresh, and will render an empty component.
Implementation
Future<void> replaceAllRefresh(List<T> values) async {
if (values.isEmpty) {
await clearRefresh();
return;
}
await clearRefresh(false);
await addAllRefresh(values);
}