evenement_info_widget.dart 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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 '/flutter_flow/custom_functions.dart' as functions;
  6. import 'package:flutter/material.dart';
  7. import 'package:flutter_spinkit/flutter_spinkit.dart';
  8. import 'package:google_fonts/google_fonts.dart';
  9. import 'package:provider/provider.dart';
  10. import 'evenement_info_model.dart';
  11. export 'evenement_info_model.dart';
  12. class EvenementInfoWidget extends StatefulWidget {
  13. const EvenementInfoWidget({
  14. super.key,
  15. this.nid,
  16. this.fotoos,
  17. this.title,
  18. this.date,
  19. this.categories,
  20. this.adres,
  21. this.plaats,
  22. this.entreetoelichting,
  23. this.entreeprijs,
  24. this.website,
  25. this.contact,
  26. this.logo,
  27. this.organisator,
  28. });
  29. final String? nid;
  30. final List<String>? fotoos;
  31. final String? title;
  32. final String? date;
  33. final List<String>? categories;
  34. final String? adres;
  35. final String? plaats;
  36. final String? entreetoelichting;
  37. final String? entreeprijs;
  38. final String? website;
  39. final String? contact;
  40. final String? logo;
  41. final String? organisator;
  42. @override
  43. State<EvenementInfoWidget> createState() => _EvenementInfoWidgetState();
  44. }
  45. class _EvenementInfoWidgetState extends State<EvenementInfoWidget>
  46. with RouteAware {
  47. late EvenementInfoModel _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, () => EvenementInfoModel());
  57. }
  58. @override
  59. void dispose() {
  60. routeObserver.unsubscribe(this);
  61. _model.maybeDispose();
  62. super.dispose();
  63. }
  64. @override
  65. void didUpdateWidget(EvenementInfoWidget 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. return SingleChildScrollView(
  106. primary: false,
  107. child: Column(
  108. mainAxisSize: MainAxisSize.max,
  109. mainAxisAlignment: MainAxisAlignment.start,
  110. crossAxisAlignment: CrossAxisAlignment.start,
  111. children: [
  112. Row(
  113. mainAxisSize: MainAxisSize.max,
  114. mainAxisAlignment: MainAxisAlignment.start,
  115. children: [
  116. Padding(
  117. padding: EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 4.0, 0.0),
  118. child: Icon(
  119. Icons.location_on_sharp,
  120. color: FlutterFlowTheme.of(context).primaryText,
  121. size: 20.0,
  122. ),
  123. ),
  124. Expanded(
  125. child: Text(
  126. functions.adresRegel(widget!.adres, widget!.plaats),
  127. style: FlutterFlowTheme.of(context).bodyMedium.override(
  128. font: GoogleFonts.roboto(
  129. fontWeight: FlutterFlowTheme.of(context)
  130. .bodyMedium
  131. .fontWeight,
  132. fontStyle:
  133. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  134. ),
  135. letterSpacing: 0.0,
  136. fontWeight:
  137. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  138. fontStyle:
  139. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  140. ),
  141. ),
  142. ),
  143. ],
  144. ),
  145. if (widget!.entreeprijs != null && widget!.entreeprijs != '')
  146. Row(
  147. mainAxisSize: MainAxisSize.min,
  148. mainAxisAlignment: MainAxisAlignment.center,
  149. children: [
  150. Text(
  151. FFLocalizations.of(context).getText(
  152. 'gpbaiwi9' /* Entree: */,
  153. ),
  154. textAlign: TextAlign.center,
  155. style: FlutterFlowTheme.of(context).titleSmall.override(
  156. font: GoogleFonts.roboto(
  157. fontWeight: FlutterFlowTheme.of(context)
  158. .titleSmall
  159. .fontWeight,
  160. fontStyle:
  161. FlutterFlowTheme.of(context).titleSmall.fontStyle,
  162. ),
  163. letterSpacing: 0.0,
  164. fontWeight:
  165. FlutterFlowTheme.of(context).titleSmall.fontWeight,
  166. fontStyle:
  167. FlutterFlowTheme.of(context).titleSmall.fontStyle,
  168. ),
  169. ),
  170. Column(
  171. mainAxisSize: MainAxisSize.min,
  172. children: [
  173. if (widget!.entreeprijs != null &&
  174. widget!.entreeprijs != '')
  175. Text(
  176. valueOrDefault<String>(
  177. widget!.entreeprijs,
  178. 'Prijs onbekend',
  179. ),
  180. style: FlutterFlowTheme.of(context).bodyMedium.override(
  181. font: GoogleFonts.roboto(
  182. fontWeight: FlutterFlowTheme.of(context)
  183. .bodyMedium
  184. .fontWeight,
  185. fontStyle: FlutterFlowTheme.of(context)
  186. .bodyMedium
  187. .fontStyle,
  188. ),
  189. letterSpacing: 0.0,
  190. fontWeight: FlutterFlowTheme.of(context)
  191. .bodyMedium
  192. .fontWeight,
  193. fontStyle: FlutterFlowTheme.of(context)
  194. .bodyMedium
  195. .fontStyle,
  196. ),
  197. ),
  198. if (widget!.entreetoelichting != null &&
  199. widget!.entreetoelichting != '')
  200. Text(
  201. valueOrDefault<String>(
  202. widget!.entreetoelichting,
  203. 'Geen toelichting',
  204. ),
  205. style: FlutterFlowTheme.of(context).bodyMedium.override(
  206. font: GoogleFonts.roboto(
  207. fontWeight: FlutterFlowTheme.of(context)
  208. .bodyMedium
  209. .fontWeight,
  210. fontStyle: FlutterFlowTheme.of(context)
  211. .bodyMedium
  212. .fontStyle,
  213. ),
  214. letterSpacing: 0.0,
  215. fontWeight: FlutterFlowTheme.of(context)
  216. .bodyMedium
  217. .fontWeight,
  218. fontStyle: FlutterFlowTheme.of(context)
  219. .bodyMedium
  220. .fontStyle,
  221. ),
  222. ),
  223. ],
  224. ),
  225. ],
  226. ),
  227. if (widget!.website != null && widget!.website != '')
  228. InkWell(
  229. splashColor: Colors.transparent,
  230. focusColor: Colors.transparent,
  231. hoverColor: Colors.transparent,
  232. highlightColor: Colors.transparent,
  233. onTap: () async {
  234. await launchURL(widget!.website!);
  235. },
  236. child: Text(
  237. FFLocalizations.of(context).getText(
  238. 'khjv0wcp' /* Website */,
  239. ),
  240. style: FlutterFlowTheme.of(context).bodyMedium.override(
  241. font: GoogleFonts.roboto(
  242. fontWeight:
  243. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  244. fontStyle:
  245. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  246. ),
  247. color: FlutterFlowTheme.of(context).secondary,
  248. letterSpacing: 0.0,
  249. fontWeight:
  250. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  251. fontStyle:
  252. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  253. decoration: TextDecoration.underline,
  254. ),
  255. ),
  256. ),
  257. if (widget!.contact != null && widget!.contact != '')
  258. Text(
  259. valueOrDefault<String>(
  260. widget!.contact,
  261. 'Contact onbekend',
  262. ),
  263. style: FlutterFlowTheme.of(context).bodyMedium.override(
  264. font: GoogleFonts.roboto(
  265. fontWeight:
  266. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  267. fontStyle:
  268. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  269. ),
  270. letterSpacing: 0.0,
  271. fontWeight:
  272. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  273. fontStyle:
  274. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  275. ),
  276. ),
  277. if (widget!.organisator != null && widget!.organisator != '')
  278. Text(
  279. 'Organisator: ${widget!.organisator}',
  280. style: FlutterFlowTheme.of(context).bodyMedium.override(
  281. font: GoogleFonts.roboto(
  282. fontWeight:
  283. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  284. fontStyle:
  285. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  286. ),
  287. letterSpacing: 0.0,
  288. fontWeight:
  289. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  290. fontStyle:
  291. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  292. ),
  293. ),
  294. ],
  295. ),
  296. );
  297. }
  298. }