uitgaantabel_kaart_component_widget.dart 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. import '/backend/api_requests/api_calls.dart';
  2. import '/flutter_flow/flutter_flow_theme.dart';
  3. import '/flutter_flow/flutter_flow_util.dart';
  4. import '/flutter_flow/flutter_flow_widgets.dart';
  5. import '/shared/tag_categorie_component/tag_categorie_component_widget.dart';
  6. import 'dart:ui';
  7. import 'dart:async';
  8. import 'package:auto_size_text/auto_size_text.dart';
  9. import 'package:flutter/material.dart';
  10. import 'package:flutter_spinkit/flutter_spinkit.dart';
  11. import 'package:google_fonts/google_fonts.dart';
  12. import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
  13. import 'package:provider/provider.dart';
  14. import 'uitgaantabel_kaart_component_model.dart';
  15. export 'uitgaantabel_kaart_component_model.dart';
  16. class UitgaantabelKaartComponentWidget extends StatefulWidget {
  17. const UitgaantabelKaartComponentWidget({
  18. super.key,
  19. required this.towndid,
  20. required this.displayid,
  21. });
  22. final String? towndid;
  23. final String? displayid;
  24. @override
  25. State<UitgaantabelKaartComponentWidget> createState() =>
  26. _UitgaantabelKaartComponentWidgetState();
  27. }
  28. class _UitgaantabelKaartComponentWidgetState
  29. extends State<UitgaantabelKaartComponentWidget> with RouteAware {
  30. late UitgaantabelKaartComponentModel _model;
  31. @override
  32. void setState(VoidCallback callback) {
  33. super.setState(callback);
  34. _model.onUpdate();
  35. }
  36. @override
  37. void initState() {
  38. super.initState();
  39. _model = createModel(context, () => UitgaantabelKaartComponentModel());
  40. }
  41. @override
  42. void dispose() {
  43. routeObserver.unsubscribe(this);
  44. _model.maybeDispose();
  45. super.dispose();
  46. }
  47. @override
  48. void didUpdateWidget(UitgaantabelKaartComponentWidget oldWidget) {
  49. super.didUpdateWidget(oldWidget);
  50. _model.widget = widget;
  51. }
  52. @override
  53. void didChangeDependencies() {
  54. super.didChangeDependencies();
  55. final route = DebugModalRoute.of(context);
  56. if (route != null) {
  57. routeObserver.subscribe(this, route);
  58. }
  59. debugLogGlobalProperty(context);
  60. }
  61. @override
  62. void didPopNext() {
  63. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  64. setState(() => _model.isRouteVisible = true);
  65. debugLogWidgetClass(_model);
  66. }
  67. }
  68. @override
  69. void didPush() {
  70. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  71. setState(() => _model.isRouteVisible = true);
  72. debugLogWidgetClass(_model);
  73. }
  74. }
  75. @override
  76. void didPop() {
  77. _model.isRouteVisible = false;
  78. }
  79. @override
  80. void didPushNext() {
  81. _model.isRouteVisible = false;
  82. }
  83. @override
  84. Widget build(BuildContext context) {
  85. DebugFlutterFlowModelContext.maybeOf(context)
  86. ?.parentModelCallback
  87. ?.call(_model);
  88. _model.tagCategorieComponentModels.clear();
  89. return Padding(
  90. padding: EdgeInsetsDirectional.fromSTEB(
  91. valueOrDefault<double>(
  92. () {
  93. if (MediaQuery.sizeOf(context).width < kBreakpointSmall) {
  94. return 5.0;
  95. } else if (MediaQuery.sizeOf(context).width < kBreakpointMedium) {
  96. return 10.0;
  97. } else if (MediaQuery.sizeOf(context).width < kBreakpointLarge) {
  98. return 15.0;
  99. } else {
  100. return 10.0;
  101. }
  102. }(),
  103. 0.0,
  104. ),
  105. 0.0,
  106. 0.0,
  107. 0.0),
  108. child: RefreshIndicator(
  109. onRefresh: () async {
  110. safeSetState(() => _model.listViewPagingController?.refresh());
  111. await _model.waitForOnePageForListView();
  112. },
  113. child: PagedListView<ApiPagingParams, dynamic>(
  114. pagingController: _model.setListViewController(
  115. (nextPageMarker) => UitgaanstabelCall.call(
  116. page: nextPageMarker.nextPageNumber,
  117. townid: widget!.towndid,
  118. displayId: widget!.displayid,
  119. ),
  120. ),
  121. padding: EdgeInsets.zero,
  122. shrinkWrap: true,
  123. reverse: false,
  124. scrollDirection: Axis.vertical,
  125. builderDelegate: PagedChildBuilderDelegate<dynamic>(
  126. // Customize what your widget looks like when it's loading the first page.
  127. firstPageProgressIndicatorBuilder: (_) => Center(
  128. child: SizedBox(
  129. width: 80.0,
  130. height: 80.0,
  131. child: SpinKitFadingCircle(
  132. color: Color(0xFFB1061E),
  133. size: 80.0,
  134. ),
  135. ),
  136. ),
  137. // Customize what your widget looks like when it's loading another page.
  138. newPageProgressIndicatorBuilder: (_) => Center(
  139. child: SizedBox(
  140. width: 80.0,
  141. height: 80.0,
  142. child: SpinKitFadingCircle(
  143. color: Color(0xFFB1061E),
  144. size: 80.0,
  145. ),
  146. ),
  147. ),
  148. itemBuilder: (context, _, evenementenIndex) {
  149. final evenementenItem =
  150. _model.listViewPagingController!.itemList![evenementenIndex];
  151. return Padding(
  152. padding: EdgeInsetsDirectional.fromSTEB(12.0, 8.0, 12.0, 8.0),
  153. child: Container(
  154. height: () {
  155. if (MediaQuery.sizeOf(context).width < kBreakpointSmall) {
  156. return 160.0;
  157. } else if (MediaQuery.sizeOf(context).width <
  158. kBreakpointMedium) {
  159. return 200.0;
  160. } else if (MediaQuery.sizeOf(context).width <
  161. kBreakpointLarge) {
  162. return 240.0;
  163. } else {
  164. return 280.0;
  165. }
  166. }(),
  167. decoration: BoxDecoration(
  168. color: Colors.white,
  169. boxShadow: [
  170. BoxShadow(
  171. blurRadius: 4.0,
  172. color: Color(0x33000000),
  173. offset: Offset(
  174. 0.0,
  175. 2.0,
  176. ),
  177. )
  178. ],
  179. borderRadius: BorderRadius.only(
  180. topLeft: Radius.circular(12.0),
  181. topRight: Radius.circular(12.0),
  182. bottomLeft: Radius.circular(12.0),
  183. bottomRight: Radius.circular(12.0),
  184. ),
  185. ),
  186. child: Row(
  187. mainAxisSize: MainAxisSize.max,
  188. children: [
  189. Expanded(
  190. flex: 3,
  191. child: Container(
  192. decoration: BoxDecoration(
  193. color: FlutterFlowTheme.of(context)
  194. .secondaryBackground,
  195. ),
  196. child: Stack(
  197. children: [
  198. Align(
  199. alignment: AlignmentDirectional(0.0, 1.0),
  200. child: ClipRRect(
  201. borderRadius: BorderRadius.circular(8.0),
  202. child: Image.network(
  203. getJsonField(
  204. evenementenItem,
  205. r'''$.logo''',
  206. ).toString(),
  207. fit: BoxFit.fitHeight,
  208. ),
  209. ),
  210. ),
  211. Align(
  212. alignment: AlignmentDirectional(-0.92, 0.76),
  213. child: Padding(
  214. padding: EdgeInsetsDirectional.fromSTEB(
  215. 8.0, 4.0, 8.0, 4.0),
  216. child: Container(
  217. decoration: BoxDecoration(),
  218. child: Builder(
  219. builder: (context) {
  220. final categorieitem = getJsonField(
  221. evenementenItem,
  222. r'''$.categorie''',
  223. ).toList();
  224. _model.debugGeneratorVariables[
  225. 'categorieitem${categorieitem.length > 100 ? ' (first 100)' : ''}'] =
  226. debugSerializeParam(
  227. categorieitem.take(100),
  228. ParamType.JSON,
  229. isList: true,
  230. link:
  231. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=UitgaantabelKaartComponent',
  232. name: 'dynamic',
  233. nullable: false,
  234. );
  235. debugLogWidgetClass(_model);
  236. return Row(
  237. mainAxisSize: MainAxisSize.max,
  238. children: List.generate(
  239. categorieitem.length,
  240. (categorieitemIndex) {
  241. final categorieitemItem =
  242. categorieitem[
  243. categorieitemIndex];
  244. return Builder(builder: (_) {
  245. return DebugFlutterFlowModelContext(
  246. rootModel: _model.rootModel,
  247. parentModelCallback: (m) {
  248. _model.tagCategorieComponentModels[
  249. 'Keypvw_${categorieitemIndex}_of_${categorieitem.length}'] = m;
  250. },
  251. child:
  252. TagCategorieComponentWidget(
  253. key: Key(
  254. 'Keypvw_${categorieitemIndex}_of_${categorieitem.length}'),
  255. categorieTag:
  256. categorieitemItem
  257. .toString(),
  258. ),
  259. );
  260. });
  261. }),
  262. );
  263. },
  264. ),
  265. ),
  266. ),
  267. ),
  268. ],
  269. ),
  270. ),
  271. ),
  272. Expanded(
  273. flex: 6,
  274. child: Padding(
  275. padding: EdgeInsetsDirectional.fromSTEB(
  276. 6.0, 0.0, 0.0, 0.0),
  277. child: ClipRRect(
  278. child: Container(
  279. decoration: BoxDecoration(
  280. color: FlutterFlowTheme.of(context)
  281. .secondaryBackground,
  282. ),
  283. child: Align(
  284. alignment: AlignmentDirectional(-1.0, 0.0),
  285. child: Column(
  286. mainAxisSize: MainAxisSize.max,
  287. mainAxisAlignment: MainAxisAlignment.start,
  288. crossAxisAlignment: CrossAxisAlignment.start,
  289. children: [
  290. Padding(
  291. padding: EdgeInsetsDirectional.fromSTEB(
  292. 0.0, 0.0, 0.0, 5.0),
  293. child: AutoSizeText(
  294. getJsonField(
  295. evenementenItem,
  296. r'''$.titel''',
  297. ).toString(),
  298. style: FlutterFlowTheme.of(context)
  299. .bodyLarge
  300. .override(
  301. font: GoogleFonts.inter(
  302. fontWeight:
  303. FlutterFlowTheme.of(context)
  304. .bodyLarge
  305. .fontWeight,
  306. fontStyle:
  307. FlutterFlowTheme.of(context)
  308. .bodyLarge
  309. .fontStyle,
  310. ),
  311. letterSpacing: 0.0,
  312. fontWeight:
  313. FlutterFlowTheme.of(context)
  314. .bodyLarge
  315. .fontWeight,
  316. fontStyle:
  317. FlutterFlowTheme.of(context)
  318. .bodyLarge
  319. .fontStyle,
  320. shadows: [
  321. Shadow(
  322. color:
  323. FlutterFlowTheme.of(context)
  324. .secondaryText,
  325. offset: Offset(2.0, 2.0),
  326. blurRadius: 2.0,
  327. )
  328. ],
  329. ),
  330. overflow: TextOverflow.ellipsis,
  331. ),
  332. ),
  333. Row(
  334. mainAxisSize: MainAxisSize.max,
  335. children: [
  336. Padding(
  337. padding:
  338. EdgeInsetsDirectional.fromSTEB(
  339. 2.0, 0.0, 4.0, 0.0),
  340. child: Icon(
  341. Icons.add_business_rounded,
  342. color: FlutterFlowTheme.of(context)
  343. .primaryText,
  344. size: 20.0,
  345. ),
  346. ),
  347. Text(
  348. getJsonField(
  349. evenementenItem,
  350. r'''$.horecagelegenheid''',
  351. ).toString(),
  352. style: FlutterFlowTheme.of(context)
  353. .bodySmall
  354. .override(
  355. font: GoogleFonts.inter(
  356. fontWeight:
  357. FlutterFlowTheme.of(
  358. context)
  359. .bodySmall
  360. .fontWeight,
  361. fontStyle:
  362. FlutterFlowTheme.of(
  363. context)
  364. .bodySmall
  365. .fontStyle,
  366. ),
  367. letterSpacing: 0.0,
  368. fontWeight:
  369. FlutterFlowTheme.of(context)
  370. .bodySmall
  371. .fontWeight,
  372. fontStyle:
  373. FlutterFlowTheme.of(context)
  374. .bodySmall
  375. .fontStyle,
  376. ),
  377. ),
  378. ],
  379. ),
  380. Row(
  381. mainAxisSize: MainAxisSize.max,
  382. children: [
  383. Padding(
  384. padding:
  385. EdgeInsetsDirectional.fromSTEB(
  386. 2.0, 0.0, 4.0, 0.0),
  387. child: Icon(
  388. Icons.location_on_sharp,
  389. color: FlutterFlowTheme.of(context)
  390. .primaryText,
  391. size: 20.0,
  392. ),
  393. ),
  394. Text(
  395. getJsonField(
  396. evenementenItem,
  397. r'''$.adres''',
  398. ).toString(),
  399. style: FlutterFlowTheme.of(context)
  400. .bodySmall
  401. .override(
  402. font: GoogleFonts.inter(
  403. fontWeight:
  404. FlutterFlowTheme.of(
  405. context)
  406. .bodySmall
  407. .fontWeight,
  408. fontStyle:
  409. FlutterFlowTheme.of(
  410. context)
  411. .bodySmall
  412. .fontStyle,
  413. ),
  414. letterSpacing: 0.0,
  415. fontWeight:
  416. FlutterFlowTheme.of(context)
  417. .bodySmall
  418. .fontWeight,
  419. fontStyle:
  420. FlutterFlowTheme.of(context)
  421. .bodySmall
  422. .fontStyle,
  423. ),
  424. ),
  425. Text(
  426. FFLocalizations.of(context).getText(
  427. '4lehigdg' /* , */,
  428. ),
  429. style: FlutterFlowTheme.of(context)
  430. .bodyMedium
  431. .override(
  432. font: GoogleFonts.inter(
  433. fontWeight:
  434. FlutterFlowTheme.of(
  435. context)
  436. .bodyMedium
  437. .fontWeight,
  438. fontStyle:
  439. FlutterFlowTheme.of(
  440. context)
  441. .bodyMedium
  442. .fontStyle,
  443. ),
  444. letterSpacing: 0.0,
  445. fontWeight:
  446. FlutterFlowTheme.of(context)
  447. .bodyMedium
  448. .fontWeight,
  449. fontStyle:
  450. FlutterFlowTheme.of(context)
  451. .bodyMedium
  452. .fontStyle,
  453. ),
  454. ),
  455. Text(
  456. getJsonField(
  457. evenementenItem,
  458. r'''$.plaats''',
  459. ).toString(),
  460. style: FlutterFlowTheme.of(context)
  461. .bodySmall
  462. .override(
  463. font: GoogleFonts.inter(
  464. fontWeight:
  465. FlutterFlowTheme.of(
  466. context)
  467. .bodySmall
  468. .fontWeight,
  469. fontStyle:
  470. FlutterFlowTheme.of(
  471. context)
  472. .bodySmall
  473. .fontStyle,
  474. ),
  475. letterSpacing: 0.0,
  476. fontWeight:
  477. FlutterFlowTheme.of(context)
  478. .bodySmall
  479. .fontWeight,
  480. fontStyle:
  481. FlutterFlowTheme.of(context)
  482. .bodySmall
  483. .fontStyle,
  484. ),
  485. ),
  486. ],
  487. ),
  488. Row(
  489. mainAxisSize: MainAxisSize.max,
  490. children: [
  491. Padding(
  492. padding:
  493. EdgeInsetsDirectional.fromSTEB(
  494. 2.0, 0.0, 4.0, 0.0),
  495. child: Icon(
  496. Icons.calendar_month,
  497. color: FlutterFlowTheme.of(context)
  498. .primaryText,
  499. size: 20.0,
  500. ),
  501. ),
  502. Text(
  503. getJsonField(
  504. evenementenItem,
  505. r'''$.datum''',
  506. ).toString(),
  507. style: FlutterFlowTheme.of(context)
  508. .bodySmall
  509. .override(
  510. font: GoogleFonts.inter(
  511. fontWeight:
  512. FlutterFlowTheme.of(
  513. context)
  514. .bodySmall
  515. .fontWeight,
  516. fontStyle:
  517. FlutterFlowTheme.of(
  518. context)
  519. .bodySmall
  520. .fontStyle,
  521. ),
  522. letterSpacing: 0.0,
  523. fontWeight:
  524. FlutterFlowTheme.of(context)
  525. .bodySmall
  526. .fontWeight,
  527. fontStyle:
  528. FlutterFlowTheme.of(context)
  529. .bodySmall
  530. .fontStyle,
  531. ),
  532. ),
  533. ],
  534. ),
  535. Expanded(
  536. child: Text(
  537. getJsonField(
  538. evenementenItem,
  539. r'''$.inhoud''',
  540. ).toString(),
  541. textAlign: TextAlign.start,
  542. style: FlutterFlowTheme.of(context)
  543. .bodySmall
  544. .override(
  545. font: GoogleFonts.inter(
  546. fontWeight:
  547. FlutterFlowTheme.of(context)
  548. .bodySmall
  549. .fontWeight,
  550. fontStyle:
  551. FlutterFlowTheme.of(context)
  552. .bodySmall
  553. .fontStyle,
  554. ),
  555. letterSpacing: 0.0,
  556. fontWeight:
  557. FlutterFlowTheme.of(context)
  558. .bodySmall
  559. .fontWeight,
  560. fontStyle:
  561. FlutterFlowTheme.of(context)
  562. .bodySmall
  563. .fontStyle,
  564. ),
  565. overflow: TextOverflow.ellipsis,
  566. ),
  567. ),
  568. ],
  569. ),
  570. ),
  571. ),
  572. ),
  573. ),
  574. ),
  575. ],
  576. ),
  577. ),
  578. );
  579. },
  580. ),
  581. ),
  582. ),
  583. );
  584. }
  585. }