api_calls.dart 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041
  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,
  868. String? townid = '',
  869. String? displayId = 'services_1',
  870. }) async {
  871. horcat ??= null!;
  872. return ApiManager.instance.makeApiCall(
  873. callName: 'Horecagelegenheidoverzicht',
  874. apiUrl:
  875. 'https://uitgaanskrant.com/nl/flutterdrup/views/flutterflowmobiel_establishments.json',
  876. callType: ApiCallType.GET,
  877. headers: {},
  878. params: {
  879. 'horcat': horcat,
  880. 'townid': townid,
  881. 'display_id': displayId,
  882. },
  883. returnBody: true,
  884. encodeBodyUtf8: false,
  885. decodeUtf8: true,
  886. cache: true,
  887. isStreamingApi: false,
  888. alwaysAllowBody: false,
  889. );
  890. }
  891. static String? establishmentNid(dynamic response) =>
  892. castToType<String>(getJsonField(
  893. response,
  894. r'''$[:].nid''',
  895. ));
  896. static String? establishmentTitel(dynamic response) =>
  897. castToType<String>(getJsonField(
  898. response,
  899. r'''$[:].titel''',
  900. ));
  901. static String? establishmentAdres(dynamic response) =>
  902. castToType<String>(getJsonField(
  903. response,
  904. r'''$[:].adres''',
  905. ));
  906. static String? establishmentPlaats(dynamic response) =>
  907. castToType<String>(getJsonField(
  908. response,
  909. r'''$[:].plaats''',
  910. ));
  911. static String? establishmentLogo(dynamic response) =>
  912. castToType<String>(getJsonField(
  913. response,
  914. r'''$[:].logo''',
  915. ));
  916. static List? establishmentCategorie(dynamic response) => getJsonField(
  917. response,
  918. r'''$[:].categorie''',
  919. true,
  920. ) as List?;
  921. }
  922. class RequestNewPasswordCall {
  923. static Future<ApiCallResponse> call({
  924. String? name = '',
  925. }) async {
  926. final ffApiRequestBody = '''
  927. {"name": "[name]"}''';
  928. return ApiManager.instance.makeApiCall(
  929. callName: 'requestNewPassword',
  930. apiUrl:
  931. 'https://uitgaanskrant.com/en/flutterdrup/user/request_new_password.json',
  932. callType: ApiCallType.POST,
  933. headers: {},
  934. params: {},
  935. body: ffApiRequestBody,
  936. bodyType: BodyType.JSON,
  937. returnBody: true,
  938. encodeBodyUtf8: false,
  939. decodeUtf8: true,
  940. cache: false,
  941. isStreamingApi: false,
  942. alwaysAllowBody: false,
  943. );
  944. }
  945. static String? errorMessage(dynamic response) =>
  946. castToType<String>(getJsonField(
  947. response,
  948. r'''$[0]''',
  949. ));
  950. }
  951. class ApiPagingParams {
  952. int nextPageNumber = 0;
  953. int numItems = 0;
  954. dynamic lastResponse;
  955. ApiPagingParams({
  956. required this.nextPageNumber,
  957. required this.numItems,
  958. required this.lastResponse,
  959. });
  960. @override
  961. String toString() =>
  962. 'PagingParams(nextPageNumber: $nextPageNumber, numItems: $numItems, lastResponse: $lastResponse,)';
  963. }
  964. String _toEncodable(dynamic item) {
  965. return item;
  966. }
  967. String _serializeList(List? list) {
  968. list ??= <String>[];
  969. try {
  970. return json.encode(list, toEncodable: _toEncodable);
  971. } catch (_) {
  972. if (kDebugMode) {
  973. print("List serialization failed. Returning empty list.");
  974. }
  975. return '[]';
  976. }
  977. }
  978. String _serializeJson(dynamic jsonVar, [bool isList = false]) {
  979. jsonVar ??= (isList ? [] : {});
  980. try {
  981. return json.encode(jsonVar, toEncodable: _toEncodable);
  982. } catch (_) {
  983. if (kDebugMode) {
  984. print("Json serialization failed. Returning empty json.");
  985. }
  986. return isList ? '[]' : '{}';
  987. }
  988. }
  989. String? escapeStringForJson(String? input) {
  990. if (input == null) {
  991. return null;
  992. }
  993. return input
  994. .replaceAll('\\', '\\\\')
  995. .replaceAll('"', '\\"')
  996. .replaceAll('\n', '\\n')
  997. .replaceAll('\t', '\\t');
  998. }