| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- // 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<List<dynamic>> fetchAlleHorecagelegenheden(
- String horcat,
- String townid,
- String displayId,
- ) async {
- final List<dynamic> 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<dynamic>?;
- if (items == null || items.isEmpty) {
- break;
- }
- alleItems.addAll(items);
- if (items.length < 100) {
- break;
- }
- page++;
- }
- return alleItems;
- }
|