api_calls.dart 36 KB

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