| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498 |
- 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 '/horecagelegenhedenoverzicht/horecagelegenheidoverzicht_kaart/horecagelegenheidoverzicht_kaart_widget.dart';
- import 'dart:ui';
- 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 'mijn_profiel_model.dart';
- export 'mijn_profiel_model.dart';
- class MijnProfielWidget extends StatefulWidget {
- const MijnProfielWidget({super.key});
- static String routeName = 'mijnProfiel';
- static String routePath = '/mijnProfiel';
- @override
- State<MijnProfielWidget> createState() => _MijnProfielWidgetState();
- }
- class _MijnProfielWidgetState extends State<MijnProfielWidget> with RouteAware {
- late MijnProfielModel _model;
- final scaffoldKey = GlobalKey<ScaffoldState>();
- @override
- void initState() {
- super.initState();
- _model = createModel(context, () => MijnProfielModel());
- }
- @override
- void dispose() {
- routeObserver.unsubscribe(this);
- _model.dispose();
- super.dispose();
- }
- @override
- void didUpdateWidget(MijnProfielWidget 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>();
- _model.horecagelegenheidoverzichtKaartModels.clear();
- return GestureDetector(
- onTap: () {
- FocusScope.of(context).unfocus();
- FocusManager.instance.primaryFocus?.unfocus();
- },
- child: Scaffold(
- key: scaffoldKey,
- backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
- appBar: AppBar(
- backgroundColor: FlutterFlowTheme.of(context).primary,
- automaticallyImplyLeading: true,
- actions: [],
- centerTitle: true,
- elevation: 0.0,
- ),
- body: SafeArea(
- top: true,
- child: SingleChildScrollView(
- child: Column(
- mainAxisSize: MainAxisSize.max,
- children: [
- Row(
- mainAxisSize: MainAxisSize.max,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text(
- FFLocalizations.of(context).getText(
- 'aiokgolu' /* Mijn horecagelegenheden */,
- ),
- style: FlutterFlowTheme.of(context).titleMedium.override(
- font: GoogleFonts.interTight(
- fontWeight: FlutterFlowTheme.of(context)
- .titleMedium
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .titleMedium
- .fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight: FlutterFlowTheme.of(context)
- .titleMedium
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .titleMedium
- .fontStyle,
- ),
- ),
- FFButtonWidget(
- onPressed: () async {
- ScaffoldMessenger.of(context).showSnackBar(
- SnackBar(
- content: Text(
- 'Binnenkort beschikbaar: evenement aanmaken',
- style: TextStyle(
- color: FlutterFlowTheme.of(context).primaryText,
- ),
- ),
- duration: Duration(milliseconds: 4000),
- backgroundColor:
- FlutterFlowTheme.of(context).secondary,
- ),
- );
- },
- text: FFLocalizations.of(context).getText(
- '8a7ti6zc' /* + Voeg toe */,
- ),
- 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),
- ),
- ),
- ],
- ),
- Row(
- mainAxisSize: MainAxisSize.max,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text(
- FFLocalizations.of(context).getText(
- '5iw84w8w' /* Mijn redactierechten */,
- ),
- style: FlutterFlowTheme.of(context).titleMedium.override(
- font: GoogleFonts.interTight(
- fontWeight: FlutterFlowTheme.of(context)
- .titleMedium
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .titleMedium
- .fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight: FlutterFlowTheme.of(context)
- .titleMedium
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .titleMedium
- .fontStyle,
- ),
- ),
- FFButtonWidget(
- onPressed: () async {
- ScaffoldMessenger.of(context).showSnackBar(
- SnackBar(
- content: Text(
- 'Binnenkort beschikbaar: evenement aanmaken',
- style: TextStyle(
- color: FlutterFlowTheme.of(context).primaryText,
- ),
- ),
- duration: Duration(milliseconds: 4000),
- backgroundColor:
- FlutterFlowTheme.of(context).secondary,
- ),
- );
- },
- text: FFLocalizations.of(context).getText(
- 'h3caw9re' /* + Voeg toe */,
- ),
- 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),
- ),
- ),
- ],
- ),
- FutureBuilder<ApiCallResponse>(
- future: MijnHorecagelegenhedenCall.call(
- sessionName: FFAppState().userSessionname,
- sessid: FFAppState().userSessionid,
- ),
- builder: (context, snapshot) {
- // Customize what your widget looks like when it's loading.
- if (!snapshot.hasData) {
- return Center(
- child: SizedBox(
- width: 80.0,
- height: 80.0,
- child: SpinKitFadingCircle(
- color: Color(0xFFB1061E),
- size: 80.0,
- ),
- ),
- );
- }
- final listViewMijnHorecagelegenhedenResponse =
- snapshot.data!;
- _model.debugBackendQueries[
- 'MijnHorecagelegenhedenCall_statusCode_ListView_gxiuys53'] =
- debugSerializeParam(
- listViewMijnHorecagelegenhedenResponse.statusCode,
- ParamType.int,
- link:
- 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
- name: 'int',
- nullable: false,
- );
- _model.debugBackendQueries[
- 'MijnHorecagelegenhedenCall_responseBody_ListView_gxiuys53'] =
- debugSerializeParam(
- listViewMijnHorecagelegenhedenResponse.bodyText,
- ParamType.String,
- link:
- 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
- name: 'String',
- nullable: false,
- );
- debugLogWidgetClass(_model);
- return Builder(
- builder: (context) {
- final horecaItem =
- listViewMijnHorecagelegenhedenResponse.jsonBody
- .toList();
- _model.debugGeneratorVariables[
- 'horecaItem${horecaItem.length > 100 ? ' (first 100)' : ''}'] =
- debugSerializeParam(
- horecaItem.take(100),
- ParamType.JSON,
- isList: true,
- link:
- 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
- name: 'dynamic',
- nullable: false,
- );
- debugLogWidgetClass(_model);
- return ListView.builder(
- padding: EdgeInsets.zero,
- shrinkWrap: true,
- scrollDirection: Axis.vertical,
- itemCount: horecaItem.length,
- itemBuilder: (context, horecaItemIndex) {
- final horecaItemItem = horecaItem[horecaItemIndex];
- return Builder(builder: (_) {
- return DebugFlutterFlowModelContext(
- rootModel: _model.rootModel,
- parentModelCallback: (m) {
- _model.horecagelegenheidoverzichtKaartModels[
- 'Key4vp_${horecaItemIndex}_of_${horecaItem.length}'] = m;
- },
- child: HorecagelegenheidoverzichtKaartWidget(
- key: Key(
- 'Key4vp_${horecaItemIndex}_of_${horecaItem.length}'),
- titel: getJsonField(
- horecaItemItem,
- r'''$.titel''',
- ).toString(),
- logo: getJsonField(
- horecaItemItem,
- r'''$.logo''',
- ).toString(),
- nid: getJsonField(
- horecaItemItem,
- r'''$.nid''',
- ).toString(),
- adres: getJsonField(
- horecaItemItem,
- r'''$.adres''',
- ).toString(),
- plaats: getJsonField(
- horecaItemItem,
- r'''$.plaats''',
- ).toString(),
- categorie: (getJsonField(
- horecaItemItem,
- r'''$.categorie''',
- true,
- ) as List?)
- ?.map<String>((e) => e.toString())
- .toList()
- .cast<String>(),
- ),
- );
- });
- },
- );
- },
- );
- },
- ),
- FutureBuilder<ApiCallResponse>(
- future: MijnStadsrechtenCall.call(
- sessionName: FFAppState().userSessionname,
- sessid: FFAppState().userSessionid,
- ),
- builder: (context, snapshot) {
- // Customize what your widget looks like when it's loading.
- if (!snapshot.hasData) {
- return Center(
- child: SizedBox(
- width: 80.0,
- height: 80.0,
- child: SpinKitFadingCircle(
- color: Color(0xFFB1061E),
- size: 80.0,
- ),
- ),
- );
- }
- final listViewMijnStadsrechtenResponse = snapshot.data!;
- _model.debugBackendQueries[
- 'MijnStadsrechtenCall_statusCode_ListView_m1osuvrr'] =
- debugSerializeParam(
- listViewMijnStadsrechtenResponse.statusCode,
- ParamType.int,
- link:
- 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
- name: 'int',
- nullable: false,
- );
- _model.debugBackendQueries[
- 'MijnStadsrechtenCall_responseBody_ListView_m1osuvrr'] =
- debugSerializeParam(
- listViewMijnStadsrechtenResponse.bodyText,
- ParamType.String,
- link:
- 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
- name: 'String',
- nullable: false,
- );
- debugLogWidgetClass(_model);
- return Builder(
- builder: (context) {
- final rechtItem =
- listViewMijnStadsrechtenResponse.jsonBody.toList();
- _model.debugGeneratorVariables[
- 'rechtItem${rechtItem.length > 100 ? ' (first 100)' : ''}'] =
- debugSerializeParam(
- rechtItem.take(100),
- ParamType.JSON,
- isList: true,
- link:
- 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
- name: 'dynamic',
- nullable: false,
- );
- debugLogWidgetClass(_model);
- return ListView.builder(
- padding: EdgeInsets.zero,
- shrinkWrap: true,
- scrollDirection: Axis.vertical,
- itemCount: rechtItem.length,
- itemBuilder: (context, rechtItemIndex) {
- final rechtItemItem = rechtItem[rechtItemIndex];
- return Column(
- mainAxisSize: MainAxisSize.max,
- children: [
- Text(
- '${getJsonField(
- rechtItemItem,
- r'''$.titel''',
- ).toString()} — ${getJsonField(
- rechtItemItem,
- r'''$.parent_titel''',
- ).toString()}',
- 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,
- ),
- ),
- ],
- );
- },
- );
- },
- );
- },
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
- }
|