uitgaantabel_kaart_widget.dart 27 KB

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