uitgaantabel_kaart_widget.dart 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  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. maxLines: 1,
  239. style: FlutterFlowTheme.of(context)
  240. .bodyLarge
  241. .override(
  242. font: GoogleFonts.roboto(
  243. fontWeight: FlutterFlowTheme.of(context)
  244. .bodyLarge
  245. .fontWeight,
  246. fontStyle: FlutterFlowTheme.of(context)
  247. .bodyLarge
  248. .fontStyle,
  249. ),
  250. letterSpacing: 0.0,
  251. fontWeight: FlutterFlowTheme.of(context)
  252. .bodyLarge
  253. .fontWeight,
  254. fontStyle: FlutterFlowTheme.of(context)
  255. .bodyLarge
  256. .fontStyle,
  257. ),
  258. overflow: TextOverflow.ellipsis,
  259. ),
  260. ),
  261. Row(
  262. mainAxisSize: MainAxisSize.max,
  263. children: [
  264. Padding(
  265. padding: EdgeInsetsDirectional.fromSTEB(
  266. 2.0, 0.0, 4.0, 0.0),
  267. child: Icon(
  268. Icons.add_business_rounded,
  269. color: FlutterFlowTheme.of(context)
  270. .primaryText,
  271. size: 20.0,
  272. ),
  273. ),
  274. Flexible(
  275. child: Text(
  276. widget!.horecagelegenheid!.toString(),
  277. maxLines: 1,
  278. style: FlutterFlowTheme.of(context)
  279. .bodySmall
  280. .override(
  281. font: GoogleFonts.roboto(
  282. fontWeight:
  283. FlutterFlowTheme.of(context)
  284. .bodySmall
  285. .fontWeight,
  286. fontStyle:
  287. FlutterFlowTheme.of(context)
  288. .bodySmall
  289. .fontStyle,
  290. ),
  291. letterSpacing: 0.0,
  292. fontWeight:
  293. FlutterFlowTheme.of(context)
  294. .bodySmall
  295. .fontWeight,
  296. fontStyle:
  297. FlutterFlowTheme.of(context)
  298. .bodySmall
  299. .fontStyle,
  300. ),
  301. ),
  302. ),
  303. ],
  304. ),
  305. Row(
  306. mainAxisSize: MainAxisSize.max,
  307. children: [
  308. Padding(
  309. padding: EdgeInsetsDirectional.fromSTEB(
  310. 2.0, 0.0, 4.0, 0.0),
  311. child: Icon(
  312. Icons.location_on_sharp,
  313. color: FlutterFlowTheme.of(context)
  314. .primaryText,
  315. size: 20.0,
  316. ),
  317. ),
  318. Flexible(
  319. child: Text(
  320. widget!.adres!.toString(),
  321. maxLines: 1,
  322. style: FlutterFlowTheme.of(context)
  323. .bodySmall
  324. .override(
  325. font: GoogleFonts.roboto(
  326. fontWeight:
  327. FlutterFlowTheme.of(context)
  328. .bodySmall
  329. .fontWeight,
  330. fontStyle:
  331. FlutterFlowTheme.of(context)
  332. .bodySmall
  333. .fontStyle,
  334. ),
  335. letterSpacing: 0.0,
  336. fontWeight:
  337. FlutterFlowTheme.of(context)
  338. .bodySmall
  339. .fontWeight,
  340. fontStyle:
  341. FlutterFlowTheme.of(context)
  342. .bodySmall
  343. .fontStyle,
  344. ),
  345. ),
  346. ),
  347. Text(
  348. FFLocalizations.of(context).getText(
  349. 'p3hbyhqm' /* , */,
  350. ),
  351. style: FlutterFlowTheme.of(context)
  352. .bodyMedium
  353. .override(
  354. font: GoogleFonts.roboto(
  355. fontWeight:
  356. FlutterFlowTheme.of(context)
  357. .bodyMedium
  358. .fontWeight,
  359. fontStyle:
  360. FlutterFlowTheme.of(context)
  361. .bodyMedium
  362. .fontStyle,
  363. ),
  364. letterSpacing: 0.0,
  365. fontWeight: FlutterFlowTheme.of(context)
  366. .bodyMedium
  367. .fontWeight,
  368. fontStyle: FlutterFlowTheme.of(context)
  369. .bodyMedium
  370. .fontStyle,
  371. ),
  372. ),
  373. Text(
  374. widget!.plaats!.toString(),
  375. maxLines: 1,
  376. style: FlutterFlowTheme.of(context)
  377. .bodySmall
  378. .override(
  379. font: GoogleFonts.roboto(
  380. fontWeight:
  381. FlutterFlowTheme.of(context)
  382. .bodySmall
  383. .fontWeight,
  384. fontStyle:
  385. FlutterFlowTheme.of(context)
  386. .bodySmall
  387. .fontStyle,
  388. ),
  389. letterSpacing: 0.0,
  390. fontWeight: FlutterFlowTheme.of(context)
  391. .bodySmall
  392. .fontWeight,
  393. fontStyle: FlutterFlowTheme.of(context)
  394. .bodySmall
  395. .fontStyle,
  396. ),
  397. ),
  398. ],
  399. ),
  400. Row(
  401. mainAxisSize: MainAxisSize.max,
  402. children: [
  403. Padding(
  404. padding: EdgeInsetsDirectional.fromSTEB(
  405. 2.0, 0.0, 4.0, 0.0),
  406. child: Icon(
  407. Icons.calendar_month,
  408. color: FlutterFlowTheme.of(context)
  409. .primaryText,
  410. size: 20.0,
  411. ),
  412. ),
  413. Flexible(
  414. child: Text(
  415. widget!.datum!.toString(),
  416. maxLines: 1,
  417. style: FlutterFlowTheme.of(context)
  418. .bodySmall
  419. .override(
  420. font: GoogleFonts.roboto(
  421. fontWeight:
  422. FlutterFlowTheme.of(context)
  423. .bodySmall
  424. .fontWeight,
  425. fontStyle:
  426. FlutterFlowTheme.of(context)
  427. .bodySmall
  428. .fontStyle,
  429. ),
  430. letterSpacing: 0.0,
  431. fontWeight:
  432. FlutterFlowTheme.of(context)
  433. .bodySmall
  434. .fontWeight,
  435. fontStyle:
  436. FlutterFlowTheme.of(context)
  437. .bodySmall
  438. .fontStyle,
  439. ),
  440. ),
  441. ),
  442. ],
  443. ),
  444. Expanded(
  445. child: Builder(
  446. builder: (context) {
  447. if (widget!.inhoud != null) {
  448. return Text(
  449. widget!.inhoud!.toString(),
  450. textAlign: TextAlign.start,
  451. maxLines: () {
  452. if (MediaQuery.sizeOf(context).width <
  453. kBreakpointSmall) {
  454. return 2;
  455. } else if (MediaQuery.sizeOf(context)
  456. .width <
  457. kBreakpointMedium) {
  458. return 4;
  459. } else if (MediaQuery.sizeOf(context)
  460. .width <
  461. kBreakpointLarge) {
  462. return 6;
  463. } else {
  464. return 8;
  465. }
  466. }(),
  467. style: FlutterFlowTheme.of(context)
  468. .bodySmall
  469. .override(
  470. font: GoogleFonts.roboto(
  471. fontWeight:
  472. FlutterFlowTheme.of(context)
  473. .bodySmall
  474. .fontWeight,
  475. fontStyle:
  476. FlutterFlowTheme.of(context)
  477. .bodySmall
  478. .fontStyle,
  479. ),
  480. letterSpacing: 0.0,
  481. fontWeight:
  482. FlutterFlowTheme.of(context)
  483. .bodySmall
  484. .fontWeight,
  485. fontStyle:
  486. FlutterFlowTheme.of(context)
  487. .bodySmall
  488. .fontStyle,
  489. ),
  490. overflow: TextOverflow.ellipsis,
  491. );
  492. } else {
  493. return Text(
  494. FFLocalizations.of(context).getText(
  495. 'q3hgdkv4' /* Binnenkort meer... */,
  496. ),
  497. style: FlutterFlowTheme.of(context)
  498. .bodyMedium
  499. .override(
  500. font: GoogleFonts.roboto(
  501. fontWeight:
  502. FlutterFlowTheme.of(context)
  503. .bodyMedium
  504. .fontWeight,
  505. fontStyle:
  506. FlutterFlowTheme.of(context)
  507. .bodyMedium
  508. .fontStyle,
  509. ),
  510. letterSpacing: 0.0,
  511. fontWeight:
  512. FlutterFlowTheme.of(context)
  513. .bodyMedium
  514. .fontWeight,
  515. fontStyle:
  516. FlutterFlowTheme.of(context)
  517. .bodyMedium
  518. .fontStyle,
  519. ),
  520. );
  521. }
  522. },
  523. ),
  524. ),
  525. Padding(
  526. padding: EdgeInsetsDirectional.fromSTEB(
  527. 8.0, 4.0, 8.0, 4.0),
  528. child: Container(
  529. decoration: BoxDecoration(),
  530. child: Builder(
  531. builder: (context) {
  532. final categorieitem =
  533. widget!.categorie?.toList() ?? [];
  534. _model.debugGeneratorVariables[
  535. 'categorieitem${categorieitem.length > 100 ? ' (first 100)' : ''}'] =
  536. debugSerializeParam(
  537. categorieitem.take(100),
  538. ParamType.JSON,
  539. isList: true,
  540. link:
  541. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=UitgaantabelKaart',
  542. name: 'dynamic',
  543. nullable: false,
  544. );
  545. debugLogWidgetClass(_model);
  546. return Wrap(
  547. spacing: 0.0,
  548. runSpacing: 0.0,
  549. alignment: WrapAlignment.start,
  550. crossAxisAlignment:
  551. WrapCrossAlignment.start,
  552. direction: Axis.horizontal,
  553. runAlignment: WrapAlignment.start,
  554. verticalDirection: VerticalDirection.down,
  555. clipBehavior: Clip.none,
  556. children:
  557. List.generate(categorieitem.length,
  558. (categorieitemIndex) {
  559. final categorieitemItem =
  560. categorieitem[categorieitemIndex];
  561. return Builder(builder: (_) {
  562. return DebugFlutterFlowModelContext(
  563. rootModel: _model.rootModel,
  564. parentModelCallback: (m) {
  565. _model.tagCategorieComponentModels[
  566. 'Keynhs_${categorieitemIndex}_of_${categorieitem.length}'] = m;
  567. },
  568. child: TagCategorieComponentWidget(
  569. key: Key(
  570. 'Keynhs_${categorieitemIndex}_of_${categorieitem.length}'),
  571. categorieTag:
  572. categorieitemItem.toString(),
  573. ),
  574. );
  575. });
  576. }),
  577. );
  578. },
  579. ),
  580. ),
  581. ),
  582. ],
  583. ),
  584. ),
  585. ),
  586. ),
  587. ),
  588. ),
  589. ],
  590. ),
  591. ),
  592. ),
  593. );
  594. }
  595. }