api_calls.dart 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039
  1. import 'dart:convert';
  2. import 'dart:typed_data';
  3. import '../schema/structs/index.dart';
  4. import 'package:flutter/foundation.dart';
  5. import '/flutter_flow/flutter_flow_util.dart';
  6. import 'api_manager.dart';
  7. export 'api_manager.dart' show ApiCallResponse;
  8. const _kPrivateApiFunctionName = 'ffPrivateApiCall';
  9. /// Start kanweg Group Code
  10. class KanwegGroup {
  11. static String getBaseUrl() => 'https://uitgaanskrant.com';
  12. static Map<String, String> headers = {};
  13. }
  14. /// End kanweg Group Code
  15. class FavorietenAgendaCall {
  16. static Future<ApiCallResponse> call({
  17. String? sessionName = '',
  18. String? sessionId = '',
  19. }) async {
  20. return ApiManager.instance.makeApiCall(
  21. callName: 'FavorietenAgenda',
  22. apiUrl:
  23. 'https://uitgaanskrant.com/nl/flutterdrup/views/flutterfavorietenagenda.json?display_id=services_1',
  24. callType: ApiCallType.GET,
  25. headers: {
  26. 'Cookie': '{{session_name}}={{sessid}}',
  27. 'Content-Type': 'application/json',
  28. 'Accept': 'application/json',
  29. 'X-Requested-With': 'XMLHttpRequest',
  30. },
  31. params: {},
  32. returnBody: true,
  33. encodeBodyUtf8: false,
  34. decodeUtf8: false,
  35. cache: false,
  36. isStreamingApi: false,
  37. alwaysAllowBody: false,
  38. );
  39. }
  40. static String? sessionid(dynamic response) => castToType<String>(getJsonField(
  41. response,
  42. r'''$.sessid''',
  43. ));
  44. static String? sessionname(dynamic response) =>
  45. castToType<String>(getJsonField(
  46. response,
  47. r'''$.session_name''',
  48. ));
  49. static String? token(dynamic response) => castToType<String>(getJsonField(
  50. response,
  51. r'''$.token''',
  52. ));
  53. static String? drupaluserid(dynamic response) =>
  54. castToType<String>(getJsonField(
  55. response,
  56. r'''$.user.uid''',
  57. ));
  58. static String? establishmentTitle(dynamic response) =>
  59. castToType<String>(getJsonField(
  60. response,
  61. r'''$[:].node_title''',
  62. ));
  63. static String? establishmentLogo(dynamic response) =>
  64. castToType<String>(getJsonField(
  65. response,
  66. r'''$[:].logohoreca''',
  67. ));
  68. static String? establishmentNid(dynamic response) =>
  69. castToType<String>(getJsonField(
  70. response,
  71. r'''$[:].nid''',
  72. ));
  73. }
  74. class FavorietenAgendaTESTKANWEGCall {
  75. static Future<ApiCallResponse> call() async {
  76. return ApiManager.instance.makeApiCall(
  77. callName: 'FavorietenAgendaTESTKANWEG',
  78. apiUrl:
  79. 'https://uitgaanskrant.com/nl/cookie-testcda.php?display_id=services_1',
  80. callType: ApiCallType.GET,
  81. headers: {
  82. 'Cookie':
  83. 'SSESSfb38a72b665678c06dea69b92d0e88c6=NPHBx1J_vK03xg3ysN3SjaPj3iWjefsIBXxxTWipEtI',
  84. 'Content-Type': 'application/json',
  85. 'Accept': 'application/json',
  86. 'X-CSRF-Token': 'I5pbUCTynNGlUObMFNzlXR0l6TM9bEGW51Fhxan44PY',
  87. 'X-Requested-With': 'XMLHttpRequest',
  88. },
  89. params: {},
  90. returnBody: true,
  91. encodeBodyUtf8: false,
  92. decodeUtf8: false,
  93. cache: false,
  94. isStreamingApi: true,
  95. alwaysAllowBody: false,
  96. client: ApiManager.getClient(withCredentials: true),
  97. );
  98. }
  99. static String? sessionid(dynamic response) => castToType<String>(getJsonField(
  100. response,
  101. r'''$.sessid''',
  102. ));
  103. static String? sessionname(dynamic response) =>
  104. castToType<String>(getJsonField(
  105. response,
  106. r'''$.session_name''',
  107. ));
  108. static String? token(dynamic response) => castToType<String>(getJsonField(
  109. response,
  110. r'''$.token''',
  111. ));
  112. static String? drupaluserid(dynamic response) =>
  113. castToType<String>(getJsonField(
  114. response,
  115. r'''$.user.uid''',
  116. ));
  117. static String? establishmentTitle(dynamic response) =>
  118. castToType<String>(getJsonField(
  119. response,
  120. r'''$[:].node_title''',
  121. ));
  122. static String? establishmentLogo(dynamic response) =>
  123. castToType<String>(getJsonField(
  124. response,
  125. r'''$[:].logohoreca''',
  126. ));
  127. static String? establishmentNid(dynamic response) =>
  128. castToType<String>(getJsonField(
  129. response,
  130. r'''$[:].nid''',
  131. ));
  132. }
  133. class HomeTabelCall {
  134. static Future<ApiCallResponse> call({
  135. int? page = 0,
  136. }) async {
  137. return ApiManager.instance.makeApiCall(
  138. callName: 'homeTabel',
  139. apiUrl:
  140. 'https://uitgaanskrant.com/nl/flutterdrup/views/flutterflowmobiel1.json?display_id=services_2',
  141. callType: ApiCallType.GET,
  142. headers: {},
  143. params: {
  144. 'page': page,
  145. },
  146. returnBody: true,
  147. encodeBodyUtf8: false,
  148. decodeUtf8: true,
  149. cache: true,
  150. isStreamingApi: false,
  151. alwaysAllowBody: false,
  152. );
  153. }
  154. static String? homeNid(dynamic response) => castToType<String>(getJsonField(
  155. response,
  156. r'''$[:].nid''',
  157. ));
  158. static String? homeAdres(dynamic response) => castToType<String>(getJsonField(
  159. response,
  160. r'''$[:].adres''',
  161. ));
  162. static String? homeEstablishment(dynamic response) =>
  163. castToType<String>(getJsonField(
  164. response,
  165. r'''$[:].horecagelegenheid''',
  166. ));
  167. static String? homeDatum(dynamic response) => castToType<String>(getJsonField(
  168. response,
  169. r'''$[:].datum''',
  170. ));
  171. static String? homePlaats(dynamic response) =>
  172. castToType<String>(getJsonField(
  173. response,
  174. r'''$[:].plaats''',
  175. ));
  176. static List<String>? homeCategorie(dynamic response) => (getJsonField(
  177. response,
  178. r'''$[:].categorie''',
  179. true,
  180. ) as List?)
  181. ?.withoutNulls
  182. .map((x) => castToType<String>(x))
  183. .withoutNulls
  184. .toList();
  185. static String? homeTitel(dynamic response) => castToType<String>(getJsonField(
  186. response,
  187. r'''$[:].titel''',
  188. ));
  189. static String? homoLogo(dynamic response) => castToType<String>(getJsonField(
  190. response,
  191. r'''$[:].logo''',
  192. ));
  193. static String? homeInhoud(dynamic response) =>
  194. castToType<String>(getJsonField(
  195. response,
  196. r'''$[:].inhoud''',
  197. ));
  198. static String? homeUrl(dynamic response) => castToType<String>(getJsonField(
  199. response,
  200. r'''$[:].url''',
  201. ));
  202. static String? homeEstablishmentID(dynamic response) =>
  203. castToType<String>(getJsonField(
  204. response,
  205. r'''$[:].horecagelegenheidid''',
  206. ));
  207. }
  208. class HomeSliderCall {
  209. static Future<ApiCallResponse> call({
  210. String? displayId = 'services_1',
  211. }) async {
  212. return ApiManager.instance.makeApiCall(
  213. callName: 'HomeSlider',
  214. apiUrl:
  215. 'https://uitgaanskrant.com/nl/flutterdrup/views/flutterflowmobiel1.json?display_id=services_1',
  216. callType: ApiCallType.GET,
  217. headers: {},
  218. params: {
  219. 'display_id': displayId,
  220. },
  221. returnBody: true,
  222. encodeBodyUtf8: false,
  223. decodeUtf8: true,
  224. cache: false,
  225. isStreamingApi: false,
  226. alwaysAllowBody: false,
  227. );
  228. }
  229. static String? homeNid(dynamic response) => castToType<String>(getJsonField(
  230. response,
  231. r'''$[:].nid''',
  232. ));
  233. static String? homeAdres(dynamic response) => castToType<String>(getJsonField(
  234. response,
  235. r'''$[:].adres''',
  236. ));
  237. static String? tabelHorecagelegenheid(dynamic response) =>
  238. castToType<String>(getJsonField(
  239. response,
  240. r'''$[:].horecagelegenheid''',
  241. ));
  242. static String? homeDatum(dynamic response) => castToType<String>(getJsonField(
  243. response,
  244. r'''$[:].datum''',
  245. ));
  246. static String? homePlaats(dynamic response) =>
  247. castToType<String>(getJsonField(
  248. response,
  249. r'''$[:].plaats''',
  250. ));
  251. static List<String>? homeCategorie(dynamic response) => (getJsonField(
  252. response,
  253. r'''$[:].categorie''',
  254. true,
  255. ) as List?)
  256. ?.withoutNulls
  257. .map((x) => castToType<String>(x))
  258. .withoutNulls
  259. .toList();
  260. static String? homeTitel(dynamic response) => castToType<String>(getJsonField(
  261. response,
  262. r'''$[:].titel''',
  263. ));
  264. static String? homoLogo(dynamic response) => castToType<String>(getJsonField(
  265. response,
  266. r'''$[:].logo''',
  267. ));
  268. static String? homeInhoud(dynamic response) =>
  269. castToType<String>(getJsonField(
  270. response,
  271. r'''$[:].inhoud''',
  272. ));
  273. static String? homeUrl(dynamic response) => castToType<String>(getJsonField(
  274. response,
  275. r'''$[:].url''',
  276. ));
  277. static String? tabelHorecagelegenheidID(dynamic response) =>
  278. castToType<String>(getJsonField(
  279. response,
  280. r'''$[:].horecagelegenheidid''',
  281. ));
  282. }
  283. class UitgaanstabelCall {
  284. static Future<ApiCallResponse> call({
  285. int? page = 0,
  286. String? townid = '0',
  287. String? displayId,
  288. }) async {
  289. displayId ??= '';
  290. return ApiManager.instance.makeApiCall(
  291. callName: 'Uitgaanstabel',
  292. apiUrl:
  293. 'https://uitgaanskrant.com/nl/flutterdrup/views/flutterflowmobiel1.json?display_id=services_3',
  294. callType: ApiCallType.GET,
  295. headers: {},
  296. params: {
  297. 'page': page,
  298. 'townid': townid,
  299. 'display_id': displayId,
  300. },
  301. returnBody: true,
  302. encodeBodyUtf8: false,
  303. decodeUtf8: true,
  304. cache: false,
  305. isStreamingApi: false,
  306. alwaysAllowBody: false,
  307. );
  308. }
  309. static String? homeNid(dynamic response) => castToType<String>(getJsonField(
  310. response,
  311. r'''$[:].nid''',
  312. ));
  313. static String? homeAdres(dynamic response) => castToType<String>(getJsonField(
  314. response,
  315. r'''$[:].adres''',
  316. ));
  317. static String? tabelHorecagelegenheid(dynamic response) =>
  318. castToType<String>(getJsonField(
  319. response,
  320. r'''$[:].horecagelegenheid''',
  321. ));
  322. static String? homeDatum(dynamic response) => castToType<String>(getJsonField(
  323. response,
  324. r'''$[:].datum''',
  325. ));
  326. static String? homePlaats(dynamic response) =>
  327. castToType<String>(getJsonField(
  328. response,
  329. r'''$[:].plaats''',
  330. ));
  331. static List<String>? homeCategorie(dynamic response) => (getJsonField(
  332. response,
  333. r'''$[:].categorie''',
  334. true,
  335. ) as List?)
  336. ?.withoutNulls
  337. .map((x) => castToType<String>(x))
  338. .withoutNulls
  339. .toList();
  340. static String? homeTitel(dynamic response) => castToType<String>(getJsonField(
  341. response,
  342. r'''$[:].titel''',
  343. ));
  344. static String? homoLogo(dynamic response) => castToType<String>(getJsonField(
  345. response,
  346. r'''$[:].logo''',
  347. ));
  348. static String? homeInhoud(dynamic response) =>
  349. castToType<String>(getJsonField(
  350. response,
  351. r'''$[:].inhoud''',
  352. ));
  353. static String? homeUrl(dynamic response) => castToType<String>(getJsonField(
  354. response,
  355. r'''$[:].url''',
  356. ));
  357. static String? tabelHorecagelegenheidID(dynamic response) =>
  358. castToType<String>(getJsonField(
  359. response,
  360. r'''$[:].horecagelegenheidid''',
  361. ));
  362. }
  363. class UitgaanSliderCall {
  364. static Future<ApiCallResponse> call({
  365. int? page = 0,
  366. String? townid = '0',
  367. String? displayId = 'services_1',
  368. }) async {
  369. return ApiManager.instance.makeApiCall(
  370. callName: 'UitgaanSlider',
  371. apiUrl:
  372. 'https://uitgaanskrant.com/nl/flutterdrup/views/flutterflowmobiel1.json?display_id=services_3',
  373. callType: ApiCallType.GET,
  374. headers: {},
  375. params: {
  376. 'page': page,
  377. 'townid': townid,
  378. 'display_id': displayId,
  379. },
  380. returnBody: true,
  381. encodeBodyUtf8: false,
  382. decodeUtf8: true,
  383. cache: false,
  384. isStreamingApi: false,
  385. alwaysAllowBody: false,
  386. );
  387. }
  388. static String? homeNid(dynamic response) => castToType<String>(getJsonField(
  389. response,
  390. r'''$[:].nid''',
  391. ));
  392. static String? homeAdres(dynamic response) => castToType<String>(getJsonField(
  393. response,
  394. r'''$[:].adres''',
  395. ));
  396. static String? tabelHorecagelegenheid(dynamic response) =>
  397. castToType<String>(getJsonField(
  398. response,
  399. r'''$[:].horecagelegenheid''',
  400. ));
  401. static String? homeDatum(dynamic response) => castToType<String>(getJsonField(
  402. response,
  403. r'''$[:].datum''',
  404. ));
  405. static String? homePlaats(dynamic response) =>
  406. castToType<String>(getJsonField(
  407. response,
  408. r'''$[:].plaats''',
  409. ));
  410. static List<String>? homeCategorie(dynamic response) => (getJsonField(
  411. response,
  412. r'''$[:].categorie''',
  413. true,
  414. ) as List?)
  415. ?.withoutNulls
  416. .map((x) => castToType<String>(x))
  417. .withoutNulls
  418. .toList();
  419. static String? homeTitel(dynamic response) => castToType<String>(getJsonField(
  420. response,
  421. r'''$[:].titel''',
  422. ));
  423. static String? homoLogo(dynamic response) => castToType<String>(getJsonField(
  424. response,
  425. r'''$[:].logo''',
  426. ));
  427. static String? homeInhoud(dynamic response) =>
  428. castToType<String>(getJsonField(
  429. response,
  430. r'''$[:].inhoud''',
  431. ));
  432. static String? homeUrl(dynamic response) => castToType<String>(getJsonField(
  433. response,
  434. r'''$[:].url''',
  435. ));
  436. static String? tabelHorecagelegenheidID(dynamic response) =>
  437. castToType<String>(getJsonField(
  438. response,
  439. r'''$[:].horecagelegenheidid''',
  440. ));
  441. }
  442. class EstablishmentInfoCall {
  443. static Future<ApiCallResponse> call({
  444. String? nid = '',
  445. }) async {
  446. return ApiManager.instance.makeApiCall(
  447. callName: 'EstablishmentInfo',
  448. apiUrl:
  449. 'https://uitgaanskrant.com/en/flutterdrup/views/flutterflowmobiel_establishment_info.json?display_id=services_1',
  450. callType: ApiCallType.GET,
  451. headers: {},
  452. params: {
  453. 'nid': nid,
  454. },
  455. returnBody: true,
  456. encodeBodyUtf8: false,
  457. decodeUtf8: true,
  458. cache: true,
  459. isStreamingApi: false,
  460. alwaysAllowBody: false,
  461. );
  462. }
  463. static String? establismentNid(dynamic response) =>
  464. castToType<String>(getJsonField(
  465. response,
  466. r'''$[:].nid''',
  467. ));
  468. static String? establishmentBezorgkosten(dynamic response) =>
  469. castToType<String>(getJsonField(
  470. response,
  471. r'''$[:].bezorgkosten''',
  472. ));
  473. static String? establishmentEmail(dynamic response) =>
  474. castToType<String>(getJsonField(
  475. response,
  476. r'''$[:].email''',
  477. ));
  478. static String? establishmentFacebook(dynamic response) =>
  479. castToType<String>(getJsonField(
  480. response,
  481. r'''$[:].facebook''',
  482. ));
  483. static String? establishmentInstagram(dynamic response) =>
  484. castToType<String>(getJsonField(
  485. response,
  486. r'''$[:].instagram''',
  487. ));
  488. static String? establishmentMenukaart(dynamic response) =>
  489. castToType<String>(getJsonField(
  490. response,
  491. r'''$[:].menukaart''',
  492. ));
  493. static String? establishmentOpeningstijden(dynamic response) =>
  494. castToType<String>(getJsonField(
  495. response,
  496. r'''$[:].openingstijden''',
  497. ));
  498. static String? establishmentTelefoonnummer(dynamic response) =>
  499. castToType<String>(getJsonField(
  500. response,
  501. r'''$[:].telefoonnummer''',
  502. ));
  503. static String? establishmentTwitter(dynamic response) =>
  504. castToType<String>(getJsonField(
  505. response,
  506. r'''$[:].twitter''',
  507. ));
  508. static String? establishmentWebsite(dynamic response) =>
  509. castToType<String>(getJsonField(
  510. response,
  511. r'''$[:].website''',
  512. ));
  513. static List<String>? establishmentbezorgbetaalopties(dynamic response) =>
  514. (getJsonField(
  515. response,
  516. r'''$[:].thuisbezorgtbetaalopties''',
  517. true,
  518. ) as List?)
  519. ?.withoutNulls
  520. .map((x) => castToType<String>(x))
  521. .withoutNulls
  522. .toList();
  523. static String? establishmentAdres(dynamic response) =>
  524. castToType<String>(getJsonField(
  525. response,
  526. r'''$[:].adres''',
  527. ));
  528. static List<String>? establishmentAfhaalopties(dynamic response) =>
  529. (getJsonField(
  530. response,
  531. r'''$[:].afhaalopties''',
  532. true,
  533. ) as List?)
  534. ?.withoutNulls
  535. .map((x) => castToType<String>(x))
  536. .withoutNulls
  537. .toList();
  538. static String? establishmentPlaats(dynamic response) =>
  539. castToType<String>(getJsonField(
  540. response,
  541. r'''$[:].plaats''',
  542. ));
  543. static List<String>? establishmentFotoos(dynamic response) => (getJsonField(
  544. response,
  545. r'''$[:].fotoos''',
  546. true,
  547. ) as List?)
  548. ?.withoutNulls
  549. .map((x) => castToType<String>(x))
  550. .withoutNulls
  551. .toList();
  552. static List<String>? establishmentCryptocoins(dynamic response) =>
  553. (getJsonField(
  554. response,
  555. r'''$[:].cryptocoins''',
  556. true,
  557. ) as List?)
  558. ?.withoutNulls
  559. .map((x) => castToType<String>(x))
  560. .withoutNulls
  561. .toList();
  562. static String? establishmentbezorgtijden(dynamic response) =>
  563. castToType<String>(getJsonField(
  564. response,
  565. r'''$[:].bezorgtijden''',
  566. ));
  567. static String? establishmentMinimaleorder(dynamic response) =>
  568. castToType<String>(getJsonField(
  569. response,
  570. r'''$[:].minimaleorder''',
  571. ));
  572. static String? establshmentTitel(dynamic response) =>
  573. castToType<String>(getJsonField(
  574. response,
  575. r'''$[:].titel''',
  576. ));
  577. static List<String>? establshmentBezorgtin(dynamic response) => (getJsonField(
  578. response,
  579. r'''$[:].bezorgtin''',
  580. true,
  581. ) as List?)
  582. ?.withoutNulls
  583. .map((x) => castToType<String>(x))
  584. .withoutNulls
  585. .toList();
  586. static String? establshmentKvk(dynamic response) =>
  587. castToType<String>(getJsonField(
  588. response,
  589. r'''$[:].kvk''',
  590. ));
  591. static String? establshmentBestellink(dynamic response) =>
  592. castToType<String>(getJsonField(
  593. response,
  594. r'''$[:].bestellink''',
  595. ));
  596. static String? establshmentInhoud(dynamic response) =>
  597. castToType<String>(getJsonField(
  598. response,
  599. r'''$[:].inhoud''',
  600. ));
  601. static String? establshmentOpeningUitzondering(dynamic response) =>
  602. castToType<String>(getJsonField(
  603. response,
  604. r'''$[:].openingstijdenuitzondering''',
  605. ));
  606. static String? establshmentLogo(dynamic response) =>
  607. castToType<String>(getJsonField(
  608. response,
  609. r'''$[:].logo''',
  610. ));
  611. static String? establishmentEntreeprijs(dynamic response) =>
  612. castToType<String>(getJsonField(
  613. response,
  614. r'''$[:].entreeprijs''',
  615. ));
  616. static List<String>? establishmentCategorie(dynamic response) =>
  617. (getJsonField(
  618. response,
  619. r'''$[:].categorie''',
  620. true,
  621. ) as List?)
  622. ?.withoutNulls
  623. .map((x) => castToType<String>(x))
  624. .withoutNulls
  625. .toList();
  626. static String? establishmentEntreeToelichting(dynamic response) =>
  627. castToType<String>(getJsonField(
  628. response,
  629. r'''$[:].toelichtingentree''',
  630. ));
  631. static String? establishmentURL(dynamic response) =>
  632. castToType<String>(getJsonField(
  633. response,
  634. r'''$[:].url''',
  635. ));
  636. }
  637. class HorecagelegenheidEventsCall {
  638. static Future<ApiCallResponse> call({
  639. String? horecanid,
  640. }) async {
  641. horecanid ??= '';
  642. return ApiManager.instance.makeApiCall(
  643. callName: 'HorecagelegenheidEvents',
  644. apiUrl:
  645. 'https://uitgaanskrant.com/en/flutterdrup/views/flutterflowmobiel_establishment_events.json?display_id=services_1',
  646. callType: ApiCallType.GET,
  647. headers: {},
  648. params: {
  649. 'horecanid': horecanid,
  650. },
  651. returnBody: true,
  652. encodeBodyUtf8: false,
  653. decodeUtf8: true,
  654. cache: false,
  655. isStreamingApi: false,
  656. alwaysAllowBody: false,
  657. );
  658. }
  659. static String? horecaEventNid(dynamic response) =>
  660. castToType<String>(getJsonField(
  661. response,
  662. r'''$[:].nid''',
  663. ));
  664. static String? horecaEventBody(dynamic response) =>
  665. castToType<String>(getJsonField(
  666. response,
  667. r'''$[:].body''',
  668. ));
  669. static String? horecaEventLogo(dynamic response) =>
  670. castToType<String>(getJsonField(
  671. response,
  672. r'''$[:].logo''',
  673. ));
  674. static String? horecaEventDatum(dynamic response) =>
  675. castToType<String>(getJsonField(
  676. response,
  677. r'''$[:].datum''',
  678. ));
  679. static String? horecaEventTitel(dynamic response) =>
  680. castToType<String>(getJsonField(
  681. response,
  682. r'''$[:].titel''',
  683. ));
  684. static String? horecaEventInhoud(dynamic response) =>
  685. castToType<String>(getJsonField(
  686. response,
  687. r'''$[:].inhoud''',
  688. ));
  689. static List<String>? horecaEventCategorie(dynamic response) => (getJsonField(
  690. response,
  691. r'''$[:].categorie''',
  692. true,
  693. ) as List?)
  694. ?.withoutNulls
  695. .map((x) => castToType<String>(x))
  696. .withoutNulls
  697. .toList();
  698. }
  699. class GemeentenCall {
  700. static Future<ApiCallResponse> call({
  701. String? provincieid = '',
  702. }) async {
  703. return ApiManager.instance.makeApiCall(
  704. callName: 'gemeenten',
  705. apiUrl:
  706. 'https://uitgaanskrant.com/nl/flutterdrup/plaatsen.json?limit_levels=2',
  707. callType: ApiCallType.GET,
  708. headers: {},
  709. params: {
  710. 'provincieid': provincieid,
  711. },
  712. returnBody: true,
  713. encodeBodyUtf8: false,
  714. decodeUtf8: true,
  715. cache: true,
  716. isStreamingApi: false,
  717. alwaysAllowBody: false,
  718. );
  719. }
  720. static String? gemeenteId(dynamic response) =>
  721. castToType<String>(getJsonField(
  722. response,
  723. r'''$[:].gemeenteid''',
  724. ));
  725. static String? gemeenteName(dynamic response) =>
  726. castToType<String>(getJsonField(
  727. response,
  728. r'''$[:].gemeentename''',
  729. ));
  730. }
  731. class ProvinciesCall {
  732. static Future<ApiCallResponse> call() async {
  733. return ApiManager.instance.makeApiCall(
  734. callName: 'provincies',
  735. apiUrl:
  736. 'https://uitgaanskrant.com/nl/flutterdrup/plaatsen.json?limit_levels=2',
  737. callType: ApiCallType.GET,
  738. headers: {},
  739. params: {},
  740. returnBody: true,
  741. encodeBodyUtf8: false,
  742. decodeUtf8: true,
  743. cache: true,
  744. isStreamingApi: false,
  745. alwaysAllowBody: false,
  746. );
  747. }
  748. static String? provincieId(dynamic response) =>
  749. castToType<String>(getJsonField(
  750. response,
  751. r'''$[:].provincieid''',
  752. ));
  753. static String? provincieName(dynamic response) =>
  754. castToType<String>(getJsonField(
  755. response,
  756. r'''$[:].provinciename''',
  757. ));
  758. static List<String>? provinciedescription(dynamic response) => (getJsonField(
  759. response,
  760. r'''$[:].provinciedescription''',
  761. true,
  762. ) as List?)
  763. ?.withoutNulls
  764. .map((x) => castToType<String>(x))
  765. .withoutNulls
  766. .toList();
  767. }
  768. class EvenementCall {
  769. static Future<ApiCallResponse> call({
  770. String? nid = '0',
  771. }) async {
  772. return ApiManager.instance.makeApiCall(
  773. callName: 'Evenement',
  774. apiUrl:
  775. 'https://uitgaanskrant.com/en/flutterdrup/views/flutterflow_events.json?display_id=services_1',
  776. callType: ApiCallType.GET,
  777. headers: {},
  778. params: {
  779. 'nid': nid,
  780. },
  781. returnBody: true,
  782. encodeBodyUtf8: false,
  783. decodeUtf8: true,
  784. cache: false,
  785. isStreamingApi: false,
  786. alwaysAllowBody: false,
  787. );
  788. }
  789. static String? eventNid(dynamic response) => castToType<String>(getJsonField(
  790. response,
  791. r'''$[0].nid''',
  792. ));
  793. static String? eventTitle(dynamic response) =>
  794. castToType<String>(getJsonField(
  795. response,
  796. r'''$[0].title''',
  797. ));
  798. static String? eventDate(dynamic response) => castToType<String>(getJsonField(
  799. response,
  800. r'''$[0].datum''',
  801. ));
  802. static String? eventLogog(dynamic response) =>
  803. castToType<String>(getJsonField(
  804. response,
  805. r'''$[0].logo''',
  806. ));
  807. static String? eventAdres(dynamic response) =>
  808. castToType<String>(getJsonField(
  809. response,
  810. r'''$[0].adres''',
  811. ));
  812. static String? eventPlaats(dynamic response) =>
  813. castToType<String>(getJsonField(
  814. response,
  815. r'''$[0].plaats''',
  816. ));
  817. static List<String>? eventCategorie(dynamic response) => (getJsonField(
  818. response,
  819. r'''$[0].categorie''',
  820. true,
  821. ) as List?)
  822. ?.withoutNulls
  823. .map((x) => castToType<String>(x))
  824. .withoutNulls
  825. .toList();
  826. static String? eventBody(dynamic response) => castToType<String>(getJsonField(
  827. response,
  828. r'''$[0].body''',
  829. ));
  830. static String? eventWebsiteg(dynamic response) =>
  831. castToType<String>(getJsonField(
  832. response,
  833. r'''$[0].website''',
  834. ));
  835. static List<String>? eventFotoos(dynamic response) => (getJsonField(
  836. response,
  837. r'''$[0].fotos''',
  838. true,
  839. ) as List?)
  840. ?.withoutNulls
  841. .map((x) => castToType<String>(x))
  842. .withoutNulls
  843. .toList();
  844. static String? eventEntreeprijs(dynamic response) =>
  845. castToType<String>(getJsonField(
  846. response,
  847. r'''$[0].entreeprijs''',
  848. ));
  849. static String? eventEntreeToelichting(dynamic response) =>
  850. castToType<String>(getJsonField(
  851. response,
  852. r'''$[0].entreetoelichting''',
  853. ));
  854. static String? eventContact(dynamic response) =>
  855. castToType<String>(getJsonField(
  856. response,
  857. r'''$[0].contact''',
  858. ));
  859. static String? eventHorecagelegenheidnid(dynamic response) =>
  860. castToType<String>(getJsonField(
  861. response,
  862. r'''$[0].horecagelegenheidnid''',
  863. ));
  864. }
  865. class HorecagelegenheidoverzichtCall {
  866. static Future<ApiCallResponse> call({
  867. String? horcat = '17967',
  868. String? townid = '',
  869. String? displayId = 'services_1',
  870. }) async {
  871. return ApiManager.instance.makeApiCall(
  872. callName: 'Horecagelegenheidoverzicht',
  873. apiUrl:
  874. 'https://uitgaanskrant.com/nl/flutterdrup/views/flutterflowmobiel_establishments.json',
  875. callType: ApiCallType.GET,
  876. headers: {},
  877. params: {
  878. 'horcat': horcat,
  879. 'townid': townid,
  880. 'display_id': displayId,
  881. },
  882. returnBody: true,
  883. encodeBodyUtf8: false,
  884. decodeUtf8: true,
  885. cache: true,
  886. isStreamingApi: false,
  887. alwaysAllowBody: false,
  888. );
  889. }
  890. static String? establishmentNid(dynamic response) =>
  891. castToType<String>(getJsonField(
  892. response,
  893. r'''$[:].nid''',
  894. ));
  895. static String? establishmentTitel(dynamic response) =>
  896. castToType<String>(getJsonField(
  897. response,
  898. r'''$[:].titel''',
  899. ));
  900. static String? establishmentAdres(dynamic response) =>
  901. castToType<String>(getJsonField(
  902. response,
  903. r'''$[:].adres''',
  904. ));
  905. static String? establishmentPlaats(dynamic response) =>
  906. castToType<String>(getJsonField(
  907. response,
  908. r'''$[:].plaats''',
  909. ));
  910. static String? establishmentLogo(dynamic response) =>
  911. castToType<String>(getJsonField(
  912. response,
  913. r'''$[:].logo''',
  914. ));
  915. static List? establishmentCategorie(dynamic response) => getJsonField(
  916. response,
  917. r'''$[:].categorie''',
  918. true,
  919. ) as List?;
  920. }
  921. class RequestNewPasswordCall {
  922. static Future<ApiCallResponse> call({
  923. String? name = '',
  924. }) async {
  925. final ffApiRequestBody = '''
  926. {"name": "[name]"}''';
  927. return ApiManager.instance.makeApiCall(
  928. callName: 'requestNewPassword',
  929. apiUrl:
  930. 'https://uitgaanskrant.com/en/flutterdrup/user/request_new_password.json',
  931. callType: ApiCallType.POST,
  932. headers: {},
  933. params: {},
  934. body: ffApiRequestBody,
  935. bodyType: BodyType.JSON,
  936. returnBody: true,
  937. encodeBodyUtf8: false,
  938. decodeUtf8: true,
  939. cache: false,
  940. isStreamingApi: false,
  941. alwaysAllowBody: false,
  942. );
  943. }
  944. static String? errorMessage(dynamic response) =>
  945. castToType<String>(getJsonField(
  946. response,
  947. r'''$[0]''',
  948. ));
  949. }
  950. class ApiPagingParams {
  951. int nextPageNumber = 0;
  952. int numItems = 0;
  953. dynamic lastResponse;
  954. ApiPagingParams({
  955. required this.nextPageNumber,
  956. required this.numItems,
  957. required this.lastResponse,
  958. });
  959. @override
  960. String toString() =>
  961. 'PagingParams(nextPageNumber: $nextPageNumber, numItems: $numItems, lastResponse: $lastResponse,)';
  962. }
  963. String _toEncodable(dynamic item) {
  964. return item;
  965. }
  966. String _serializeList(List? list) {
  967. list ??= <String>[];
  968. try {
  969. return json.encode(list, toEncodable: _toEncodable);
  970. } catch (_) {
  971. if (kDebugMode) {
  972. print("List serialization failed. Returning empty list.");
  973. }
  974. return '[]';
  975. }
  976. }
  977. String _serializeJson(dynamic jsonVar, [bool isList = false]) {
  978. jsonVar ??= (isList ? [] : {});
  979. try {
  980. return json.encode(jsonVar, toEncodable: _toEncodable);
  981. } catch (_) {
  982. if (kDebugMode) {
  983. print("Json serialization failed. Returning empty json.");
  984. }
  985. return isList ? '[]' : '{}';
  986. }
  987. }
  988. String? escapeStringForJson(String? input) {
  989. if (input == null) {
  990. return null;
  991. }
  992. return input
  993. .replaceAll('\\', '\\\\')
  994. .replaceAll('"', '\\"')
  995. .replaceAll('\n', '\\n')
  996. .replaceAll('\t', '\\t');
  997. }