uitgaantabel_kaart_widget.dart 26 KB

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