mijn_profiel_widget.dart 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. import '/backend/api_requests/api_calls.dart';
  2. import '/flutter_flow/flutter_flow_theme.dart';
  3. import '/flutter_flow/flutter_flow_util.dart';
  4. import '/flutter_flow/flutter_flow_widgets.dart';
  5. import '/horecagelegenhedenoverzicht/horecagelegenheidoverzicht_kaart/horecagelegenheidoverzicht_kaart_widget.dart';
  6. import 'dart:ui';
  7. import 'package:flutter/material.dart';
  8. import 'package:flutter_spinkit/flutter_spinkit.dart';
  9. import 'package:google_fonts/google_fonts.dart';
  10. import 'package:provider/provider.dart';
  11. import 'mijn_profiel_model.dart';
  12. export 'mijn_profiel_model.dart';
  13. class MijnProfielWidget extends StatefulWidget {
  14. const MijnProfielWidget({super.key});
  15. static String routeName = 'mijnProfiel';
  16. static String routePath = '/mijnProfiel';
  17. @override
  18. State<MijnProfielWidget> createState() => _MijnProfielWidgetState();
  19. }
  20. class _MijnProfielWidgetState extends State<MijnProfielWidget> with RouteAware {
  21. late MijnProfielModel _model;
  22. final scaffoldKey = GlobalKey<ScaffoldState>();
  23. @override
  24. void initState() {
  25. super.initState();
  26. _model = createModel(context, () => MijnProfielModel());
  27. }
  28. @override
  29. void dispose() {
  30. routeObserver.unsubscribe(this);
  31. _model.dispose();
  32. super.dispose();
  33. }
  34. @override
  35. void didUpdateWidget(MijnProfielWidget oldWidget) {
  36. super.didUpdateWidget(oldWidget);
  37. _model.widget = widget;
  38. }
  39. @override
  40. void didChangeDependencies() {
  41. super.didChangeDependencies();
  42. final route = DebugModalRoute.of(context);
  43. if (route != null) {
  44. routeObserver.subscribe(this, route);
  45. }
  46. debugLogGlobalProperty(context);
  47. }
  48. @override
  49. void didPopNext() {
  50. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  51. setState(() => _model.isRouteVisible = true);
  52. debugLogWidgetClass(_model);
  53. }
  54. }
  55. @override
  56. void didPush() {
  57. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  58. setState(() => _model.isRouteVisible = true);
  59. debugLogWidgetClass(_model);
  60. }
  61. }
  62. @override
  63. void didPop() {
  64. _model.isRouteVisible = false;
  65. }
  66. @override
  67. void didPushNext() {
  68. _model.isRouteVisible = false;
  69. }
  70. @override
  71. Widget build(BuildContext context) {
  72. DebugFlutterFlowModelContext.maybeOf(context)
  73. ?.parentModelCallback
  74. ?.call(_model);
  75. context.watch<FFAppState>();
  76. _model.horecagelegenheidoverzichtKaartModels.clear();
  77. return GestureDetector(
  78. onTap: () {
  79. FocusScope.of(context).unfocus();
  80. FocusManager.instance.primaryFocus?.unfocus();
  81. },
  82. child: Scaffold(
  83. key: scaffoldKey,
  84. backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
  85. appBar: AppBar(
  86. backgroundColor: FlutterFlowTheme.of(context).primary,
  87. automaticallyImplyLeading: true,
  88. actions: [],
  89. centerTitle: true,
  90. elevation: 0.0,
  91. ),
  92. body: SafeArea(
  93. top: true,
  94. child: SingleChildScrollView(
  95. child: Column(
  96. mainAxisSize: MainAxisSize.max,
  97. children: [
  98. Row(
  99. mainAxisSize: MainAxisSize.max,
  100. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  101. children: [
  102. Text(
  103. FFLocalizations.of(context).getText(
  104. 'aiokgolu' /* Mijn horecagelegenheden */,
  105. ),
  106. style: FlutterFlowTheme.of(context).titleMedium.override(
  107. font: GoogleFonts.roboto(
  108. fontWeight: FlutterFlowTheme.of(context)
  109. .titleMedium
  110. .fontWeight,
  111. fontStyle: FlutterFlowTheme.of(context)
  112. .titleMedium
  113. .fontStyle,
  114. ),
  115. letterSpacing: 0.0,
  116. fontWeight: FlutterFlowTheme.of(context)
  117. .titleMedium
  118. .fontWeight,
  119. fontStyle: FlutterFlowTheme.of(context)
  120. .titleMedium
  121. .fontStyle,
  122. ),
  123. ),
  124. FFButtonWidget(
  125. onPressed: () async {
  126. ScaffoldMessenger.of(context).showSnackBar(
  127. SnackBar(
  128. content: Text(
  129. 'Binnenkort beschikbaar: evenement aanmaken',
  130. style: TextStyle(
  131. color: FlutterFlowTheme.of(context).primaryText,
  132. ),
  133. ),
  134. duration: Duration(milliseconds: 4000),
  135. backgroundColor:
  136. FlutterFlowTheme.of(context).secondary,
  137. ),
  138. );
  139. },
  140. text: FFLocalizations.of(context).getText(
  141. '8a7ti6zc' /* + Voeg toe */,
  142. ),
  143. options: FFButtonOptions(
  144. height: 40.0,
  145. padding: EdgeInsetsDirectional.fromSTEB(
  146. 16.0, 0.0, 16.0, 0.0),
  147. iconPadding:
  148. EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
  149. color: FlutterFlowTheme.of(context).secondary,
  150. textStyle:
  151. FlutterFlowTheme.of(context).titleSmall.override(
  152. font: GoogleFonts.roboto(
  153. fontWeight: FlutterFlowTheme.of(context)
  154. .titleSmall
  155. .fontWeight,
  156. fontStyle: FlutterFlowTheme.of(context)
  157. .titleSmall
  158. .fontStyle,
  159. ),
  160. color: Colors.white,
  161. letterSpacing: 0.0,
  162. fontWeight: FlutterFlowTheme.of(context)
  163. .titleSmall
  164. .fontWeight,
  165. fontStyle: FlutterFlowTheme.of(context)
  166. .titleSmall
  167. .fontStyle,
  168. ),
  169. elevation: 0.0,
  170. borderRadius: BorderRadius.circular(8.0),
  171. ),
  172. ),
  173. ],
  174. ),
  175. Row(
  176. mainAxisSize: MainAxisSize.max,
  177. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  178. children: [
  179. Text(
  180. FFLocalizations.of(context).getText(
  181. '5iw84w8w' /* Mijn redactierechten */,
  182. ),
  183. style: FlutterFlowTheme.of(context).titleMedium.override(
  184. font: GoogleFonts.roboto(
  185. fontWeight: FlutterFlowTheme.of(context)
  186. .titleMedium
  187. .fontWeight,
  188. fontStyle: FlutterFlowTheme.of(context)
  189. .titleMedium
  190. .fontStyle,
  191. ),
  192. letterSpacing: 0.0,
  193. fontWeight: FlutterFlowTheme.of(context)
  194. .titleMedium
  195. .fontWeight,
  196. fontStyle: FlutterFlowTheme.of(context)
  197. .titleMedium
  198. .fontStyle,
  199. ),
  200. ),
  201. FFButtonWidget(
  202. onPressed: () async {
  203. ScaffoldMessenger.of(context).showSnackBar(
  204. SnackBar(
  205. content: Text(
  206. 'Binnenkort beschikbaar: evenement aanmaken',
  207. style: TextStyle(
  208. color: FlutterFlowTheme.of(context).primaryText,
  209. ),
  210. ),
  211. duration: Duration(milliseconds: 4000),
  212. backgroundColor:
  213. FlutterFlowTheme.of(context).secondary,
  214. ),
  215. );
  216. },
  217. text: FFLocalizations.of(context).getText(
  218. 'h3caw9re' /* + Voeg toe */,
  219. ),
  220. options: FFButtonOptions(
  221. height: 40.0,
  222. padding: EdgeInsetsDirectional.fromSTEB(
  223. 16.0, 0.0, 16.0, 0.0),
  224. iconPadding:
  225. EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
  226. color: FlutterFlowTheme.of(context).secondary,
  227. textStyle:
  228. FlutterFlowTheme.of(context).titleSmall.override(
  229. font: GoogleFonts.roboto(
  230. fontWeight: FlutterFlowTheme.of(context)
  231. .titleSmall
  232. .fontWeight,
  233. fontStyle: FlutterFlowTheme.of(context)
  234. .titleSmall
  235. .fontStyle,
  236. ),
  237. color: Colors.white,
  238. letterSpacing: 0.0,
  239. fontWeight: FlutterFlowTheme.of(context)
  240. .titleSmall
  241. .fontWeight,
  242. fontStyle: FlutterFlowTheme.of(context)
  243. .titleSmall
  244. .fontStyle,
  245. ),
  246. elevation: 0.0,
  247. borderRadius: BorderRadius.circular(8.0),
  248. ),
  249. ),
  250. ],
  251. ),
  252. FutureBuilder<ApiCallResponse>(
  253. future: MijnHorecagelegenhedenCall.call(
  254. sessionName: FFAppState().userSessionname,
  255. sessid: FFAppState().userSessionid,
  256. ),
  257. builder: (context, snapshot) {
  258. // Customize what your widget looks like when it's loading.
  259. if (!snapshot.hasData) {
  260. return Center(
  261. child: SizedBox(
  262. width: 80.0,
  263. height: 80.0,
  264. child: SpinKitFadingCircle(
  265. color: FlutterFlowTheme.of(context).primary,
  266. size: 80.0,
  267. ),
  268. ),
  269. );
  270. }
  271. final listViewMijnHorecagelegenhedenResponse =
  272. snapshot.data!;
  273. _model.debugBackendQueries[
  274. 'MijnHorecagelegenhedenCall_statusCode_ListView_gxiuys53'] =
  275. debugSerializeParam(
  276. listViewMijnHorecagelegenhedenResponse.statusCode,
  277. ParamType.int,
  278. link:
  279. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
  280. name: 'int',
  281. nullable: false,
  282. );
  283. _model.debugBackendQueries[
  284. 'MijnHorecagelegenhedenCall_responseBody_ListView_gxiuys53'] =
  285. debugSerializeParam(
  286. listViewMijnHorecagelegenhedenResponse.bodyText,
  287. ParamType.String,
  288. link:
  289. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
  290. name: 'String',
  291. nullable: false,
  292. );
  293. debugLogWidgetClass(_model);
  294. return Builder(
  295. builder: (context) {
  296. final horecaItem =
  297. listViewMijnHorecagelegenhedenResponse.jsonBody
  298. .toList();
  299. _model.debugGeneratorVariables[
  300. 'horecaItem${horecaItem.length > 100 ? ' (first 100)' : ''}'] =
  301. debugSerializeParam(
  302. horecaItem.take(100),
  303. ParamType.JSON,
  304. isList: true,
  305. link:
  306. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
  307. name: 'dynamic',
  308. nullable: false,
  309. );
  310. debugLogWidgetClass(_model);
  311. return ListView.builder(
  312. padding: EdgeInsets.zero,
  313. shrinkWrap: true,
  314. scrollDirection: Axis.vertical,
  315. itemCount: horecaItem.length,
  316. itemBuilder: (context, horecaItemIndex) {
  317. final horecaItemItem = horecaItem[horecaItemIndex];
  318. return Builder(builder: (_) {
  319. return DebugFlutterFlowModelContext(
  320. rootModel: _model.rootModel,
  321. parentModelCallback: (m) {
  322. _model.horecagelegenheidoverzichtKaartModels[
  323. 'Key4vp_${horecaItemIndex}_of_${horecaItem.length}'] = m;
  324. },
  325. child: HorecagelegenheidoverzichtKaartWidget(
  326. key: Key(
  327. 'Key4vp_${horecaItemIndex}_of_${horecaItem.length}'),
  328. titel: getJsonField(
  329. horecaItemItem,
  330. r'''$.titel''',
  331. ).toString(),
  332. logo: getJsonField(
  333. horecaItemItem,
  334. r'''$.logo''',
  335. ).toString(),
  336. nid: getJsonField(
  337. horecaItemItem,
  338. r'''$.nid''',
  339. ).toString(),
  340. adres: getJsonField(
  341. horecaItemItem,
  342. r'''$.adres''',
  343. ).toString(),
  344. plaats: getJsonField(
  345. horecaItemItem,
  346. r'''$.plaats''',
  347. ).toString(),
  348. categorie: (getJsonField(
  349. horecaItemItem,
  350. r'''$.categorie''',
  351. true,
  352. ) as List?)
  353. ?.map<String>((e) => e.toString())
  354. .toList()
  355. .cast<String>(),
  356. ),
  357. );
  358. });
  359. },
  360. );
  361. },
  362. );
  363. },
  364. ),
  365. FutureBuilder<ApiCallResponse>(
  366. future: MijnStadsrechtenCall.call(
  367. sessionName: FFAppState().userSessionname,
  368. sessid: FFAppState().userSessionid,
  369. ),
  370. builder: (context, snapshot) {
  371. // Customize what your widget looks like when it's loading.
  372. if (!snapshot.hasData) {
  373. return Center(
  374. child: SizedBox(
  375. width: 80.0,
  376. height: 80.0,
  377. child: SpinKitFadingCircle(
  378. color: FlutterFlowTheme.of(context).primary,
  379. size: 80.0,
  380. ),
  381. ),
  382. );
  383. }
  384. final listViewMijnStadsrechtenResponse = snapshot.data!;
  385. _model.debugBackendQueries[
  386. 'MijnStadsrechtenCall_statusCode_ListView_m1osuvrr'] =
  387. debugSerializeParam(
  388. listViewMijnStadsrechtenResponse.statusCode,
  389. ParamType.int,
  390. link:
  391. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
  392. name: 'int',
  393. nullable: false,
  394. );
  395. _model.debugBackendQueries[
  396. 'MijnStadsrechtenCall_responseBody_ListView_m1osuvrr'] =
  397. debugSerializeParam(
  398. listViewMijnStadsrechtenResponse.bodyText,
  399. ParamType.String,
  400. link:
  401. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
  402. name: 'String',
  403. nullable: false,
  404. );
  405. debugLogWidgetClass(_model);
  406. return Builder(
  407. builder: (context) {
  408. final rechtItem =
  409. listViewMijnStadsrechtenResponse.jsonBody.toList();
  410. _model.debugGeneratorVariables[
  411. 'rechtItem${rechtItem.length > 100 ? ' (first 100)' : ''}'] =
  412. debugSerializeParam(
  413. rechtItem.take(100),
  414. ParamType.JSON,
  415. isList: true,
  416. link:
  417. 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=mijnProfiel',
  418. name: 'dynamic',
  419. nullable: false,
  420. );
  421. debugLogWidgetClass(_model);
  422. return ListView.builder(
  423. padding: EdgeInsets.zero,
  424. shrinkWrap: true,
  425. scrollDirection: Axis.vertical,
  426. itemCount: rechtItem.length,
  427. itemBuilder: (context, rechtItemIndex) {
  428. final rechtItemItem = rechtItem[rechtItemIndex];
  429. return Column(
  430. mainAxisSize: MainAxisSize.max,
  431. children: [
  432. Text(
  433. '${getJsonField(
  434. rechtItemItem,
  435. r'''$.titel''',
  436. ).toString()} — ${getJsonField(
  437. rechtItemItem,
  438. r'''$.parent_titel''',
  439. ).toString()}',
  440. style: FlutterFlowTheme.of(context)
  441. .bodyMedium
  442. .override(
  443. font: GoogleFonts.roboto(
  444. fontWeight:
  445. FlutterFlowTheme.of(context)
  446. .bodyMedium
  447. .fontWeight,
  448. fontStyle:
  449. FlutterFlowTheme.of(context)
  450. .bodyMedium
  451. .fontStyle,
  452. ),
  453. letterSpacing: 0.0,
  454. fontWeight: FlutterFlowTheme.of(context)
  455. .bodyMedium
  456. .fontWeight,
  457. fontStyle: FlutterFlowTheme.of(context)
  458. .bodyMedium
  459. .fontStyle,
  460. ),
  461. ),
  462. ],
  463. );
  464. },
  465. );
  466. },
  467. );
  468. },
  469. ),
  470. ],
  471. ),
  472. ),
  473. ),
  474. ),
  475. );
  476. }
  477. }