api_calls.dart 30 KB

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