uitgaantabel_kaart_widget.dart 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  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: Color(0x33000000),
  146. offset: Offset(
  147. 0.0,
  148. 2.0,
  149. ),
  150. )
  151. ],
  152. borderRadius: BorderRadius.only(
  153. topLeft: Radius.circular(12.0),
  154. topRight: Radius.circular(12.0),
  155. bottomLeft: Radius.circular(12.0),
  156. bottomRight: Radius.circular(12.0),
  157. ),
  158. ),
  159. child: Row(
  160. mainAxisSize: MainAxisSize.max,
  161. children: [
  162. Expanded(
  163. flex: 3,
  164. child: Container(
  165. decoration: BoxDecoration(
  166. color: FlutterFlowTheme.of(context).secondaryBackground,
  167. ),
  168. child: Stack(
  169. children: [
  170. Align(
  171. alignment: AlignmentDirectional(0.0, 1.0),
  172. child: Builder(
  173. builder: (context) {
  174. if (widget!.logo != null) {
  175. return ClipRRect(
  176. borderRadius: BorderRadius.circular(8.0),
  177. child: OctoImage(
  178. placeholderBuilder: (_) {
  179. final blurHash =
  180. 'L6PZfSi_.AyE_3t7t7R**0o#DgR4';
  181. if (!validateBlurhash(blurHash)) {
  182. return const SizedBox.shrink();
  183. }
  184. return SizedBox.expand(
  185. child: Image(
  186. image: BlurHashImage(blurHash),
  187. fit: BoxFit.cover,
  188. ),
  189. );
  190. },
  191. image: CachedNetworkImageProvider(
  192. widget!.logo!.toString(),
  193. ),
  194. width: double.infinity,
  195. height: double.infinity,
  196. fit: BoxFit.fitHeight,
  197. ),
  198. );
  199. } else {
  200. return Icon(
  201. Icons.image_not_supported,
  202. color: FlutterFlowTheme.of(context).primaryText,
  203. size: 24.0,
  204. );
  205. }
  206. },
  207. ),
  208. ),
  209. ],
  210. ),
  211. ),
  212. ),
  213. Expanded(
  214. flex: 6,
  215. child: Padding(
  216. padding: EdgeInsetsDirectional.fromSTEB(6.0, 0.0, 0.0, 0.0),
  217. child: ClipRRect(
  218. child: Container(
  219. decoration: BoxDecoration(
  220. color: FlutterFlowTheme.of(context).secondaryBackground,
  221. ),
  222. child: Align(
  223. alignment: AlignmentDirectional(-1.0, 0.0),
  224. child: Column(
  225. mainAxisSize: MainAxisSize.max,
  226. mainAxisAlignment: MainAxisAlignment.start,
  227. crossAxisAlignment: CrossAxisAlignment.start,
  228. children: [
  229. Padding(
  230. padding: EdgeInsetsDirectional.fromSTEB(
  231. 0.0, 0.0, 0.0, 5.0),
  232. child: AutoSizeText(
  233. widget!.titel!.toString(),
  234. style: FlutterFlowTheme.of(context)
  235. .bodyLarge
  236. .override(
  237. font: GoogleFonts.roboto(
  238. fontWeight: FlutterFlowTheme.of(context)
  239. .bodyLarge
  240. .fontWeight,
  241. fontStyle: FlutterFlowTheme.of(context)
  242. .bodyLarge
  243. .fontStyle,
  244. ),
  245. letterSpacing: 0.0,
  246. fontWeight: FlutterFlowTheme.of(context)
  247. .bodyLarge
  248. .fontWeight,
  249. fontStyle: FlutterFlowTheme.of(context)
  250. .bodyLarge
  251. .fontStyle,
  252. ),
  253. overflow: TextOverflow.ellipsis,
  254. ),
  255. ),
  256. Row(
  257. mainAxisSize: MainAxisSize.max,
  258. children: [
  259. Padding(
  260. padding: EdgeInsetsDirectional.fromSTEB(
  261. 2.0, 0.0, 4.0, 0.0),
  262. child: Icon(
  263. Icons.add_business_rounded,
  264. color: FlutterFlowTheme.of(context)
  265. .primaryText,
  266. size: 20.0,
  267. ),
  268. ),
  269. Flexible(
  270. child: Text(
  271. widget!.horecagelegenheid!.toString(),
  272. style: FlutterFlowTheme.of(context)
  273. .bodySmall
  274. .override(
  275. font: GoogleFonts.roboto(
  276. fontWeight:
  277. FlutterFlowTheme.of(context)
  278. .bodySmall
  279. .fontWeight,
  280. fontStyle:
  281. FlutterFlowTheme.of(context)
  282. .bodySmall
  283. .fontStyle,
  284. ),
  285. letterSpacing: 0.0,
  286. fontWeight:
  287. FlutterFlowTheme.of(context)
  288. .bodySmall
  289. .fontWeight,
  290. fontStyle:
  291. FlutterFlowTheme.of(context)
  292. .bodySmall
  293. .fontStyle,
  294. ),
  295. ),
  296. ),
  297. ],
  298. ),
  299. Row(
  300. mainAxisSize: MainAxisSize.max,
  301. children: [
  302. Padding(
  303. padding: EdgeInsetsDirectional.fromSTEB(
  304. 2.0, 0.0, 4.0, 0.0),
  305. child: Icon(
  306. Icons.location_on_sharp,
  307. color: FlutterFlowTheme.of(context)
  308. .primaryText,
  309. size: 20.0,
  310. ),
  311. ),
  312. Flexible(
  313. child: Text(
  314. widget!.adres!.toString(),
  315. style: FlutterFlowTheme.of(context)
  316. .bodySmall
  317. .override(
  318. font: GoogleFonts.roboto(
  319. fontWeight:
  320. FlutterFlowTheme.of(context)
  321. .bodySmall
  322. .fontWeight,
  323. fontStyle:
  324. FlutterFlowTheme.of(context)
  325. .bodySmall
  326. .fontStyle,
  327. ),
  328. letterSpacing: 0.0,
  329. fontWeight:
  330. FlutterFlowTheme.of(context)
  331. .bodySmall
  332. .fontWeight,
  333. fontStyle:
  334. FlutterFlowTheme.of(context)
  335. .bodySmall
  336. .fontStyle,
  337. ),
  338. ),
  339. ),
  340. Text(
  341. FFLocalizations.of(context).getText(
  342. 'p3hbyhqm' /* , */,
  343. ),
  344. style: FlutterFlowTheme.of(context)
  345. .bodyMedium
  346. .override(
  347. font: GoogleFonts.roboto(
  348. fontWeight:
  349. FlutterFlowTheme.of(context)
  350. .bodyMedium
  351. .fontWeight,
  352. fontStyle:
  353. FlutterFlowTheme.of(context)
  354. .bodyMedium
  355. .fontStyle,
  356. ),
  357. letterSpacing: 0.0,
  358. fontWeight: FlutterFlowTheme.of(context)
  359. .bodyMedium
  360. .fontWeight,
  361. fontStyle: FlutterFlowTheme.of(context)
  362. .bodyMedium
  363. .fontStyle,
  364. ),
  365. ),
  366. Text(
  367. widget!.plaats!.toString(),
  368. style: FlutterFlowTheme.of(context)
  369. .bodySmall
  370. .override(
  371. font: GoogleFonts.roboto(
  372. fontWeight:
  373. FlutterFlowTheme.of(context)
  374. .bodySmall
  375. .fontWeight,
  376. fontStyle:
  377. FlutterFlowTheme.of(context)
  378. .bodySmall
  379. .fontStyle,
  380. ),
  381. letterSpacing: 0.0,
  382. fontWeight: FlutterFlowTheme.of(context)
  383. .bodySmall
  384. .fontWeight,
  385. fontStyle: FlutterFlowTheme.of(context)
  386. .bodySmall
  387. .fontStyle,
  388. ),
  389. ),
  390. ],
  391. ),
  392. Row(
  393. mainAxisSize: MainAxisSize.max,
  394. children: [
  395. Padding(
  396. padding: EdgeInsetsDirectional.fromSTEB(
  397. 2.0, 0.0, 4.0, 0.0),
  398. child: Icon(
  399. Icons.calendar_month,
  400. color: FlutterFlowTheme.of(context)
  401. .primaryText,
  402. size: 20.0,
  403. ),
  404. ),
  405. Flexible(
  406. child: Text(
  407. widget!.datum!.toString(),
  408. style: FlutterFlowTheme.of(context)
  409. .bodySmall
  410. .override(
  411. font: GoogleFonts.roboto(
  412. fontWeight:
  413. FlutterFlowTheme.of(context)
  414. .bodySmall
  415. .fontWeight,
  416. fontStyle:
  417. FlutterFlowTheme.of(context)
  418. .bodySmall
  419. .fontStyle,
  420. ),
  421. letterSpacing: 0.0,
  422. fontWeight:
  423. FlutterFlowTheme.of(context)
  424. .bodySmall
  425. .fontWeight,
  426. fontStyle:
  427. FlutterFlowTheme.of(context)
  428. .bodySmall
  429. .fontStyle,
  430. ),
  431. ),
  432. ),
  433. ],
  434. ),
  435. Expanded(
  436. child: Builder(
  437. builder: (context) {
  438. if (widget!.inhoud != null) {
  439. return Text(
  440. widget!.inhoud!.toString(),
  441. textAlign: TextAlign.start,
  442. style: FlutterFlowTheme.of(context)
  443. .bodySmall
  444. .override(
  445. font: GoogleFonts.roboto(
  446. fontWeight:
  447. FlutterFlowTheme.of(context)
  448. .bodySmall
  449. .fontWeight,
  450. fontStyle:
  451. FlutterFlowTheme.of(context)
  452. .bodySmall
  453. .fontStyle,
  454. ),
  455. letterSpacing: 0.0,
  456. fontWeight:
  457. FlutterFlowTheme.of(context)
  458. .bodySmall
  459. .fontWeight,
  460. fontStyle:
  461. FlutterFlowTheme.of(context)
  462. .bodySmall
  463. .fontStyle,
  464. ),
  465. overflow: TextOverflow.ellipsis,
  466. );
  467. } else {
  468. return Text(
  469. FFLocalizations.of(context).getText(
  470. 'q3hgdkv4' /* Binnenkort meer... */,
  471. ),
  472. style: FlutterFlowTheme.of(context)
  473. .bodyMedium
  474. .override(
  475. font: GoogleFonts.roboto(
  476. fontWeight:
  477. FlutterFlowTheme.of(context)
  478. .bodyMedium
  479. .fontWeight,
  480. fontStyle:
  481. FlutterFlowTheme.of(context)
  482. .bodyMedium
  483. .fontStyle,
  484. ),
  485. letterSpacing: 0.0,
  486. fontWeight:
  487. FlutterFlowTheme.of(context)
  488. .bodyMedium
  489. .fontWeight,
  490. fontStyle:
  491. FlutterFlowTheme.of(context)
  492. .bodyMedium
  493. .fontStyle,
  494. ),
  495. );
  496. }
  497. },
  498. ),
  499. ),
  500. Padding(
  501. padding: EdgeInsetsDirectional.fromSTEB(
  502. 8.0, 4.0, 8.0, 4.0),
  503. child: Container(
  504. decoration: BoxDecoration(),
  505. child: Builder(
  506. builder: (context) {
  507. final categorieitem =
  508. widget!.categorie?.toList() ?? [];
  509. _model.debugGeneratorVariables[
  510. 'categorieitem${categorieitem.length > 100 ? ' (first 100)' : ''}'] =
  511. debugSerializeParam(
  512. categorieitem.take(100),
  513. ParamType.JSON,
  514. isList: true,
  515. link:
  516. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=UitgaantabelKaart',
  517. name: 'dynamic',
  518. nullable: false,
  519. );
  520. debugLogWidgetClass(_model);
  521. return Wrap(
  522. spacing: 0.0,
  523. runSpacing: 0.0,
  524. alignment: WrapAlignment.start,
  525. crossAxisAlignment:
  526. WrapCrossAlignment.start,
  527. direction: Axis.horizontal,
  528. runAlignment: WrapAlignment.start,
  529. verticalDirection: VerticalDirection.down,
  530. clipBehavior: Clip.none,
  531. children:
  532. List.generate(categorieitem.length,
  533. (categorieitemIndex) {
  534. final categorieitemItem =
  535. categorieitem[categorieitemIndex];
  536. return Builder(builder: (_) {
  537. return DebugFlutterFlowModelContext(
  538. rootModel: _model.rootModel,
  539. parentModelCallback: (m) {
  540. _model.tagCategorieComponentModels[
  541. 'Keynhs_${categorieitemIndex}_of_${categorieitem.length}'] = m;
  542. },
  543. child: TagCategorieComponentWidget(
  544. key: Key(
  545. 'Keynhs_${categorieitemIndex}_of_${categorieitem.length}'),
  546. categorieTag:
  547. categorieitemItem.toString(),
  548. ),
  549. );
  550. });
  551. }),
  552. );
  553. },
  554. ),
  555. ),
  556. ),
  557. ],
  558. ),
  559. ),
  560. ),
  561. ),
  562. ),
  563. ),
  564. ],
  565. ),
  566. ),
  567. ),
  568. );
  569. }
  570. }