evenement_info_widget.dart 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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 'dart:ui';
  5. import 'package:flutter/material.dart';
  6. import 'package:flutter_spinkit/flutter_spinkit.dart';
  7. import 'package:google_fonts/google_fonts.dart';
  8. import 'package:provider/provider.dart';
  9. import 'evenement_info_model.dart';
  10. export 'evenement_info_model.dart';
  11. class EvenementInfoWidget extends StatefulWidget {
  12. const EvenementInfoWidget({
  13. super.key,
  14. this.nid,
  15. this.fotoos,
  16. this.title,
  17. this.date,
  18. this.categories,
  19. this.adres,
  20. this.plaats,
  21. this.entreetoelichting,
  22. this.entreeprijs,
  23. this.website,
  24. this.contact,
  25. this.logo,
  26. });
  27. final String? nid;
  28. final List<String>? fotoos;
  29. final String? title;
  30. final String? date;
  31. final List<String>? categories;
  32. final String? adres;
  33. final String? plaats;
  34. final String? entreetoelichting;
  35. final String? entreeprijs;
  36. final String? website;
  37. final String? contact;
  38. final String? logo;
  39. @override
  40. State<EvenementInfoWidget> createState() => _EvenementInfoWidgetState();
  41. }
  42. class _EvenementInfoWidgetState extends State<EvenementInfoWidget>
  43. with RouteAware {
  44. late EvenementInfoModel _model;
  45. @override
  46. void setState(VoidCallback callback) {
  47. super.setState(callback);
  48. _model.onUpdate();
  49. }
  50. @override
  51. void initState() {
  52. super.initState();
  53. _model = createModel(context, () => EvenementInfoModel());
  54. }
  55. @override
  56. void dispose() {
  57. routeObserver.unsubscribe(this);
  58. _model.maybeDispose();
  59. super.dispose();
  60. }
  61. @override
  62. void didUpdateWidget(EvenementInfoWidget oldWidget) {
  63. super.didUpdateWidget(oldWidget);
  64. _model.widget = widget;
  65. }
  66. @override
  67. void didChangeDependencies() {
  68. super.didChangeDependencies();
  69. final route = DebugModalRoute.of(context);
  70. if (route != null) {
  71. routeObserver.subscribe(this, route);
  72. }
  73. debugLogGlobalProperty(context);
  74. }
  75. @override
  76. void didPopNext() {
  77. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  78. setState(() => _model.isRouteVisible = true);
  79. debugLogWidgetClass(_model);
  80. }
  81. }
  82. @override
  83. void didPush() {
  84. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  85. setState(() => _model.isRouteVisible = true);
  86. debugLogWidgetClass(_model);
  87. }
  88. }
  89. @override
  90. void didPop() {
  91. _model.isRouteVisible = false;
  92. }
  93. @override
  94. void didPushNext() {
  95. _model.isRouteVisible = false;
  96. }
  97. @override
  98. Widget build(BuildContext context) {
  99. DebugFlutterFlowModelContext.maybeOf(context)
  100. ?.parentModelCallback
  101. ?.call(_model);
  102. return SingleChildScrollView(
  103. primary: false,
  104. child: Column(
  105. mainAxisSize: MainAxisSize.max,
  106. mainAxisAlignment: MainAxisAlignment.start,
  107. crossAxisAlignment: CrossAxisAlignment.start,
  108. children: [
  109. Row(
  110. mainAxisSize: MainAxisSize.max,
  111. mainAxisAlignment: MainAxisAlignment.start,
  112. children: [
  113. Padding(
  114. padding: EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 4.0, 0.0),
  115. child: Icon(
  116. Icons.location_on_sharp,
  117. color: FlutterFlowTheme.of(context).primaryText,
  118. size: 20.0,
  119. ),
  120. ),
  121. Expanded(
  122. child: Text(
  123. '${widget!.adres}, ${widget!.plaats}',
  124. style: FlutterFlowTheme.of(context).bodyMedium.override(
  125. font: GoogleFonts.roboto(
  126. fontWeight: FlutterFlowTheme.of(context)
  127. .bodyMedium
  128. .fontWeight,
  129. fontStyle:
  130. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  131. ),
  132. letterSpacing: 0.0,
  133. fontWeight:
  134. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  135. fontStyle:
  136. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  137. ),
  138. ),
  139. ),
  140. ],
  141. ),
  142. if (widget!.entreeprijs != null && widget!.entreeprijs != '')
  143. Row(
  144. mainAxisSize: MainAxisSize.min,
  145. mainAxisAlignment: MainAxisAlignment.center,
  146. children: [
  147. Text(
  148. FFLocalizations.of(context).getText(
  149. 'gpbaiwi9' /* Entree: */,
  150. ),
  151. textAlign: TextAlign.center,
  152. style: FlutterFlowTheme.of(context).titleSmall.override(
  153. font: GoogleFonts.roboto(
  154. fontWeight: FlutterFlowTheme.of(context)
  155. .titleSmall
  156. .fontWeight,
  157. fontStyle:
  158. FlutterFlowTheme.of(context).titleSmall.fontStyle,
  159. ),
  160. letterSpacing: 0.0,
  161. fontWeight:
  162. FlutterFlowTheme.of(context).titleSmall.fontWeight,
  163. fontStyle:
  164. FlutterFlowTheme.of(context).titleSmall.fontStyle,
  165. ),
  166. ),
  167. Column(
  168. mainAxisSize: MainAxisSize.min,
  169. children: [
  170. if (widget!.entreeprijs != null &&
  171. widget!.entreeprijs != '')
  172. Text(
  173. valueOrDefault<String>(
  174. widget!.entreeprijs,
  175. 'Prijs onbekend',
  176. ),
  177. style: FlutterFlowTheme.of(context).bodyMedium.override(
  178. font: GoogleFonts.roboto(
  179. fontWeight: FlutterFlowTheme.of(context)
  180. .bodyMedium
  181. .fontWeight,
  182. fontStyle: FlutterFlowTheme.of(context)
  183. .bodyMedium
  184. .fontStyle,
  185. ),
  186. letterSpacing: 0.0,
  187. fontWeight: FlutterFlowTheme.of(context)
  188. .bodyMedium
  189. .fontWeight,
  190. fontStyle: FlutterFlowTheme.of(context)
  191. .bodyMedium
  192. .fontStyle,
  193. ),
  194. ),
  195. if (widget!.entreetoelichting != null &&
  196. widget!.entreetoelichting != '')
  197. Text(
  198. valueOrDefault<String>(
  199. widget!.entreetoelichting,
  200. 'Geen toelichting',
  201. ),
  202. style: FlutterFlowTheme.of(context).bodyMedium.override(
  203. font: GoogleFonts.roboto(
  204. fontWeight: FlutterFlowTheme.of(context)
  205. .bodyMedium
  206. .fontWeight,
  207. fontStyle: FlutterFlowTheme.of(context)
  208. .bodyMedium
  209. .fontStyle,
  210. ),
  211. letterSpacing: 0.0,
  212. fontWeight: FlutterFlowTheme.of(context)
  213. .bodyMedium
  214. .fontWeight,
  215. fontStyle: FlutterFlowTheme.of(context)
  216. .bodyMedium
  217. .fontStyle,
  218. ),
  219. ),
  220. ],
  221. ),
  222. ],
  223. ),
  224. if (widget!.website != null && widget!.website != '')
  225. InkWell(
  226. splashColor: Colors.transparent,
  227. focusColor: Colors.transparent,
  228. hoverColor: Colors.transparent,
  229. highlightColor: Colors.transparent,
  230. onTap: () async {
  231. await launchURL(widget!.website!);
  232. },
  233. child: Text(
  234. FFLocalizations.of(context).getText(
  235. 'khjv0wcp' /* Website */,
  236. ),
  237. style: FlutterFlowTheme.of(context).bodyMedium.override(
  238. font: GoogleFonts.roboto(
  239. fontWeight:
  240. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  241. fontStyle:
  242. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  243. ),
  244. color: FlutterFlowTheme.of(context).secondary,
  245. letterSpacing: 0.0,
  246. fontWeight:
  247. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  248. fontStyle:
  249. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  250. decoration: TextDecoration.underline,
  251. ),
  252. ),
  253. ),
  254. if (widget!.contact != null && widget!.contact != '')
  255. Text(
  256. valueOrDefault<String>(
  257. widget!.contact,
  258. 'Contact onbekend',
  259. ),
  260. style: FlutterFlowTheme.of(context).bodyMedium.override(
  261. font: GoogleFonts.roboto(
  262. fontWeight:
  263. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  264. fontStyle:
  265. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  266. ),
  267. letterSpacing: 0.0,
  268. fontWeight:
  269. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  270. fontStyle:
  271. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  272. ),
  273. ),
  274. ],
  275. ),
  276. );
  277. }
  278. }