event_current_widget.dart 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. import '/backend/api_requests/api_calls.dart';
  2. import '/evenement/evenement_horecagelegenheid/evenement_horecagelegenheid_widget.dart';
  3. import '/evenement/evenement_info/evenement_info_widget.dart';
  4. import '/evenement/evenement_v2_h_t_m_l_component/evenement_v2_h_t_m_l_component_widget.dart';
  5. import '/flutter_flow/flutter_flow_icon_button.dart';
  6. import '/flutter_flow/flutter_flow_theme.dart';
  7. import '/flutter_flow/flutter_flow_util.dart';
  8. import '/flutter_flow/flutter_flow_widgets.dart';
  9. import '/shared/drawer_component/drawer_component_widget.dart';
  10. import 'dart:ui';
  11. import 'package:carousel_slider/carousel_slider.dart';
  12. import 'package:flutter/material.dart';
  13. import 'package:flutter_spinkit/flutter_spinkit.dart';
  14. import 'package:google_fonts/google_fonts.dart';
  15. import 'package:provider/provider.dart';
  16. import 'package:share_plus/share_plus.dart';
  17. import 'event_current_model.dart';
  18. export 'event_current_model.dart';
  19. class EventCurrentWidget extends StatefulWidget {
  20. const EventCurrentWidget({
  21. super.key,
  22. this.nid,
  23. this.horecaid,
  24. });
  25. final String? nid;
  26. final String? horecaid;
  27. static String routeName = 'EventCurrent';
  28. static String routePath = '/eventCurrent';
  29. @override
  30. State<EventCurrentWidget> createState() => _EventCurrentWidgetState();
  31. }
  32. class _EventCurrentWidgetState extends State<EventCurrentWidget>
  33. with RouteAware {
  34. late EventCurrentModel _model;
  35. final scaffoldKey = GlobalKey<ScaffoldState>();
  36. @override
  37. void initState() {
  38. super.initState();
  39. _model = createModel(context, () => EventCurrentModel());
  40. }
  41. @override
  42. void dispose() {
  43. routeObserver.unsubscribe(this);
  44. _model.dispose();
  45. super.dispose();
  46. }
  47. @override
  48. void didUpdateWidget(EventCurrentWidget oldWidget) {
  49. super.didUpdateWidget(oldWidget);
  50. _model.widget = widget;
  51. }
  52. @override
  53. void didChangeDependencies() {
  54. super.didChangeDependencies();
  55. final route = DebugModalRoute.of(context);
  56. if (route != null) {
  57. routeObserver.subscribe(this, route);
  58. }
  59. debugLogGlobalProperty(context);
  60. }
  61. @override
  62. void didPopNext() {
  63. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  64. setState(() => _model.isRouteVisible = true);
  65. debugLogWidgetClass(_model);
  66. }
  67. }
  68. @override
  69. void didPush() {
  70. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  71. setState(() => _model.isRouteVisible = true);
  72. debugLogWidgetClass(_model);
  73. }
  74. }
  75. @override
  76. void didPop() {
  77. _model.isRouteVisible = false;
  78. }
  79. @override
  80. void didPushNext() {
  81. _model.isRouteVisible = false;
  82. }
  83. @override
  84. Widget build(BuildContext context) {
  85. DebugFlutterFlowModelContext.maybeOf(context)
  86. ?.parentModelCallback
  87. ?.call(_model);
  88. return FutureBuilder<ApiCallResponse>(
  89. future: EvenementCall.call(
  90. nid: widget!.nid,
  91. ),
  92. builder: (context, snapshot) {
  93. // Customize what your widget looks like when it's loading.
  94. if (!snapshot.hasData) {
  95. return Scaffold(
  96. backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
  97. body: Center(
  98. child: SizedBox(
  99. width: 80.0,
  100. height: 80.0,
  101. child: SpinKitFadingCircle(
  102. color: Color(0xFFB1061E),
  103. size: 80.0,
  104. ),
  105. ),
  106. ),
  107. );
  108. }
  109. final eventCurrentEvenementResponse = snapshot.data!;
  110. _model.debugBackendQueries[
  111. 'EvenementCall_statusCode_Scaffold_vv4pr88m'] = debugSerializeParam(
  112. eventCurrentEvenementResponse.statusCode,
  113. ParamType.int,
  114. link:
  115. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=EventCurrent',
  116. name: 'int',
  117. nullable: false,
  118. );
  119. _model.debugBackendQueries[
  120. 'EvenementCall_responseBody_Scaffold_vv4pr88m'] =
  121. debugSerializeParam(
  122. eventCurrentEvenementResponse.bodyText,
  123. ParamType.String,
  124. link:
  125. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=EventCurrent',
  126. name: 'String',
  127. nullable: false,
  128. );
  129. debugLogWidgetClass(_model);
  130. return GestureDetector(
  131. onTap: () {
  132. FocusScope.of(context).unfocus();
  133. FocusManager.instance.primaryFocus?.unfocus();
  134. },
  135. child: Scaffold(
  136. key: scaffoldKey,
  137. backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
  138. drawer: Drawer(
  139. elevation: 16.0,
  140. child: wrapWithModel(
  141. model: _model.drawerComponentModel,
  142. updateCallback: () => safeSetState(() {}),
  143. child: Builder(builder: (_) {
  144. return DebugFlutterFlowModelContext(
  145. rootModel: _model.rootModel,
  146. child: DrawerComponentWidget(),
  147. );
  148. }),
  149. ),
  150. ),
  151. appBar: PreferredSize(
  152. preferredSize:
  153. Size.fromHeight(MediaQuery.sizeOf(context).height * 0.12),
  154. child: AppBar(
  155. backgroundColor: FlutterFlowTheme.of(context).info,
  156. automaticallyImplyLeading: false,
  157. actions: [],
  158. flexibleSpace: FlexibleSpaceBar(
  159. title: Align(
  160. alignment: AlignmentDirectional(0.0, 0.0),
  161. child: Row(
  162. mainAxisSize: MainAxisSize.max,
  163. children: [
  164. Padding(
  165. padding: EdgeInsetsDirectional.fromSTEB(
  166. 12.0, 0.0, 0.0, 0.0),
  167. child: FlutterFlowIconButton(
  168. borderColor: Color(0x00FF0000),
  169. borderRadius: 30.0,
  170. borderWidth: 1.0,
  171. buttonSize: 50.0,
  172. fillColor: Color(0xFFFF0000),
  173. icon: Icon(
  174. Icons.arrow_back_outlined,
  175. color: Colors.white,
  176. size: 30.0,
  177. ),
  178. onPressed: () async {
  179. context.pop();
  180. },
  181. ),
  182. ),
  183. FlutterFlowIconButton(
  184. borderRadius: 8.0,
  185. buttonSize: 40.0,
  186. fillColor: FlutterFlowTheme.of(context).primary,
  187. icon: Icon(
  188. Icons.dehaze_outlined,
  189. color: FlutterFlowTheme.of(context).info,
  190. size: 24.0,
  191. ),
  192. onPressed: () async {
  193. scaffoldKey.currentState!.openDrawer();
  194. },
  195. ),
  196. ],
  197. ),
  198. ),
  199. background: Align(
  200. alignment: AlignmentDirectional(0.0, 0.0),
  201. child: Padding(
  202. padding:
  203. EdgeInsetsDirectional.fromSTEB(100.0, 0.0, 15.0, 0.0),
  204. child: ClipRRect(
  205. borderRadius: BorderRadius.circular(8.0),
  206. child: Image.asset(
  207. 'assets/images/logo800px.png',
  208. width: MediaQuery.sizeOf(context).width * 0.7,
  209. fit: BoxFit.fitWidth,
  210. ),
  211. ),
  212. ),
  213. ),
  214. centerTitle: true,
  215. expandedTitleScale: 1.0,
  216. ),
  217. toolbarHeight: MediaQuery.sizeOf(context).height * 0.2,
  218. elevation: 2.0,
  219. ),
  220. ),
  221. body: SafeArea(
  222. top: true,
  223. child: Column(
  224. mainAxisSize: MainAxisSize.max,
  225. children: [
  226. Builder(
  227. builder: (context) {
  228. final fotoos = EvenementCall.eventFotoos(
  229. eventCurrentEvenementResponse.jsonBody,
  230. )?.toList() ??
  231. [];
  232. _model.debugGeneratorVariables[
  233. 'fotoos${fotoos.length > 100 ? ' (first 100)' : ''}'] =
  234. debugSerializeParam(
  235. fotoos.take(100),
  236. ParamType.String,
  237. isList: true,
  238. link:
  239. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=EventCurrent',
  240. name: 'String',
  241. nullable: false,
  242. );
  243. debugLogWidgetClass(_model);
  244. return Container(
  245. width: double.infinity,
  246. height: 200.0,
  247. child: CarouselSlider.builder(
  248. itemCount: fotoos.length,
  249. itemBuilder: (context, fotoosIndex, _) {
  250. final fotoosItem = fotoos[fotoosIndex];
  251. return ClipRRect(
  252. borderRadius: BorderRadius.circular(8.0),
  253. child: Image.network(
  254. fotoosItem,
  255. width: 200.0,
  256. height: 200.0,
  257. fit: BoxFit.cover,
  258. ),
  259. );
  260. },
  261. carouselController: _model.carouselController ??=
  262. CarouselSliderController(),
  263. options: CarouselOptions(
  264. initialPage: max(0, min(1, fotoos.length - 1)),
  265. viewportFraction: 0.5,
  266. disableCenter: true,
  267. enlargeCenterPage: true,
  268. enlargeFactor: 0.25,
  269. enableInfiniteScroll: true,
  270. scrollDirection: Axis.horizontal,
  271. autoPlay: false,
  272. onPageChanged: (index, _) =>
  273. _model.carouselCurrentIndex = index,
  274. ),
  275. ),
  276. );
  277. },
  278. ),
  279. Row(
  280. mainAxisSize: MainAxisSize.max,
  281. mainAxisAlignment: MainAxisAlignment.center,
  282. children: [
  283. Text(
  284. valueOrDefault<String>(
  285. EvenementCall.eventTitle(
  286. eventCurrentEvenementResponse.jsonBody,
  287. ),
  288. 'title',
  289. ),
  290. style:
  291. FlutterFlowTheme.of(context).headlineLarge.override(
  292. font: GoogleFonts.interTight(
  293. fontWeight: FlutterFlowTheme.of(context)
  294. .headlineLarge
  295. .fontWeight,
  296. fontStyle: FlutterFlowTheme.of(context)
  297. .headlineLarge
  298. .fontStyle,
  299. ),
  300. letterSpacing: 0.0,
  301. fontWeight: FlutterFlowTheme.of(context)
  302. .headlineLarge
  303. .fontWeight,
  304. fontStyle: FlutterFlowTheme.of(context)
  305. .headlineLarge
  306. .fontStyle,
  307. shadows: [
  308. Shadow(
  309. color: FlutterFlowTheme.of(context).secondaryText,
  310. offset: Offset(2.0, 2.0),
  311. blurRadius: 2.0,
  312. )
  313. ],
  314. ),
  315. ),
  316. Builder(
  317. builder: (context) => FlutterFlowIconButton(
  318. borderRadius: 8.0,
  319. buttonSize: 40.0,
  320. fillColor: Color(0xFFF265A0),
  321. icon: Icon(
  322. Icons.share,
  323. color: FlutterFlowTheme.of(context).info,
  324. size: 24.0,
  325. ),
  326. onPressed: () async {
  327. await Share.share(
  328. 'https://uitgk.com/${widget!.nid}',
  329. sharePositionOrigin:
  330. getWidgetBoundingBox(context),
  331. );
  332. },
  333. ),
  334. ),
  335. ],
  336. ),
  337. Text(
  338. valueOrDefault<String>(
  339. widget!.nid,
  340. 'nid',
  341. ),
  342. style: FlutterFlowTheme.of(context).bodyMedium.override(
  343. font: GoogleFonts.inter(
  344. fontWeight: FlutterFlowTheme.of(context)
  345. .bodyMedium
  346. .fontWeight,
  347. fontStyle: FlutterFlowTheme.of(context)
  348. .bodyMedium
  349. .fontStyle,
  350. ),
  351. letterSpacing: 0.0,
  352. fontWeight: FlutterFlowTheme.of(context)
  353. .bodyMedium
  354. .fontWeight,
  355. fontStyle:
  356. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  357. ),
  358. ),
  359. Text(
  360. valueOrDefault<String>(
  361. EvenementCall.eventDate(
  362. eventCurrentEvenementResponse.jsonBody,
  363. ),
  364. 'date',
  365. ),
  366. style: FlutterFlowTheme.of(context).headlineSmall.override(
  367. font: GoogleFonts.interTight(
  368. fontWeight: FlutterFlowTheme.of(context)
  369. .headlineSmall
  370. .fontWeight,
  371. fontStyle: FlutterFlowTheme.of(context)
  372. .headlineSmall
  373. .fontStyle,
  374. ),
  375. letterSpacing: 0.0,
  376. fontWeight: FlutterFlowTheme.of(context)
  377. .headlineSmall
  378. .fontWeight,
  379. fontStyle: FlutterFlowTheme.of(context)
  380. .headlineSmall
  381. .fontStyle,
  382. ),
  383. ),
  384. Expanded(
  385. child: Row(
  386. mainAxisSize: MainAxisSize.max,
  387. children: [
  388. Material(
  389. color: Colors.transparent,
  390. elevation: 7.0,
  391. child: Container(
  392. decoration: BoxDecoration(
  393. boxShadow: [
  394. BoxShadow(
  395. blurRadius: 4.0,
  396. color: Color(0x33000000),
  397. offset: Offset(
  398. 0.0,
  399. 2.0,
  400. ),
  401. )
  402. ],
  403. gradient: LinearGradient(
  404. colors: [Color(0xFFE51414), Color(0xFFD28039)],
  405. stops: [0.0, 1.0],
  406. begin: AlignmentDirectional(0.0, -1.0),
  407. end: AlignmentDirectional(0, 1.0),
  408. ),
  409. border: Border.all(
  410. width: 2.0,
  411. ),
  412. ),
  413. child: Column(
  414. mainAxisSize: MainAxisSize.max,
  415. children: [
  416. Padding(
  417. padding: EdgeInsetsDirectional.fromSTEB(
  418. 1.0, 3.0, 1.0, 2.0),
  419. child: Builder(
  420. builder: (context) {
  421. final categorie =
  422. EvenementCall.eventCategorie(
  423. eventCurrentEvenementResponse
  424. .jsonBody,
  425. )?.toList() ??
  426. [];
  427. _model.debugGeneratorVariables[
  428. 'categorie${categorie.length > 100 ? ' (first 100)' : ''}'] =
  429. debugSerializeParam(
  430. categorie.take(100),
  431. ParamType.String,
  432. isList: true,
  433. link:
  434. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=EventCurrent',
  435. name: 'String',
  436. nullable: false,
  437. );
  438. debugLogWidgetClass(_model);
  439. return Row(
  440. mainAxisSize: MainAxisSize.max,
  441. mainAxisAlignment:
  442. MainAxisAlignment.end,
  443. children: List.generate(
  444. categorie.length, (categorieIndex) {
  445. final categorieItem =
  446. categorie[categorieIndex];
  447. return Align(
  448. alignment:
  449. AlignmentDirectional(1.0, 0.0),
  450. child: Padding(
  451. padding: EdgeInsetsDirectional
  452. .fromSTEB(4.0, 1.0, 4.0, 1.0),
  453. child: Material(
  454. color: Colors.transparent,
  455. elevation: 3.0,
  456. shape: RoundedRectangleBorder(
  457. borderRadius:
  458. BorderRadius.circular(
  459. 2.0),
  460. ),
  461. child: Container(
  462. decoration: BoxDecoration(
  463. color: Color(0xFF25CC3E),
  464. boxShadow: [
  465. BoxShadow(
  466. blurRadius: 4.0,
  467. color:
  468. Color(0x33000000),
  469. offset: Offset(
  470. 0.0,
  471. 2.0,
  472. ),
  473. )
  474. ],
  475. borderRadius:
  476. BorderRadius.circular(
  477. 2.0),
  478. border: Border.all(
  479. width: 0.5,
  480. ),
  481. ),
  482. child: Padding(
  483. padding:
  484. EdgeInsetsDirectional
  485. .fromSTEB(0.0, 0.0,
  486. 4.0, 0.0),
  487. child: Text(
  488. categorieItem,
  489. style:
  490. FlutterFlowTheme.of(
  491. context)
  492. .titleSmall
  493. .override(
  494. font: GoogleFonts
  495. .interTight(
  496. fontWeight:
  497. FlutterFlowTheme.of(
  498. context)
  499. .titleSmall
  500. .fontWeight,
  501. fontStyle:
  502. FlutterFlowTheme.of(
  503. context)
  504. .titleSmall
  505. .fontStyle,
  506. ),
  507. letterSpacing: 0.0,
  508. fontWeight:
  509. FlutterFlowTheme.of(
  510. context)
  511. .titleSmall
  512. .fontWeight,
  513. fontStyle:
  514. FlutterFlowTheme.of(
  515. context)
  516. .titleSmall
  517. .fontStyle,
  518. shadows: [
  519. Shadow(
  520. color: FlutterFlowTheme
  521. .of(context)
  522. .secondaryText,
  523. offset: Offset(
  524. 2.0, 2.0),
  525. blurRadius: 2.0,
  526. )
  527. ],
  528. ),
  529. ),
  530. ),
  531. ),
  532. ),
  533. ),
  534. );
  535. }),
  536. );
  537. },
  538. ),
  539. ),
  540. Padding(
  541. padding: EdgeInsetsDirectional.fromSTEB(
  542. 4.0, 2.0, 4.0, 15.0),
  543. child: ClipRRect(
  544. borderRadius: BorderRadius.circular(8.0),
  545. child: Image.network(
  546. EvenementCall.eventLogog(
  547. eventCurrentEvenementResponse.jsonBody,
  548. )!,
  549. width: MediaQuery.sizeOf(context).width *
  550. 0.15,
  551. height:
  552. MediaQuery.sizeOf(context).height *
  553. 0.15,
  554. fit: BoxFit.cover,
  555. ),
  556. ),
  557. ),
  558. Expanded(
  559. child: wrapWithModel(
  560. model: _model.evenementInfoModel,
  561. updateCallback: () => safeSetState(() {}),
  562. child: Builder(builder: (_) {
  563. return DebugFlutterFlowModelContext(
  564. rootModel: _model.rootModel,
  565. child: EvenementInfoWidget(
  566. nid: EvenementCall.eventNid(
  567. eventCurrentEvenementResponse
  568. .jsonBody,
  569. ),
  570. title: EvenementCall.eventTitle(
  571. eventCurrentEvenementResponse
  572. .jsonBody,
  573. ),
  574. date: EvenementCall.eventDate(
  575. eventCurrentEvenementResponse
  576. .jsonBody,
  577. ),
  578. adres: EvenementCall.eventAdres(
  579. eventCurrentEvenementResponse
  580. .jsonBody,
  581. ),
  582. plaats: EvenementCall.eventPlaats(
  583. eventCurrentEvenementResponse
  584. .jsonBody,
  585. ),
  586. entreetoelichting: EvenementCall
  587. .eventEntreeToelichting(
  588. eventCurrentEvenementResponse
  589. .jsonBody,
  590. ),
  591. entreeprijs:
  592. EvenementCall.eventEntreeprijs(
  593. eventCurrentEvenementResponse
  594. .jsonBody,
  595. ),
  596. website: EvenementCall.eventWebsiteg(
  597. eventCurrentEvenementResponse
  598. .jsonBody,
  599. ),
  600. contact: EvenementCall.eventContact(
  601. eventCurrentEvenementResponse
  602. .jsonBody,
  603. ),
  604. logo: EvenementCall.eventLogog(
  605. eventCurrentEvenementResponse
  606. .jsonBody,
  607. ),
  608. fotoos: EvenementCall.eventFotoos(
  609. eventCurrentEvenementResponse
  610. .jsonBody,
  611. ),
  612. categories:
  613. EvenementCall.eventCategorie(
  614. eventCurrentEvenementResponse
  615. .jsonBody,
  616. ),
  617. ),
  618. );
  619. }),
  620. ),
  621. ),
  622. ],
  623. ),
  624. ),
  625. ),
  626. SingleChildScrollView(
  627. child: Column(
  628. mainAxisSize: MainAxisSize.max,
  629. children: [
  630. Container(
  631. width: MediaQuery.sizeOf(context).width * 0.6,
  632. decoration: BoxDecoration(
  633. color: FlutterFlowTheme.of(context).alternate,
  634. boxShadow: [
  635. BoxShadow(
  636. blurRadius: 4.0,
  637. color: Color(0x33000000),
  638. offset: Offset(
  639. 4.0,
  640. 2.0,
  641. ),
  642. )
  643. ],
  644. borderRadius: BorderRadius.circular(4.0),
  645. border: Border.all(
  646. color: Colors.black,
  647. ),
  648. ),
  649. child: wrapWithModel(
  650. model: _model.evenementV2HTMLComponentModel,
  651. updateCallback: () => safeSetState(() {}),
  652. child: Builder(builder: (_) {
  653. return DebugFlutterFlowModelContext(
  654. rootModel: _model.rootModel,
  655. child: EvenementV2HTMLComponentWidget(
  656. body: EvenementCall.eventBody(
  657. eventCurrentEvenementResponse
  658. .jsonBody,
  659. ),
  660. ),
  661. );
  662. }),
  663. ),
  664. ),
  665. ],
  666. ),
  667. ),
  668. ],
  669. ),
  670. ),
  671. Expanded(
  672. child: wrapWithModel(
  673. model: _model.evenementHorecagelegenheidModel,
  674. updateCallback: () => safeSetState(() {}),
  675. child: Builder(builder: (_) {
  676. return DebugFlutterFlowModelContext(
  677. rootModel: _model.rootModel,
  678. child: EvenementHorecagelegenheidWidget(
  679. establishmentID: widget!.horecaid!,
  680. ),
  681. );
  682. }),
  683. ),
  684. ),
  685. ],
  686. ),
  687. ),
  688. ),
  689. );
  690. },
  691. );
  692. }
  693. }