| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832 |
- import '/backend/api_requests/api_calls.dart';
- import '/components/header_buttons_component_widget.dart';
- import '/evenement/evenement_horecagelegenheid/evenement_horecagelegenheid_widget.dart';
- import '/evenement/evenement_info/evenement_info_widget.dart';
- import '/evenement/evenement_v2_h_t_m_l_component/evenement_v2_h_t_m_l_component_widget.dart';
- import '/flutter_flow/flutter_flow_icon_button.dart';
- import '/flutter_flow/flutter_flow_theme.dart';
- import '/flutter_flow/flutter_flow_util.dart';
- import '/flutter_flow/flutter_flow_widgets.dart';
- import '/shared/drawer_component/drawer_component_widget.dart';
- import 'dart:ui';
- import '/index.dart';
- import 'package:aligned_tooltip/aligned_tooltip.dart';
- import 'package:carousel_slider/carousel_slider.dart';
- import 'package:cached_network_image/cached_network_image.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter_spinkit/flutter_spinkit.dart';
- import 'package:google_fonts/google_fonts.dart';
- import 'package:provider/provider.dart';
- import 'package:share_plus/share_plus.dart';
- import 'event_current_model.dart';
- export 'event_current_model.dart';
- class EventCurrentWidget extends StatefulWidget {
- const EventCurrentWidget({
- super.key,
- this.nid,
- this.horecaid,
- });
- final String? nid;
- final String? horecaid;
- static String routeName = 'EventCurrent';
- static String routePath = '/eventCurrent';
- @override
- State<EventCurrentWidget> createState() => _EventCurrentWidgetState();
- }
- class _EventCurrentWidgetState extends State<EventCurrentWidget>
- with RouteAware {
- late EventCurrentModel _model;
- final scaffoldKey = GlobalKey<ScaffoldState>();
- @override
- void initState() {
- super.initState();
- _model = createModel(context, () => EventCurrentModel());
- }
- @override
- void dispose() {
- routeObserver.unsubscribe(this);
- _model.dispose();
- super.dispose();
- }
- @override
- void didUpdateWidget(EventCurrentWidget oldWidget) {
- super.didUpdateWidget(oldWidget);
- _model.widget = widget;
- }
- @override
- void didChangeDependencies() {
- super.didChangeDependencies();
- final route = DebugModalRoute.of(context);
- if (route != null) {
- routeObserver.subscribe(this, route);
- }
- debugLogGlobalProperty(context);
- }
- @override
- void didPopNext() {
- if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
- setState(() => _model.isRouteVisible = true);
- debugLogWidgetClass(_model);
- }
- }
- @override
- void didPush() {
- if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
- setState(() => _model.isRouteVisible = true);
- debugLogWidgetClass(_model);
- }
- }
- @override
- void didPop() {
- _model.isRouteVisible = false;
- }
- @override
- void didPushNext() {
- _model.isRouteVisible = false;
- }
- @override
- Widget build(BuildContext context) {
- DebugFlutterFlowModelContext.maybeOf(context)
- ?.parentModelCallback
- ?.call(_model);
- context.watch<FFAppState>();
- return FutureBuilder<ApiCallResponse>(
- future: EvenementCall.call(
- nid: widget!.nid,
- ),
- builder: (context, snapshot) {
- // Customize what your widget looks like when it's loading.
- if (!snapshot.hasData) {
- return Scaffold(
- backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
- body: Center(
- child: SizedBox(
- width: 80.0,
- height: 80.0,
- child: SpinKitFadingCircle(
- color: Color(0xFFB1061E),
- size: 80.0,
- ),
- ),
- ),
- );
- }
- final eventCurrentEvenementResponse = snapshot.data!;
- _model.debugBackendQueries[
- 'EvenementCall_statusCode_Scaffold_vv4pr88m'] = debugSerializeParam(
- eventCurrentEvenementResponse.statusCode,
- ParamType.int,
- link:
- 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=EventCurrent',
- name: 'int',
- nullable: false,
- );
- _model.debugBackendQueries[
- 'EvenementCall_responseBody_Scaffold_vv4pr88m'] =
- debugSerializeParam(
- eventCurrentEvenementResponse.bodyText,
- ParamType.String,
- link:
- 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=EventCurrent',
- name: 'String',
- nullable: false,
- );
- debugLogWidgetClass(_model);
- return GestureDetector(
- onTap: () {
- FocusScope.of(context).unfocus();
- FocusManager.instance.primaryFocus?.unfocus();
- },
- child: Scaffold(
- key: scaffoldKey,
- backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
- drawer: Drawer(
- elevation: 16.0,
- child: wrapWithModel(
- model: _model.drawerComponentModel,
- updateCallback: () => safeSetState(() {}),
- child: Builder(builder: (_) {
- return DebugFlutterFlowModelContext(
- rootModel: _model.rootModel,
- child: DrawerComponentWidget(),
- );
- }),
- ),
- ),
- appBar: PreferredSize(
- preferredSize:
- Size.fromHeight(MediaQuery.sizeOf(context).height * 0.12),
- child: AppBar(
- backgroundColor: FlutterFlowTheme.of(context).info,
- automaticallyImplyLeading: false,
- actions: [],
- flexibleSpace: FlexibleSpaceBar(
- title: Align(
- alignment: AlignmentDirectional(0.0, 0.0),
- child: Row(
- mainAxisSize: MainAxisSize.max,
- children: [
- Expanded(
- child: wrapWithModel(
- model: _model.headerButtonsComponentModel,
- updateCallback: () => safeSetState(() {}),
- child: Builder(builder: (_) {
- return DebugFlutterFlowModelContext(
- rootModel: _model.rootModel,
- child: HeaderButtonsComponentWidget(),
- );
- }),
- ),
- ),
- ],
- ),
- ),
- background: Align(
- alignment: AlignmentDirectional(0.0, 0.0),
- child: Padding(
- padding:
- EdgeInsetsDirectional.fromSTEB(100.0, 0.0, 15.0, 0.0),
- child: ClipRRect(
- borderRadius: BorderRadius.circular(8.0),
- child: Image.asset(
- 'assets/images/logo800px.png',
- width: MediaQuery.sizeOf(context).width * 0.7,
- fit: BoxFit.fitWidth,
- ),
- ),
- ),
- ),
- centerTitle: true,
- expandedTitleScale: 1.0,
- ),
- toolbarHeight: MediaQuery.sizeOf(context).height * 0.2,
- elevation: 2.0,
- ),
- ),
- body: SafeArea(
- top: true,
- child: Column(
- mainAxisSize: MainAxisSize.max,
- children: [
- Builder(
- builder: (context) {
- final fotoos = EvenementCall.eventFotoos(
- eventCurrentEvenementResponse.jsonBody,
- )?.toList() ??
- [];
- _model.debugGeneratorVariables[
- 'fotoos${fotoos.length > 100 ? ' (first 100)' : ''}'] =
- debugSerializeParam(
- fotoos.take(100),
- ParamType.String,
- isList: true,
- link:
- 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=EventCurrent',
- name: 'String',
- nullable: false,
- );
- debugLogWidgetClass(_model);
- return Container(
- width: double.infinity,
- height: 200.0,
- child: CarouselSlider.builder(
- itemCount: fotoos.length,
- itemBuilder: (context, fotoosIndex, _) {
- final fotoosItem = fotoos[fotoosIndex];
- return Builder(
- builder: (context) {
- if (fotoosItem != null && fotoosItem != '') {
- return ClipRRect(
- borderRadius: BorderRadius.circular(8.0),
- child: CachedNetworkImage(
- fadeInDuration:
- Duration(milliseconds: 500),
- fadeOutDuration:
- Duration(milliseconds: 500),
- imageUrl: fotoosItem,
- width: 200.0,
- height: 200.0,
- fit: BoxFit.cover,
- ),
- );
- } else {
- return Icon(
- Icons.image_not_supported,
- color: FlutterFlowTheme.of(context)
- .primaryText,
- size: 24.0,
- );
- }
- },
- );
- },
- carouselController: _model.carouselController ??=
- CarouselSliderController(),
- options: CarouselOptions(
- initialPage: max(0, min(1, fotoos.length - 1)),
- viewportFraction: 0.5,
- disableCenter: true,
- enlargeCenterPage: true,
- enlargeFactor: 0.25,
- enableInfiniteScroll: true,
- scrollDirection: Axis.horizontal,
- autoPlay: false,
- onPageChanged: (index, _) =>
- _model.carouselCurrentIndex = index,
- ),
- ),
- );
- },
- ),
- Row(
- mainAxisSize: MainAxisSize.max,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- if (getJsonField(
- eventCurrentEvenementResponse.jsonBody,
- r'''$[0].title''',
- ) !=
- null)
- Padding(
- padding: EdgeInsetsDirectional.fromSTEB(
- 0.0, 0.0, 8.0, 0.0),
- child: Text(
- valueOrDefault<String>(
- EvenementCall.eventTitle(
- eventCurrentEvenementResponse.jsonBody,
- ),
- 'title',
- ),
- style: FlutterFlowTheme.of(context)
- .headlineLarge
- .override(
- font: GoogleFonts.interTight(
- fontWeight: FlutterFlowTheme.of(context)
- .headlineLarge
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .headlineLarge
- .fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight: FlutterFlowTheme.of(context)
- .headlineLarge
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .headlineLarge
- .fontStyle,
- shadows: [
- Shadow(
- color: FlutterFlowTheme.of(context)
- .secondaryText,
- offset: Offset(2.0, 2.0),
- blurRadius: 2.0,
- )
- ],
- ),
- ),
- ),
- AlignedTooltip(
- content: Padding(
- padding: EdgeInsets.all(4.0),
- child: Text(
- FFLocalizations.of(context).getText(
- 'z63o5kzf' /* Delen */,
- ),
- style:
- FlutterFlowTheme.of(context).bodyLarge.override(
- font: GoogleFonts.inter(
- fontWeight: FlutterFlowTheme.of(context)
- .bodyLarge
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .bodyLarge
- .fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight: FlutterFlowTheme.of(context)
- .bodyLarge
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .bodyLarge
- .fontStyle,
- ),
- ),
- ),
- offset: 4.0,
- preferredDirection: AxisDirection.down,
- borderRadius: BorderRadius.circular(8.0),
- backgroundColor:
- FlutterFlowTheme.of(context).secondaryBackground,
- elevation: 4.0,
- tailBaseWidth: 24.0,
- tailLength: 12.0,
- waitDuration: Duration(milliseconds: 100),
- showDuration: Duration(milliseconds: 1500),
- triggerMode: TooltipTriggerMode.tap,
- child: Builder(
- builder: (context) => FlutterFlowIconButton(
- borderRadius: 8.0,
- buttonSize: 40.0,
- fillColor: Color(0xFFF265A0),
- icon: Icon(
- Icons.share,
- color: FlutterFlowTheme.of(context).info,
- size: 24.0,
- ),
- onPressed: () async {
- await Share.share(
- 'https://uitgk.com/${widget!.nid}',
- sharePositionOrigin:
- getWidgetBoundingBox(context),
- );
- },
- ),
- ),
- ),
- ],
- ),
- if (getJsonField(
- eventCurrentEvenementResponse.jsonBody,
- r'''$[0].datum''',
- ) !=
- null)
- Text(
- valueOrDefault<String>(
- EvenementCall.eventDate(
- eventCurrentEvenementResponse.jsonBody,
- ),
- 'date',
- ),
- style:
- FlutterFlowTheme.of(context).headlineSmall.override(
- font: GoogleFonts.interTight(
- fontWeight: FlutterFlowTheme.of(context)
- .headlineSmall
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .headlineSmall
- .fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight: FlutterFlowTheme.of(context)
- .headlineSmall
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .headlineSmall
- .fontStyle,
- ),
- ),
- Expanded(
- child: Row(
- mainAxisSize: MainAxisSize.max,
- children: [
- Material(
- color: Colors.transparent,
- elevation: 7.0,
- child: Container(
- decoration: BoxDecoration(
- boxShadow: [
- BoxShadow(
- blurRadius: 4.0,
- color: Color(0x33000000),
- offset: Offset(
- 0.0,
- 2.0,
- ),
- )
- ],
- gradient: LinearGradient(
- colors: [Color(0xFFE51414), Color(0xFFD28039)],
- stops: [0.0, 1.0],
- begin: AlignmentDirectional(0.0, -1.0),
- end: AlignmentDirectional(0, 1.0),
- ),
- border: Border.all(
- width: 2.0,
- ),
- ),
- child: Column(
- mainAxisSize: MainAxisSize.max,
- children: [
- Padding(
- padding: EdgeInsetsDirectional.fromSTEB(
- 1.0, 3.0, 1.0, 2.0),
- child: Builder(
- builder: (context) {
- final categorie =
- EvenementCall.eventCategorie(
- eventCurrentEvenementResponse
- .jsonBody,
- )?.toList() ??
- [];
- _model.debugGeneratorVariables[
- 'categorie${categorie.length > 100 ? ' (first 100)' : ''}'] =
- debugSerializeParam(
- categorie.take(100),
- ParamType.String,
- isList: true,
- link:
- 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=EventCurrent',
- name: 'String',
- nullable: false,
- );
- debugLogWidgetClass(_model);
- return Wrap(
- spacing: 0.0,
- runSpacing: 0.0,
- alignment: WrapAlignment.start,
- crossAxisAlignment:
- WrapCrossAlignment.start,
- direction: Axis.horizontal,
- runAlignment: WrapAlignment.start,
- verticalDirection:
- VerticalDirection.down,
- clipBehavior: Clip.none,
- children: List.generate(
- categorie.length, (categorieIndex) {
- final categorieItem =
- categorie[categorieIndex];
- return Align(
- alignment:
- AlignmentDirectional(1.0, 0.0),
- child: Padding(
- padding: EdgeInsetsDirectional
- .fromSTEB(4.0, 1.0, 4.0, 1.0),
- child: Material(
- color: Colors.transparent,
- elevation: 3.0,
- shape: RoundedRectangleBorder(
- borderRadius:
- BorderRadius.circular(
- 2.0),
- ),
- child: Container(
- decoration: BoxDecoration(
- color: Color(0xFF25CC3E),
- boxShadow: [
- BoxShadow(
- blurRadius: 4.0,
- color:
- Color(0x33000000),
- offset: Offset(
- 0.0,
- 2.0,
- ),
- )
- ],
- borderRadius:
- BorderRadius.circular(
- 2.0),
- border: Border.all(
- width: 0.5,
- ),
- ),
- child: Padding(
- padding:
- EdgeInsetsDirectional
- .fromSTEB(0.0, 0.0,
- 4.0, 0.0),
- child: Text(
- categorieItem,
- style:
- FlutterFlowTheme.of(
- context)
- .titleSmall
- .override(
- font: GoogleFonts
- .interTight(
- fontWeight:
- FlutterFlowTheme.of(
- context)
- .titleSmall
- .fontWeight,
- fontStyle:
- FlutterFlowTheme.of(
- context)
- .titleSmall
- .fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight:
- FlutterFlowTheme.of(
- context)
- .titleSmall
- .fontWeight,
- fontStyle:
- FlutterFlowTheme.of(
- context)
- .titleSmall
- .fontStyle,
- shadows: [
- Shadow(
- color: FlutterFlowTheme
- .of(context)
- .secondaryText,
- offset: Offset(
- 2.0, 2.0),
- blurRadius: 2.0,
- )
- ],
- ),
- ),
- ),
- ),
- ),
- ),
- );
- }),
- );
- },
- ),
- ),
- Builder(
- builder: (context) {
- if (getJsonField(
- eventCurrentEvenementResponse
- .jsonBody,
- r'''$[0].logo''',
- ) !=
- null) {
- return Padding(
- padding: EdgeInsetsDirectional.fromSTEB(
- 4.0, 2.0, 4.0, 15.0),
- child: ClipRRect(
- borderRadius:
- BorderRadius.circular(8.0),
- child: CachedNetworkImage(
- fadeInDuration:
- Duration(milliseconds: 500),
- fadeOutDuration:
- Duration(milliseconds: 500),
- imageUrl: EvenementCall.eventLogog(
- eventCurrentEvenementResponse
- .jsonBody,
- )!,
- width: MediaQuery.sizeOf(context)
- .width *
- 0.15,
- height: MediaQuery.sizeOf(context)
- .height *
- 0.15,
- fit: BoxFit.cover,
- ),
- ),
- );
- } else {
- return Icon(
- Icons.image_not_supported,
- color: FlutterFlowTheme.of(context)
- .primaryText,
- size: 24.0,
- );
- }
- },
- ),
- Expanded(
- child: wrapWithModel(
- model: _model.evenementInfoModel,
- updateCallback: () => safeSetState(() {}),
- child: Builder(builder: (_) {
- return DebugFlutterFlowModelContext(
- rootModel: _model.rootModel,
- child: EvenementInfoWidget(
- nid: EvenementCall.eventNid(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- title: EvenementCall.eventTitle(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- date: EvenementCall.eventDate(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- adres: EvenementCall.eventAdres(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- plaats: EvenementCall.eventPlaats(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- entreetoelichting: EvenementCall
- .eventEntreeToelichting(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- entreeprijs:
- EvenementCall.eventEntreeprijs(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- website: EvenementCall.eventWebsiteg(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- contact: EvenementCall.eventContact(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- logo: EvenementCall.eventLogog(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- fotoos: EvenementCall.eventFotoos(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- categories:
- EvenementCall.eventCategorie(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- ),
- );
- }),
- ),
- ),
- ],
- ),
- ),
- ),
- SingleChildScrollView(
- child: Column(
- mainAxisSize: MainAxisSize.max,
- children: [
- Container(
- width: MediaQuery.sizeOf(context).width * 0.6,
- decoration: BoxDecoration(
- color: FlutterFlowTheme.of(context).alternate,
- boxShadow: [
- BoxShadow(
- blurRadius: 4.0,
- color: Color(0x33000000),
- offset: Offset(
- 4.0,
- 2.0,
- ),
- )
- ],
- borderRadius: BorderRadius.circular(4.0),
- border: Border.all(
- color: Colors.black,
- ),
- ),
- child: wrapWithModel(
- model: _model.evenementV2HTMLComponentModel,
- updateCallback: () => safeSetState(() {}),
- child: Builder(builder: (_) {
- return DebugFlutterFlowModelContext(
- rootModel: _model.rootModel,
- child: EvenementV2HTMLComponentWidget(
- body: EvenementCall.eventBody(
- eventCurrentEvenementResponse
- .jsonBody,
- ),
- ),
- );
- }),
- ),
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- if (widget!.horecaid != null && widget!.horecaid != '')
- Expanded(
- child: wrapWithModel(
- model: _model.evenementHorecagelegenheidModel,
- updateCallback: () => safeSetState(() {}),
- child: Builder(builder: (_) {
- return DebugFlutterFlowModelContext(
- rootModel: _model.rootModel,
- child: EvenementHorecagelegenheidWidget(
- establishmentID: widget!.horecaid!,
- ),
- );
- }),
- ),
- ),
- FFButtonWidget(
- onPressed: () async {
- context.pushNamed(
- PUitgaanPageWidget.routeName,
- queryParameters: {
- 'plaats': serializeParam(
- FFAppState().gemeenteSelectId,
- ParamType.String,
- ),
- 'services': serializeParam(
- 'services_1',
- ParamType.String,
- ),
- }.withoutNulls,
- );
- },
- text: FFLocalizations.of(context).getText(
- '89l5y9jd' /* Alle evenementen */,
- ),
- options: FFButtonOptions(
- height: 40.0,
- padding:
- EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 0.0),
- iconPadding:
- EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
- color: FlutterFlowTheme.of(context).primary,
- textStyle:
- FlutterFlowTheme.of(context).titleSmall.override(
- font: GoogleFonts.interTight(
- fontWeight: FlutterFlowTheme.of(context)
- .titleSmall
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .titleSmall
- .fontStyle,
- ),
- color: Colors.white,
- letterSpacing: 0.0,
- fontWeight: FlutterFlowTheme.of(context)
- .titleSmall
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .titleSmall
- .fontStyle,
- ),
- elevation: 0.0,
- borderRadius: BorderRadius.circular(8.0),
- ),
- ),
- ],
- ),
- ),
- ),
- );
- },
- );
- }
- }
|