// Automatic FlutterFlow imports import '/backend/schema/structs/index.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'index.dart'; // Imports other custom actions import '/flutter_flow/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; // Begin custom action code // DO NOT REMOVE OR MODIFY THE CODE ABOVE! import '/backend/api_requests/api_calls.dart'; Future> fetchAlleHorecagelegenheden( String horcat, String townid, String displayId, ) async { final List alleItems = []; int page = 0; const int maxPaginas = 10; // veiligheidslimiet tegen een oneindige loop while (page < maxPaginas) { final response = await HorecagelegenheidoverzichtCall.call( horcat: horcat, townid: townid, displayId: displayId, page: page, ); if (!response.succeeded) { break; } final items = response.jsonBody as List?; if (items == null || items.isEmpty) { break; } alleItems.addAll(items); if (items.length < 100) { break; } page++; } return alleItems; }