diff --git a/lib/controllers/providers/api/gas_refill_provider.dart b/lib/controllers/providers/api/gas_refill_provider.dart index cadcf8e..251ac3c 100644 --- a/lib/controllers/providers/api/gas_refill_provider.dart +++ b/lib/controllers/providers/api/gas_refill_provider.dart @@ -68,7 +68,11 @@ class GasRefillProvider extends ChangeNotifier { // client's request was successfully received List requestsListJson = json.decode(response.body)["data"]; List itemsPage = requestsListJson.map((request) => GasRefillModel.fromJson(request)).toList(); - items ??= []; + if (mostRecent != null) { + items = []; + } else { + items ??= []; + } items.addAll(itemsPage); sortMostRecent(items, mostRecent); if (itemsPage.length == pageItemNumber) {