uitgaantabel_kaart_component_widget.dart 31 KB

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