api_calls.dart 33 KB

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