import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import '/shared/tag_categorie_component/tag_categorie_component_widget.dart'; import 'dart:ui'; import 'dart:async'; import 'package:auto_size_text/auto_size_text.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:infinite_scroll_pagination/infinite_scroll_pagination.dart'; import 'package:provider/provider.dart'; import 'uitgaantabel_kaart_component_model.dart'; export 'uitgaantabel_kaart_component_model.dart'; class UitgaantabelKaartComponentWidget extends StatefulWidget { const UitgaantabelKaartComponentWidget({ super.key, required this.towndid, required this.displayid, }); final String? towndid; final String? displayid; @override State createState() => _UitgaantabelKaartComponentWidgetState(); } class _UitgaantabelKaartComponentWidgetState extends State with RouteAware { late UitgaantabelKaartComponentModel _model; @override void setState(VoidCallback callback) { super.setState(callback); _model.onUpdate(); } @override void initState() { super.initState(); _model = createModel(context, () => UitgaantabelKaartComponentModel()); } @override void dispose() { routeObserver.unsubscribe(this); _model.maybeDispose(); super.dispose(); } @override void didUpdateWidget(UitgaantabelKaartComponentWidget 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); _model.tagCategorieComponentModels.clear(); return Padding( padding: EdgeInsetsDirectional.fromSTEB( valueOrDefault( () { if (MediaQuery.sizeOf(context).width < kBreakpointSmall) { return 5.0; } else if (MediaQuery.sizeOf(context).width < kBreakpointMedium) { return 10.0; } else if (MediaQuery.sizeOf(context).width < kBreakpointLarge) { return 15.0; } else { return 10.0; } }(), 0.0, ), 0.0, 0.0, 0.0), child: RefreshIndicator( onRefresh: () async { safeSetState(() => _model.listViewPagingController?.refresh()); await _model.waitForOnePageForListView(); }, child: PagedListView( pagingController: _model.setListViewController( (nextPageMarker) => UitgaanstabelCall.call( page: nextPageMarker.nextPageNumber, townid: widget!.towndid, displayId: widget!.displayid, ), ), padding: EdgeInsets.zero, shrinkWrap: true, reverse: false, scrollDirection: Axis.vertical, builderDelegate: PagedChildBuilderDelegate( // Customize what your widget looks like when it's loading the first page. firstPageProgressIndicatorBuilder: (_) => Center( child: SizedBox( width: 80.0, height: 80.0, child: SpinKitFadingCircle( color: Color(0xFFB1061E), size: 80.0, ), ), ), // Customize what your widget looks like when it's loading another page. newPageProgressIndicatorBuilder: (_) => Center( child: SizedBox( width: 80.0, height: 80.0, child: SpinKitFadingCircle( color: Color(0xFFB1061E), size: 80.0, ), ), ), itemBuilder: (context, _, evenementenIndex) { final evenementenItem = _model.listViewPagingController!.itemList![evenementenIndex]; return Padding( padding: EdgeInsetsDirectional.fromSTEB(12.0, 12.0, 12.0, 12.0), child: Container( height: () { if (MediaQuery.sizeOf(context).width < kBreakpointSmall) { return 160.0; } else if (MediaQuery.sizeOf(context).width < kBreakpointMedium) { return 200.0; } else if (MediaQuery.sizeOf(context).width < kBreakpointLarge) { return 240.0; } else { return 280.0; } }(), decoration: BoxDecoration( color: Colors.white, boxShadow: [ BoxShadow( blurRadius: 4.0, color: Color(0x33000000), offset: Offset( 0.0, 2.0, ), ) ], borderRadius: BorderRadius.only( topLeft: Radius.circular(12.0), topRight: Radius.circular(12.0), bottomLeft: Radius.circular(12.0), bottomRight: Radius.circular(12.0), ), ), child: Row( mainAxisSize: MainAxisSize.max, children: [ Expanded( flex: 3, child: Container( decoration: BoxDecoration( color: FlutterFlowTheme.of(context) .secondaryBackground, ), child: Stack( children: [ Align( alignment: AlignmentDirectional(0.0, 1.0), child: ClipRRect( borderRadius: BorderRadius.circular(8.0), child: CachedNetworkImage( fadeInDuration: Duration(milliseconds: 500), fadeOutDuration: Duration(milliseconds: 500), imageUrl: getJsonField( evenementenItem, r'''$.logo''', ).toString(), fit: BoxFit.fitHeight, ), ), ), Align( alignment: AlignmentDirectional(-0.92, 0.76), child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 8.0, 4.0, 8.0, 4.0), child: Container( decoration: BoxDecoration(), child: Builder( builder: (context) { final categorieitem = getJsonField( evenementenItem, r'''$.categorie''', ).toList(); _model.debugGeneratorVariables[ 'categorieitem${categorieitem.length > 100 ? ' (first 100)' : ''}'] = debugSerializeParam( categorieitem.take(100), ParamType.JSON, isList: true, link: 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=UitgaantabelKaartComponent', name: 'dynamic', nullable: false, ); debugLogWidgetClass(_model); return Row( mainAxisSize: MainAxisSize.max, children: List.generate( categorieitem.length, (categorieitemIndex) { final categorieitemItem = categorieitem[ categorieitemIndex]; return Builder(builder: (_) { return DebugFlutterFlowModelContext( rootModel: _model.rootModel, parentModelCallback: (m) { _model.tagCategorieComponentModels[ 'Keypvw_${categorieitemIndex}_of_${categorieitem.length}'] = m; }, child: TagCategorieComponentWidget( key: Key( 'Keypvw_${categorieitemIndex}_of_${categorieitem.length}'), categorieTag: categorieitemItem .toString(), ), ); }); }), ); }, ), ), ), ), ], ), ), ), Expanded( flex: 6, child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 6.0, 0.0, 0.0, 0.0), child: ClipRRect( child: Container( decoration: BoxDecoration( color: FlutterFlowTheme.of(context) .secondaryBackground, ), child: Align( alignment: AlignmentDirectional(-1.0, 0.0), child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 5.0), child: AutoSizeText( getJsonField( evenementenItem, r'''$.titel''', ).toString(), 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, shadows: [ Shadow( color: FlutterFlowTheme.of(context) .secondaryText, offset: Offset(2.0, 2.0), blurRadius: 2.0, ) ], ), overflow: TextOverflow.ellipsis, ), ), Row( mainAxisSize: MainAxisSize.max, children: [ Padding( padding: EdgeInsetsDirectional.fromSTEB( 2.0, 0.0, 4.0, 0.0), child: Icon( Icons.add_business_rounded, color: FlutterFlowTheme.of(context) .primaryText, size: 20.0, ), ), Flexible( child: Text( getJsonField( evenementenItem, r'''$.horecagelegenheid''', ).toString(), style: FlutterFlowTheme.of(context) .bodySmall .override( font: GoogleFonts.inter( fontWeight: FlutterFlowTheme.of( context) .bodySmall .fontWeight, fontStyle: FlutterFlowTheme.of( context) .bodySmall .fontStyle, ), letterSpacing: 0.0, fontWeight: FlutterFlowTheme.of( context) .bodySmall .fontWeight, fontStyle: FlutterFlowTheme.of( context) .bodySmall .fontStyle, ), ), ), ], ), Row( mainAxisSize: MainAxisSize.max, children: [ Padding( padding: EdgeInsetsDirectional.fromSTEB( 2.0, 0.0, 4.0, 0.0), child: Icon( Icons.location_on_sharp, color: FlutterFlowTheme.of(context) .primaryText, size: 20.0, ), ), Flexible( child: Text( getJsonField( evenementenItem, r'''$.adres''', ).toString(), style: FlutterFlowTheme.of(context) .bodySmall .override( font: GoogleFonts.inter( fontWeight: FlutterFlowTheme.of( context) .bodySmall .fontWeight, fontStyle: FlutterFlowTheme.of( context) .bodySmall .fontStyle, ), letterSpacing: 0.0, fontWeight: FlutterFlowTheme.of( context) .bodySmall .fontWeight, fontStyle: FlutterFlowTheme.of( context) .bodySmall .fontStyle, ), ), ), Text( FFLocalizations.of(context).getText( '4lehigdg' /* , */, ), style: FlutterFlowTheme.of(context) .bodyMedium .override( font: GoogleFonts.inter( fontWeight: FlutterFlowTheme.of( context) .bodyMedium .fontWeight, fontStyle: FlutterFlowTheme.of( context) .bodyMedium .fontStyle, ), letterSpacing: 0.0, fontWeight: FlutterFlowTheme.of(context) .bodyMedium .fontWeight, fontStyle: FlutterFlowTheme.of(context) .bodyMedium .fontStyle, ), ), Text( getJsonField( evenementenItem, r'''$.plaats''', ).toString(), style: FlutterFlowTheme.of(context) .bodySmall .override( font: GoogleFonts.inter( fontWeight: FlutterFlowTheme.of( context) .bodySmall .fontWeight, fontStyle: FlutterFlowTheme.of( context) .bodySmall .fontStyle, ), letterSpacing: 0.0, fontWeight: FlutterFlowTheme.of(context) .bodySmall .fontWeight, fontStyle: FlutterFlowTheme.of(context) .bodySmall .fontStyle, ), ), ], ), Row( mainAxisSize: MainAxisSize.max, children: [ Padding( padding: EdgeInsetsDirectional.fromSTEB( 2.0, 0.0, 4.0, 0.0), child: Icon( Icons.calendar_month, color: FlutterFlowTheme.of(context) .primaryText, size: 20.0, ), ), Flexible( child: Text( getJsonField( evenementenItem, r'''$.datum''', ).toString(), style: FlutterFlowTheme.of(context) .bodySmall .override( font: GoogleFonts.inter( fontWeight: FlutterFlowTheme.of( context) .bodySmall .fontWeight, fontStyle: FlutterFlowTheme.of( context) .bodySmall .fontStyle, ), letterSpacing: 0.0, fontWeight: FlutterFlowTheme.of( context) .bodySmall .fontWeight, fontStyle: FlutterFlowTheme.of( context) .bodySmall .fontStyle, ), ), ), ], ), Expanded( child: Text( getJsonField( evenementenItem, r'''$.inhoud''', ).toString(), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context) .bodySmall .override( font: GoogleFonts.inter( fontWeight: FlutterFlowTheme.of(context) .bodySmall .fontWeight, fontStyle: FlutterFlowTheme.of(context) .bodySmall .fontStyle, ), letterSpacing: 0.0, fontWeight: FlutterFlowTheme.of(context) .bodySmall .fontWeight, fontStyle: FlutterFlowTheme.of(context) .bodySmall .fontStyle, ), overflow: TextOverflow.ellipsis, ), ), ], ), ), ), ), ), ), ], ), ), ); }, ), ), ), ); } }