|
@@ -3,6 +3,7 @@ import '/flutter_flow/flutter_flow_theme.dart';
|
|
|
import '/flutter_flow/flutter_flow_util.dart';
|
|
import '/flutter_flow/flutter_flow_util.dart';
|
|
|
import '/flutter_flow/flutter_flow_widgets.dart';
|
|
import '/flutter_flow/flutter_flow_widgets.dart';
|
|
|
import 'dart:ui';
|
|
import 'dart:ui';
|
|
|
|
|
+import '/custom_code/actions/index.dart' as actions;
|
|
|
import 'package:aligned_tooltip/aligned_tooltip.dart';
|
|
import 'package:aligned_tooltip/aligned_tooltip.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
|
@@ -223,6 +224,62 @@ class _HeaderButtonsComponentWidgetState
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
|
|
+ Builder(
|
|
|
|
|
+ builder: (context) {
|
|
|
|
|
+ if (FFAppState()
|
|
|
|
|
+ .favorieteGemeenteIds
|
|
|
|
|
+ .contains(FFAppState().gemeenteSelectId) ==
|
|
|
|
|
+ true) {
|
|
|
|
|
+ return FlutterFlowIconButton(
|
|
|
|
|
+ borderRadius: 8.0,
|
|
|
|
|
+ buttonSize: 40.0,
|
|
|
|
|
+ fillColor: Color(0x004B39EF),
|
|
|
|
|
+ icon: Icon(
|
|
|
|
|
+ Icons.favorite,
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ size: 24.0,
|
|
|
|
|
+ ),
|
|
|
|
|
+ onPressed: () async {
|
|
|
|
|
+ await actions.drupalRequest(
|
|
|
|
|
+ 'POST',
|
|
|
|
|
+ 'https://uitgaanskrant.com/nl/flutterdrup/favorieten/unflag.json',
|
|
|
|
|
+ FFAppState().userSessionname,
|
|
|
|
|
+ FFAppState().userSessionid,
|
|
|
|
|
+ FFAppState().userToken,
|
|
|
|
|
+ '{\"entity_id\": ${FFAppState().gemeenteSelectId}, \"entity_type\": \"taxonomy_term\"}',
|
|
|
|
|
+ );
|
|
|
|
|
+ FFAppState().removeFromFavorieteGemeenteIds(
|
|
|
|
|
+ FFAppState().gemeenteSelectId);
|
|
|
|
|
+ safeSetState(() {});
|
|
|
|
|
+ },
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return FlutterFlowIconButton(
|
|
|
|
|
+ borderRadius: 8.0,
|
|
|
|
|
+ buttonSize: 40.0,
|
|
|
|
|
+ fillColor: Color(0x004B39EF),
|
|
|
|
|
+ icon: Icon(
|
|
|
|
|
+ Icons.favorite_border,
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ size: 24.0,
|
|
|
|
|
+ ),
|
|
|
|
|
+ onPressed: () async {
|
|
|
|
|
+ await actions.drupalRequest(
|
|
|
|
|
+ 'POST',
|
|
|
|
|
+ 'https://uitgaanskrant.com/nl/flutterdrup/favorieten/flag.json',
|
|
|
|
|
+ FFAppState().userSessionname,
|
|
|
|
|
+ FFAppState().userSessionid,
|
|
|
|
|
+ FFAppState().userToken,
|
|
|
|
|
+ '{\"entity_id\": ${FFAppState().gemeenteSelectId}, \"entity_type\": \"taxonomy_term\"}',
|
|
|
|
|
+ );
|
|
|
|
|
+ FFAppState().addToFavorieteGemeenteIds(
|
|
|
|
|
+ FFAppState().gemeenteSelectId);
|
|
|
|
|
+ safeSetState(() {});
|
|
|
|
|
+ },
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|