uitgaantabel_kaart_widget.dart 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  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. shadows: [
  311. Shadow(
  312. color: FlutterFlowTheme.of(context)
  313. .secondaryText,
  314. offset: Offset(0.0, 0.0),
  315. blurRadius: 0.0,
  316. )
  317. ],
  318. ),
  319. overflow: TextOverflow.ellipsis,
  320. ),
  321. ),
  322. Row(
  323. mainAxisSize: MainAxisSize.max,
  324. children: [
  325. Padding(
  326. padding: EdgeInsetsDirectional.fromSTEB(
  327. 2.0, 0.0, 4.0, 0.0),
  328. child: Icon(
  329. Icons.add_business_rounded,
  330. color: FlutterFlowTheme.of(context)
  331. .primaryText,
  332. size: 20.0,
  333. ),
  334. ),
  335. Flexible(
  336. child: Text(
  337. widget!.horecagelegenheid!.toString(),
  338. style: FlutterFlowTheme.of(context)
  339. .bodySmall
  340. .override(
  341. font: GoogleFonts.roboto(
  342. fontWeight:
  343. FlutterFlowTheme.of(context)
  344. .bodySmall
  345. .fontWeight,
  346. fontStyle:
  347. FlutterFlowTheme.of(context)
  348. .bodySmall
  349. .fontStyle,
  350. ),
  351. letterSpacing: 0.0,
  352. fontWeight:
  353. FlutterFlowTheme.of(context)
  354. .bodySmall
  355. .fontWeight,
  356. fontStyle:
  357. FlutterFlowTheme.of(context)
  358. .bodySmall
  359. .fontStyle,
  360. ),
  361. ),
  362. ),
  363. ],
  364. ),
  365. Row(
  366. mainAxisSize: MainAxisSize.max,
  367. children: [
  368. Padding(
  369. padding: EdgeInsetsDirectional.fromSTEB(
  370. 2.0, 0.0, 4.0, 0.0),
  371. child: Icon(
  372. Icons.location_on_sharp,
  373. color: FlutterFlowTheme.of(context)
  374. .primaryText,
  375. size: 20.0,
  376. ),
  377. ),
  378. Flexible(
  379. child: Text(
  380. widget!.adres!.toString(),
  381. style: FlutterFlowTheme.of(context)
  382. .bodySmall
  383. .override(
  384. font: GoogleFonts.roboto(
  385. fontWeight:
  386. FlutterFlowTheme.of(context)
  387. .bodySmall
  388. .fontWeight,
  389. fontStyle:
  390. FlutterFlowTheme.of(context)
  391. .bodySmall
  392. .fontStyle,
  393. ),
  394. letterSpacing: 0.0,
  395. fontWeight:
  396. FlutterFlowTheme.of(context)
  397. .bodySmall
  398. .fontWeight,
  399. fontStyle:
  400. FlutterFlowTheme.of(context)
  401. .bodySmall
  402. .fontStyle,
  403. ),
  404. ),
  405. ),
  406. Text(
  407. FFLocalizations.of(context).getText(
  408. 'p3hbyhqm' /* , */,
  409. ),
  410. style: FlutterFlowTheme.of(context)
  411. .bodyMedium
  412. .override(
  413. font: GoogleFonts.roboto(
  414. fontWeight:
  415. FlutterFlowTheme.of(context)
  416. .bodyMedium
  417. .fontWeight,
  418. fontStyle:
  419. FlutterFlowTheme.of(context)
  420. .bodyMedium
  421. .fontStyle,
  422. ),
  423. letterSpacing: 0.0,
  424. fontWeight: FlutterFlowTheme.of(context)
  425. .bodyMedium
  426. .fontWeight,
  427. fontStyle: FlutterFlowTheme.of(context)
  428. .bodyMedium
  429. .fontStyle,
  430. ),
  431. ),
  432. Text(
  433. widget!.plaats!.toString(),
  434. style: FlutterFlowTheme.of(context)
  435. .bodySmall
  436. .override(
  437. font: GoogleFonts.roboto(
  438. fontWeight:
  439. FlutterFlowTheme.of(context)
  440. .bodySmall
  441. .fontWeight,
  442. fontStyle:
  443. FlutterFlowTheme.of(context)
  444. .bodySmall
  445. .fontStyle,
  446. ),
  447. letterSpacing: 0.0,
  448. fontWeight: FlutterFlowTheme.of(context)
  449. .bodySmall
  450. .fontWeight,
  451. fontStyle: FlutterFlowTheme.of(context)
  452. .bodySmall
  453. .fontStyle,
  454. ),
  455. ),
  456. ],
  457. ),
  458. Row(
  459. mainAxisSize: MainAxisSize.max,
  460. children: [
  461. Padding(
  462. padding: EdgeInsetsDirectional.fromSTEB(
  463. 2.0, 0.0, 4.0, 0.0),
  464. child: Icon(
  465. Icons.calendar_month,
  466. color: FlutterFlowTheme.of(context)
  467. .primaryText,
  468. size: 20.0,
  469. ),
  470. ),
  471. Flexible(
  472. child: Text(
  473. widget!.datum!.toString(),
  474. style: FlutterFlowTheme.of(context)
  475. .bodySmall
  476. .override(
  477. font: GoogleFonts.roboto(
  478. fontWeight:
  479. FlutterFlowTheme.of(context)
  480. .bodySmall
  481. .fontWeight,
  482. fontStyle:
  483. FlutterFlowTheme.of(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. ),
  501. Expanded(
  502. child: Builder(
  503. builder: (context) {
  504. if (widget!.inhoud != null) {
  505. return Text(
  506. widget!.inhoud!.toString(),
  507. textAlign: TextAlign.start,
  508. style: FlutterFlowTheme.of(context)
  509. .bodySmall
  510. .override(
  511. font: GoogleFonts.roboto(
  512. fontWeight:
  513. FlutterFlowTheme.of(context)
  514. .bodySmall
  515. .fontWeight,
  516. fontStyle:
  517. FlutterFlowTheme.of(context)
  518. .bodySmall
  519. .fontStyle,
  520. ),
  521. letterSpacing: 0.0,
  522. fontWeight:
  523. FlutterFlowTheme.of(context)
  524. .bodySmall
  525. .fontWeight,
  526. fontStyle:
  527. FlutterFlowTheme.of(context)
  528. .bodySmall
  529. .fontStyle,
  530. ),
  531. overflow: TextOverflow.ellipsis,
  532. );
  533. } else {
  534. return Text(
  535. FFLocalizations.of(context).getText(
  536. 'q3hgdkv4' /* Binnenkort meer... */,
  537. ),
  538. style: FlutterFlowTheme.of(context)
  539. .bodyMedium
  540. .override(
  541. font: GoogleFonts.roboto(
  542. fontWeight:
  543. FlutterFlowTheme.of(context)
  544. .bodyMedium
  545. .fontWeight,
  546. fontStyle:
  547. FlutterFlowTheme.of(context)
  548. .bodyMedium
  549. .fontStyle,
  550. ),
  551. letterSpacing: 0.0,
  552. fontWeight:
  553. FlutterFlowTheme.of(context)
  554. .bodyMedium
  555. .fontWeight,
  556. fontStyle:
  557. FlutterFlowTheme.of(context)
  558. .bodyMedium
  559. .fontStyle,
  560. ),
  561. );
  562. }
  563. },
  564. ),
  565. ),
  566. ],
  567. ),
  568. ),
  569. ),
  570. ),
  571. ),
  572. ),
  573. ],
  574. ),
  575. ),
  576. ),
  577. );
  578. }
  579. }